author | mickeyl <mickeyl> | 2004-04-18 18:25:24 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-18 18:25:24 (UTC) |
commit | df539f67050ebe61b5dc589f9c138bb9ef1719f6 (patch) (side-by-side diff) | |
tree | 7baa2dc1e44be92dec2736b8205f9642fffc4302 /libopie2/opiecore/ofilenotify.h | |
parent | 56f49e8293110e488f3ea6bc6dad282981c81d4b (diff) | |
download | opie-df539f67050ebe61b5dc589f9c138bb9ef1719f6.zip opie-df539f67050ebe61b5dc589f9c138bb9ef1719f6.tar.gz opie-df539f67050ebe61b5dc589f9c138bb9ef1719f6.tar.bz2 |
the notifier interface is shaping up
Brad: I sorted the "DN_xxx undeclared" issue out, please test
Diffstat (limited to 'libopie2/opiecore/ofilenotify.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/ofilenotify.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/libopie2/opiecore/ofilenotify.h b/libopie2/opiecore/ofilenotify.h index 638eb6c..a14842a 100644 --- a/libopie2/opiecore/ofilenotify.h +++ b/libopie2/opiecore/ofilenotify.h @@ -30,8 +30,9 @@ _;:, .> :=|. This program is free software; you can #define OFILENOTIFY_H /* QT */ -#include <qstring.h> #include <qobject.h> +#include <qsignal.h> +#include <qstring.h> /* STD */ #include <signal.h> @@ -49,20 +50,39 @@ enum OFileNotificationType { Single = 0x0000000, Rename = DN_RENAME, Attrib = DN_ATTRIB }; -class OFileNotifier : public QObject +class OFileNotification : public QObject { + Q_OBJECT + public: - static void singleShot( const QString& path, - QObject *receiver, const char *member, - OFileNotificationType type = Modify ); + OFileNotification( QObject* parent = 0, const char* name = 0 ); + ~OFileNotification(); + + static void singleShot( const QString& path, QObject* receiver, const char* member, OFileNotificationType type = Modify ); + + int start( const QString& path, bool sshot = false, OFileNotificationType type = Modify ); + void stop(); + + OFileNotificationType type() const; + QString path() const; + int fileno() const; + bool isActive() const; + + signals: + void triggered(); + protected: - static void registerSignalHandler(); + void activate(); + static bool registerSignalHandler(); static void unregisterSignalHandler(); static void __signalHandler( int sig, siginfo_t *si, void *data ); private: - OFileNotifier(); - ~OFileNotifier(); + QString _path; + OFileNotificationType _type; + QSignal _signal; + int _fd; + bool _active; }; } |