1 /****************************************************************************
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Copyright (C) 2016 Ivailo Monev
6 ** This file is part of the QtCore module of the Katie Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser
12 ** General Public License version 2.1 as published by the Free Software
13 ** Foundation and appearing in the file LICENSE.LGPL included in the
14 ** packaging of this file. Please review the following information to
15 ** ensure the GNU Lesser General Public License version 2.1 requirements
16 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
20 ****************************************************************************/
22 #ifndef QFILESYSTEMWATCHER_H
23 #define QFILESYSTEMWATCHER_H
25 #include <QtCore/qobject.h>
27 #ifndef QT_NO_FILESYSTEMWATCHER
33 class QFileSystemWatcherPrivate;
35 class Q_CORE_EXPORT QFileSystemWatcher : public QObject
38 Q_DECLARE_PRIVATE(QFileSystemWatcher)
41 QFileSystemWatcher(QObject *parent = nullptr);
42 QFileSystemWatcher(const QStringList &paths, QObject *parent = nullptr);
43 ~QFileSystemWatcher();
45 void addPath(const QString &file);
46 void addPaths(const QStringList &files);
47 void removePath(const QString &file);
48 void removePaths(const QStringList &files);
50 QStringList files() const;
51 QStringList directories() const;
54 void setInterval(int interval);
57 void fileChanged(const QString &path);
58 void directoryChanged(const QString &path);
61 Q_PRIVATE_SLOT(d_func(), void _q_timeout())
67 #endif // QT_NO_FILESYSTEMWATCHER
68 #endif // QFILESYSTEMWATCHER_H