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
00219 enum Method { FAM, INotify, DNotify, Stat };
00224 Method internalMethod();
00225
00238 static KDirWatch* self();
00244 static bool exists();
00245
00246 public Q_SLOTS:
00247
00252 void setCreated( const QString &path );
00253
00258 void setDirty( const QString &path );
00259
00264 void setDeleted( const QString &path );
00265
00266 Q_SIGNALS:
00267
00281 void dirty (const QString &path);
00282
00287 void created (const QString &path );
00288
00295 void deleted (const QString &path );
00296
00297 private:
00298 KDirWatchPrivate *const d;
00299 };
00300
00301 Q_DECLARE_OPERATORS_FOR_FLAGS(KDirWatch::WatchModes)
00302
00303 #endif
00304
00305