ukui-search/libsearch/appdata/app-info-table-private.h

66 lines
1.9 KiB
C
Raw Normal View History

2022-03-01 17:39:53 +08:00
#ifndef APPINFOTABLEPRIVATE_H
#define APPINFOTABLEPRIVATE_H
#include "app-info-table.h"
2022-03-01 17:39:53 +08:00
#include <QObject>
#include <QDBusInterface>
#include <QSqlDatabase>
2022-03-01 17:39:53 +08:00
namespace UkuiSearch {
2022-03-01 17:39:53 +08:00
class AppInfoTablePrivate : public QObject
{
Q_OBJECT
friend class AppInfoTable;
2022-03-01 17:39:53 +08:00
public:
explicit AppInfoTablePrivate(AppInfoTable *parent = nullptr);
AppInfoTablePrivate(AppInfoTablePrivate &) = delete;
AppInfoTablePrivate &operator =(const AppInfoTablePrivate &) = delete;
//设置应用的置顶和收藏
void setAppFavoritesState(const QString &desktopfp);
void setAppFavoritesState(const QString &desktopfp, uint num);
void setAppTopState(const QString &desktopfp);
void setAppTopState(const QString &desktopfp, uint num);
//搜索接口
bool searchInstallApp(QString &keyWord, QStringList &installAppInfoRes);
bool searchInstallApp(QStringList &keyWord, QStringList &installAppInfoRes);
//数据库错误信息
QString lastError(void) const;
//通过pid查找desktop文件
bool tranPidToDesktopFp(int pid, QString &desktopfp);
//下面的接口都不外放,暂时没啥用
2023-03-14 16:06:37 +08:00
bool setAppLaunchTimes(const QString &desktopfp, size_t num);
bool updateAppLaunchTimes(const QString &desktopfp);
bool setAppLockState(const QString &desktopfp, size_t num);
2022-03-01 17:39:53 +08:00
private:
~AppInfoTablePrivate();
bool initDateBaseConnection();
bool openDataBase();
void closeDataBase();
QDBusInterface *m_signalTransInterface = nullptr;
QDBusInterface *m_appDBInterface = nullptr;
AppInfoTable *q = nullptr;
QSqlDatabase *m_database = nullptr;
QString m_ConnectionName;
2022-03-01 17:39:53 +08:00
public Q_SLOTS:
void sendAppDBItemsUpdate(ApplicationInfoMap results);
void sendAppDBItemsUpdateAll(QStringList desktopFilePaths);
void sendAppDBItemsAdd(QStringList desktopFilePaths);
void sendAppDBItemsDelete(QStringList desktopFilePaths);
2022-03-01 17:39:53 +08:00
};
}
#endif // APPINFOTABLEPRIVATE_H