| 1 |
// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DFILEWATCHERMANAGER_H |
| 6 |
#define DFILEWATCHERMANAGER_H |
| 7 |
|
| 8 |
#include "dtkcore_global.h" |
| 9 |
#include "dobject.h" |
| 10 |
|
| 11 |
#include <QObject> |
| 12 |
#include <QString> |
| 13 |
|
| 14 |
DCORE_BEGIN_NAMESPACE |
| 15 |
|
| 16 |
class DFileWatcher; |
| 17 |
|
| 18 |
class DFileWatcherManagerPrivate; |
| 19 |
class LIBDTKCORESHARED_EXPORT DFileWatcherManager : public QObject, public DObject |
| 20 |
{ |
| 21 |
Q_OBJECT |
| 22 |
|
| 23 |
public: |
| 24 |
explicit DFileWatcherManager(QObject *parent = 0); |
| 25 |
~DFileWatcherManager(); |
| 26 |
|
| 27 |
DFileWatcher *add(const QString &filePath); |
| 28 |
void remove(const QString &filePath); |
| 29 |
void removeAll(); |
| 30 |
QStringList watchedFiles() const; |
| 31 |
Q_SIGNALS: |
| 32 |
void fileDeleted(const QString &filePath); |
| 33 |
void fileAttributeChanged(const QString &filePath); |
| 34 |
void fileMoved(const QString &fromFilePath, const QString &toFilePath); |
| 35 |
void subfileCreated(const QString &filePath); |
| 36 |
void fileModified(const QString &filePath); |
| 37 |
void fileClosed(const QString &filePath); |
| 38 |
|
| 39 |
private: |
| 40 |
QScopedPointer<DFileWatcherManagerPrivate> d_ptr; |
| 41 |
|
| 42 |
D_DECLARE_PRIVATE(DFileWatcherManager) |
| 43 |
Q_DISABLE_COPY(DFileWatcherManager) |
| 44 |
}; |
| 45 |
|
| 46 |
DCORE_END_NAMESPACE |
| 47 |
|
| 48 |
#endif // DFILEWATCHERMANAGER_H |