| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #ifndef INOTIFY_H |
| 6 | #define INOTIFY_H |
| 7 | |
| 8 | #include <QObject> |
| 9 | |
| 10 | class InotifyPrivate; |
| 11 | class Inotify : public QObject |
| 12 | { |
| 13 | Q_OBJECT |
| 14 | Q_DISABLE_COPY(Inotify) |
| 15 | InotifyPrivate * const d; |
| 16 | public: |
| 17 | explicit Inotify(QObject *parent = nullptr); |
| 18 | virtual ~Inotify(); |
| 19 | static Inotify *globalInstance(); |
| 20 | |
| 21 | public slots: |
| 22 | void addPath(const QString &path); |
| 23 | void removePath(const QString &path); |
| 24 | void addIgnorePath(const QString &path); |
| 25 | void removeIgnorePath(const QString &path); |
| 26 | |
| 27 | signals: |
| 28 | void modified(const QString &filePath); //File && Dir |
| 29 | void opened(const QString &filePath); //File && Dir |
| 30 | void closed(const QString &filePath); //File && Dir |
| 31 | void movedSub(const QString &filePath); //Dir |
| 32 | void createdSub(const QString &filePath); //Dir |
| 33 | void deletedSub(const QString &filePath); //Dir |
| 34 | void movedSelf(const QString &filePath); //File & &Dir |
| 35 | void deletedSelf(const QString &filePath); //File && Dir |
| 36 | |
| 37 | void ignoreModified(const QString &filePath); //File && Dir |
| 38 | void ignoreOpened(const QString &filePath); //File && Dir |
| 39 | void ignoreClosed(const QString &filePath); //File && Dir |
| 40 | void ignoreMovedSub(const QString &filePath); //Dir |
| 41 | void ignoreCreatedSub(const QString &filePath); //Dir |
| 42 | void ignoreDeletedSub(const QString &filePath); //Dir |
| 43 | void ignoreMovedSelf(const QString &filePath); //File & &Dir |
| 44 | void ignoreDeletedSelf(const QString &filePath); //File && Dir |
| 45 | }; |
| 46 | |
| 47 | #endif // INOTIFY_H |
| 48 | |