ukui-search/libsearch/dirwatcher/dir-watcher.h

63 lines
1.8 KiB
C
Raw Normal View History

2023-04-11 10:19:35 +08:00
/*
*
* 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 <https://www.gnu.org/licenses/>.
*
*/
2022-03-01 10:37:03 +08:00
#ifndef MOUNTDISKLISTENER_H
#define MOUNTDISKLISTENER_H
#include <QObject>
#include <QDBusInterface>
#include <QDBusReply>
2022-03-01 10:37:03 +08:00
class DirWatcher : public QObject
{
Q_OBJECT
public:
static DirWatcher *getDirWatcher();
public Q_SLOTS:
2022-04-14 11:16:26 +08:00
void initDbusService();
QStringList currentIndexableDir();
2022-03-01 10:37:03 +08:00
QStringList currentBlackListOfIndex();
QStringList currentSearchableDir();
QStringList searchableDirForSearchApplication();
2022-03-01 10:37:03 +08:00
QStringList blackListOfDir(const QString &dirPath);
QStringList getBlockDirsOfUser();
2023-04-08 16:54:01 +08:00
void appendSearchDir(const QString &path);
void removeSearchDir(const QString &path);
void appendIndexableListItem(const QString &path);
void removeIndexableListItem(const QString &path);
void sendAppendSignal(const QString &path, const QStringList &blockList);
void sendRemoveSignal(const QString&path);
Q_SIGNALS:
void appendIndexItem(const QString&, const QStringList&);
void removeIndexItem(const QString&);
void mountAdded(const QString&);
2022-03-01 10:37:03 +08:00
private:
DirWatcher(QObject *parent = nullptr);
~DirWatcher();
2022-03-01 10:37:03 +08:00
QDBusInterface *m_dbusInterface = nullptr;
2022-03-01 10:37:03 +08:00
};
#endif // MOUNTDISKLISTENER_H