DtkCore
DTK Core module
dfilesystemwatcher.h
1/*
2 * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef DFILESYSTEMWATCHER_H
19#define DFILESYSTEMWATCHER_H
20
21#include "dtkcore_global.h"
22#include "dobject.h"
23
24#include <QObject>
25
26DCORE_BEGIN_NAMESPACE
27
28class DFileSystemWatcherPrivate;
29class LIBDTKCORESHARED_EXPORT DFileSystemWatcher : public QObject, public DObject
30{
31 Q_OBJECT
32 D_DECLARE_PRIVATE(DFileSystemWatcher)
33
34public:
35 DFileSystemWatcher(QObject *parent = Q_NULLPTR);
36 DFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR);
38
39 bool addPath(const QString &file);
40 QStringList addPaths(const QStringList &files);
41 bool removePath(const QString &file);
42 QStringList removePaths(const QStringList &files);
43
44 QStringList files() const;
45 QStringList directories() const;
46
47Q_SIGNALS:
48 void fileDeleted(const QString &path, const QString &name, QPrivateSignal);
49 void fileAttributeChanged(const QString &path, const QString &name, QPrivateSignal);
50 void fileClosed(const QString &path, const QString &name, QPrivateSignal);
51 void fileMoved(const QString &fromPath, const QString &fromName,
52 const QString &toPath, const QString &toName, QPrivateSignal);
53 void fileCreated(const QString &path, const QString &name, QPrivateSignal);
54 void fileModified(const QString &path, const QString &name, QPrivateSignal);
55
56private:
57 Q_PRIVATE_SLOT(d_func(), void _q_readFromInotify())
58};
59
60DCORE_END_NAMESPACE
61
62#endif // DFILESYSTEMWATCHER_H
The DFileSystemWatcher class provides an interface for monitoring files and directories for modificat...
Definition: dfilesystemwatcher.h:30
一些宏的定义.
Definition: dobject.h:38