forked from openkylin/ukui-search
42 lines
1.3 KiB
C
42 lines
1.3 KiB
C
|
#ifndef APPLICATIONINFOSTORAGE_H
|
||
|
#define APPLICATIONINFOSTORAGE_H
|
||
|
|
||
|
#include <QVariant>
|
||
|
#include "application-property.h"
|
||
|
namespace UkuiSearch {
|
||
|
class ApplicationInfoStoragePrivate;
|
||
|
class ApplicationInfoStorage
|
||
|
{
|
||
|
public:
|
||
|
ApplicationInfoStorage();
|
||
|
ApplicationInfoStorage(Properties properties);
|
||
|
ApplicationInfoStorage(const ApplicationInfoStorage &other);
|
||
|
~ApplicationInfoStorage();
|
||
|
|
||
|
ApplicationInfoStorage & operator=(const ApplicationInfoStorage &rhs);
|
||
|
/**
|
||
|
* @brief 查询当前容器内包含的应用列表
|
||
|
* @return 所有desktop路径的QStringlist
|
||
|
*/
|
||
|
QStringList applicationKeys() const;
|
||
|
/**
|
||
|
* @brief 查询当前容器包含的信息种类
|
||
|
* @return QVector<ApplicationProperty::Property>
|
||
|
*/
|
||
|
Properties &applicationInfoKeys() const;
|
||
|
/**
|
||
|
* @brief 查询某个应用的某个信息
|
||
|
* @param desktopFile
|
||
|
* @param info
|
||
|
* @return 以info的数据类型格式返回特定信息
|
||
|
*/
|
||
|
QVariant ApplicationInfo(const QString &desktopFile, ApplicationProperty::Property property);
|
||
|
ApplicationInfoMap &allData();
|
||
|
void addData(const QString &desktopFile, ApplicationProperty::Property property, const QVariant &value);
|
||
|
|
||
|
private:
|
||
|
ApplicationInfoStoragePrivate *d = nullptr;
|
||
|
};
|
||
|
}
|
||
|
#endif // APPLICATIONINFOSTORAGE_H
|