00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KSIMPLEDIRWATCH_H
00019 #define _KSIMPLEDIRWATCH_H
00020
00021 #include <tqtimer.h>
00022 #include <tqdatetime.h>
00023 #include <tqmap.h>
00024
00025 #include <tdelibs_export.h>
00026
00027 #define kdirwatch KSimpleDirWatch::self()
00028
00029 class KSimpleDirWatchPrivate;
00030
00066 class TDEIO_EXPORT KSimpleDirWatch : public TQObject
00067 {
00068 Q_OBJECT
00069
00070 public:
00079 KSimpleDirWatch (TQObject* parent = 0, const char* name = 0);
00080
00086 ~KSimpleDirWatch();
00087
00102 void addDir(const TQString& path,
00103 bool watchFiles = false, bool recursive = false);
00104
00109 void addFile(const TQString& file);
00110
00116 TQDateTime ctime(const TQString& path);
00117
00124 void removeDir(const TQString& path);
00125
00132 void removeFile(const TQString& file);
00133
00146 bool stopDirScan(const TQString& path);
00147
00161 bool restartDirScan(const TQString& path);
00162
00179 void startScan( bool notify=false, bool skippedToo=false );
00180
00186 void stopScan();
00187
00193 bool isStopped() { return _isStopped; }
00194
00200 bool contains( const TQString& path ) const;
00201
00206 static void statistics();
00207
00212 void setCreated( const TQString &path );
00217 void setDirty( const TQString &path );
00222 void setDeleted( const TQString &path );
00223
00224 enum Method { FAM, DNotify, Stat, INotify };
00230 Method internalMethod();
00231
00244 static KSimpleDirWatch* self();
00251 static bool exists();
00252
00253 signals:
00254
00268 void dirty (const TQString &path);
00269
00274 void created (const TQString &path );
00275
00282 void deleted (const TQString &path );
00283
00284 private:
00285 bool _isStopped;
00286
00287 KSimpleDirWatchPrivate *d;
00288 static KSimpleDirWatch* s_pSelf;
00289 };
00290
00291 #endif
00292
00293