tdeio/tdeio
kdirwatch.h
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 <tqtimer.h>
00022 #include <tqdatetime.h>
00023 #include <tqmap.h>
00024
00025 #include <kurl.h>
00026
00027 #include <tdelibs_export.h>
00028
00029 #define kdirwatch KDirWatch::self()
00030
00031 class KDirWatchPrivate;
00032
00065 class TDEIO_EXPORT KDirWatch : public TQObject
00066 {
00067 Q_OBJECT
00068
00069 public:
00078 KDirWatch (TQObject* parent = 0, const char* name = 0);
00079
00085 ~KDirWatch();
00086
00101 void addDir(const TQString& path, bool watchFiles = false, bool recursive = false);
00102
00103 void addDir(const KURL& url, 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
00126 void removeDir(const KURL& path);
00127
00134 void removeFile(const TQString& file);
00135
00148 bool stopDirScan(const TQString& path);
00149
00163 bool restartDirScan(const TQString& path);
00164
00181 void startScan( bool notify=false, bool skippedToo=false );
00182
00188 void stopScan();
00189
00195 bool isStopped() { return _isStopped; }
00196
00202 bool contains( const TQString& path ) const;
00203
00208 static void statistics();
00209
00214 void setCreated( const TQString &path );
00219 void setDirty( const TQString &path );
00220
00221 void setDirty( const KURL &url );
00226 void setDeleted( const TQString &path );
00227
00228 enum Method { FAM, DNotify, Stat, INotify };
00234 Method internalMethod();
00235
00248 static KDirWatch* self();
00255 static bool exists();
00256
00257 signals:
00258
00272 void dirty (const TQString &path);
00273
00274 void dirty (const KURL &url);
00275
00280 void created (const TQString &path );
00281
00288 void deleted (const TQString &path );
00289
00290 private:
00291 bool _isStopped;
00292
00293 KDirWatchPrivate *d;
00294 static KDirWatch* s_pSelf;
00295 };
00296
00297 #endif
00298
00299