/*
*
* Copyright (C) 2023, KylinSoft 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 3 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, see .
*
*/
#ifndef APPLICATIONINFOSTORAGE_H
#define APPLICATIONINFOSTORAGE_H
#include
#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
*/
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