summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/ofilenotify.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/ofilenotify.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/ofilenotify.h63
1 files changed, 57 insertions, 6 deletions
diff --git a/libopie2/opiecore/ofilenotify.h b/libopie2/opiecore/ofilenotify.h
index 3eb917e..5bbf421 100644
--- a/libopie2/opiecore/ofilenotify.h
+++ b/libopie2/opiecore/ofilenotify.h
@@ -44,2 +44,4 @@ namespace Core {
44 44
45class OFileNotificationEvent;
46
45/*====================================================================================== 47/*======================================================================================
@@ -170,9 +172,19 @@ class OFileNotification : public QObject
170 signals: 172 signals:
171 /** 173 void triggered( const QString&, unsigned int, const QString& );
172 * This signal is emitted if an event happens of the specified type happens to the file being watched. 174 void accessed( const QString& );
173 **/ 175 void modified( const QString& );
174 void triggered( const QString& name ); 176 void attributed( const QString& );
177 void closed( const QString&, bool );
178 void opened( const QString& );
179 void movedTo( const QString&, const QString& );
180 void movedFrom( const QString&, const QString& );
181 void deletedSubdir( const QString&, const QString& );
182 void deletedFile( const QString&, const QString& );
183 void createdSubdir( const QString&, const QString& );
184 void createdFile( const QString&, const QString& );
185 void deleted( const QString& );
186 void unmounted( const QString& );
175 187
176 protected: 188 protected:
177 bool activate(); 189 bool activate( const OFileNotificationEvent* e );
178 190
@@ -193,2 +205,4 @@ class OFileNotification : public QObject
193 static int _fd; // inotify device descriptor 205 static int _fd; // inotify device descriptor
206
207 friend class OFileNotificationEvent;
194}; 208};
@@ -229,3 +243,40 @@ class ODirNotification : public QObject
229 **/ 243 **/
230 void triggered( const QString& name ); 244 void triggered( const QString&, unsigned int, const QString& );
245 void accessed( const QString& );
246 void modified( const QString& );
247 void attributed( const QString& );
248 void closed( const QString&, bool );
249 void opened( const QString& );
250 void movedTo( const QString&, const QString& );
251 void movedFrom( const QString&, const QString& );
252 void deletedSubdir( const QString&, const QString& );
253 void deletedFile( const QString&, const QString& );
254 void createdSubdir( const QString&, const QString& );
255 void createdFile( const QString&, const QString& );
256 void deleted( const QString& );
257 void unmounted( const QString& );
258};
259
260/*======================================================================================
261 * OFileNotificationEvent
262 *======================================================================================*/
263
264class OFileNotificationEvent
265{
266 public:
267 OFileNotificationEvent( OFileNotification* parent, int wd, unsigned int mask, unsigned int cookie, const QString& name );
268 ~OFileNotificationEvent();
269 OFileNotification* parent() const { return _parent; };
270 int descriptor() const { return _wd; };
271 unsigned int mask() const { return _mask; };
272 unsigned int cookie() const { return _cookie; };
273 QString name() const { return _name; };
274 void activate() { _parent->activate( this ); };
275
276 private:
277 OFileNotification* _parent;
278 int _wd;
279 unsigned int _mask;
280 unsigned int _cookie;
281 QString _name;
231}; 282};