ukui-control-center/libukcc/interface/ukcccommon.h

181 lines
4.2 KiB
C
Raw Normal View History

2023-05-23 20:24:55 +08:00
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef UKCCCOMMON_H
#define UKCCCOMMON_H
#include <QRect>
#include <QCursor>
#include <QObject>
#include <QWidget>
#include <QSettings>
#include <QApplication>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QDesktopWidget>
#include <QVariantMap>
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QtDBus/QDBusConnection>
#include <kysdk/kysdk-base/libkydiagnostics.h>
#include "libukcc_global.h"
namespace ukcc
{
/**
* @brief
*
*/
class LIBUKCC_EXPORT UkccCommon : public QObject
{
Q_OBJECT
public:
/**
* @brief
*
*/
explicit UkccCommon();
/**
* @brief
*
*/
~UkccCommon();
public:
/**
* @brief widget
*
* @param widget
*/
static void centerToScreen(QWidget *widget);
/**
* @brief
*
* @return
*/
static QRect sizeOnCursor();
/**
* @brief ukui-control-center-security-config.json
*
* @return QVariantMap
*/
static QVariantMap getModuleHideStatus();
/**
* @brief CPU
*
* @return QString
*/
static QString getCpuInfo();
/**
* @brief CPU
*
* @return QString CPU
*/
static QString getCpuArchitecture();
/**
* @brief
*
* @return bool truefalse
*/
static bool isExistEffect();
/**
* @brief
*
* @return bool truefalse
*/
static bool isExitBattery();
/**
* @brief set kwin cursorSize
*
* @param size
*/
static void setKwinMouseSize(int size);
/**
* @brief wayland
*
* @return bool truefalse
*/
static bool isWayland();
/**
* @brief openkylin
*
* @return bool truefalse
*/
static bool isOpenkylin();
/**
* @brief 22.04
*
* @return bool truefalse
*/
static bool isCommunity();
/**
* @brief mavis
*
* @return bool truefalse
*/
static bool isTablet();
/**
* @brief v10sp1-zyj
*
* @return bool truefalse
*/
static bool isZJY();
/**
* @brief
*
* @return QString hostname
*/
static QString getHostName();
/**
* @brief
*
* @param pluginName
* @param settingsName
* @param action
* @param value
* @return bool
*/
static bool buriedSettings(QString pluginName, QString settingsName, QString action, QString value = nullptr);
/**
* @brief bool string
*
* @param b true or false
* @return QString "true" or "false"
*/
static QString boolToString(bool b);
/**
* @brief
*
* @return QString
*/
static QString getUkccVersion();
/**
* @brief system-product-name
*
* @return QString system-product-name
*/
static QString getProductName();
};
}
#endif // UKCCCOMMON_H