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
00111 void addDir(const QString& path, WatchModes watchModes = WatchDirOnly);
00112
00117 void addFile(const QString& file);
00118
00124 QDateTime ctime(const QString& path) const;
00125
00132 void removeDir(const QString& path);
00133
00140 void removeFile(const QString& file);
00141
00154 bool stopDirScan(const QString& path);
00155
00169 bool restartDirScan(const QString& path);
00170
00187 void startScan( bool notify=false, bool skippedToo=false );
00188
00194 void stopScan();
00195
00201 bool isStopped();
00202
00208 bool contains( const QString& path ) const;
00209
00214 static void statistics();
00215
00220 void setCreated( const QString &path );
00225 void setDirty( const QString &path );
00230 void setDeleted( const QString &path );
00231
00232 enum Method { FAM, INotify, DNotify, Stat };
00237 Method internalMethod();
00238
00251 static KDirWatch* self();
00257 static bool exists();
00258
00259 Q_SIGNALS:
00260
00274 void dirty (const QString &path);
00275
00280 void created (const QString &path );
00281
00288 void deleted (const QString &path );
00289
00290 private:
00291 KDirWatchPrivate *const d;
00292 };
00293
00294 Q_DECLARE_OPERATORS_FOR_FLAGS(KDirWatch::WatchModes)
00295
00296 #endif
00297
00298