KIO
kdirwatch.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KDIRWATCH_H
00019 #define _KDIRWATCH_H
00020
00021 #include <QtCore/QDateTime>
00022 #include <QtCore/QObject>
00023 #include <QtCore/QString>
00024
00025 #include <kio/kio_export.h>
00026
00027 class KDirWatchPrivate;
00028
00062 class KIO_EXPORT KDirWatch : public QObject
00063 {
00064 Q_OBJECT
00065
00066 public:
00067
00071 enum WatchMode {
00072 WatchDirOnly = 0,
00073 WatchFiles = 0x01,
00074 WatchSubDirs = 0x02
00075 };
00076 Q_DECLARE_FLAGS(WatchModes, WatchMode)
00077
00078
00085 KDirWatch (QObject* parent = 0);
00086
00092 ~KDirWatch();
00093
00113 void addDir(const QString& path, WatchModes watchModes = WatchDirOnly);
00114
00120 void addFile(const QString& file);
00121
00127 QDateTime ctime(const QString& path) const;
00128
00135 void removeDir(const QString& path);
00136
00143 void removeFile(const QString& file);
00144
00157 bool stopDirScan(const QString& path);
00158
00172 bool restartDirScan(const QString& path);
00173
00190 void startScan( bool notify=false, bool skippedToo=false );
00191
00197 void stopScan();
00198
00204 bool isStopped();
00205
00211 bool contains( const QString& path ) const;
00212
00217 static void statistics();
00218
00223 void setCreated( const QString &path );
00228 void setDirty( const QString &path );
00233 void setDeleted( const QString &path );
00234
00235 enum Method { FAM, INotify, DNotify, Stat };
00240 Method internalMethod();
00241
00254 static KDirWatch* self();
00260 static bool exists();
00261
00262 Q_SIGNALS:
00263
00277 void dirty (const QString &path);
00278
00283 void created (const QString &path );
00284
00291 void deleted (const QString &path );
00292
00293 private:
00294 KDirWatchPrivate *const d;
00295 };
00296
00297 Q_DECLARE_OPERATORS_FOR_FLAGS(KDirWatch::WatchModes)
00298
00299 #endif
00300
00301