summaryrefslogtreecommitdiff
path: root/libopie2
authorclem <clem>2004-10-06 23:52:25 (UTC)
committer clem <clem>2004-10-06 23:52:25 (UTC)
commit5137abdac1d6990c038170a2b3533ae85eecb7f1 (patch) (unidiff)
tree67b299caf70f5d7436ff05f012c98abcb665726c /libopie2
parent14c237a2d5c60314935d51d9beea0527e337a9d8 (diff)
downloadopie-5137abdac1d6990c038170a2b3533ae85eecb7f1.zip
opie-5137abdac1d6990c038170a2b3533ae85eecb7f1.tar.gz
opie-5137abdac1d6990c038170a2b3533ae85eecb7f1.tar.bz2
Closed a <pre> section in a Doxygen-enabled comment
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/ofilenotify.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opiecore/ofilenotify.h b/libopie2/opiecore/ofilenotify.h
index bd2f9d0..d820f7c 100644
--- a/libopie2/opiecore/ofilenotify.h
+++ b/libopie2/opiecore/ofilenotify.h
@@ -71,96 +71,97 @@ enum OFileNotificationType { Single = 0x0000000,
71 Create = DN_CREATE, 71 Create = DN_CREATE,
72 Delete = DN_DELETE, 72 Delete = DN_DELETE,
73 Rename = DN_RENAME, 73 Rename = DN_RENAME,
74 Attrib = DN_ATTRIB }; 74 Attrib = DN_ATTRIB };
75 75
76/*====================================================================================== 76/*======================================================================================
77 * OFileNotification 77 * OFileNotification
78 *======================================================================================*/ 78 *======================================================================================*/
79 79
80/** 80/**
81 * @brief Represents a file notification 81 * @brief Represents a file notification
82 * 82 *
83 * This class allows to watch for events happening to files. 83 * This class allows to watch for events happening to files.
84 * It uses the dnotify kernel interface which is a very efficient signalling interface. 84 * It uses the dnotify kernel interface which is a very efficient signalling interface.
85 * 85 *
86 * @see <file:///usr/src/linux/Documentation/dnotify.txt> 86 * @see <file:///usr/src/linux/Documentation/dnotify.txt>
87 * 87 *
88 * @author Michael 'Mickey' Lauer <mickey@vanille.de> 88 * @author Michael 'Mickey' Lauer <mickey@vanille.de>
89 * 89 *
90 **/ 90 **/
91 91
92class OFileNotification : public QObject 92class OFileNotification : public QObject
93{ 93{
94 Q_OBJECT 94 Q_OBJECT
95 95
96 public: 96 public:
97 OFileNotification( QObject* parent = 0, const char* name = 0 ); 97 OFileNotification( QObject* parent = 0, const char* name = 0 );
98 ~OFileNotification(); 98 ~OFileNotification();
99 /** 99 /**
100 * This static function calls a slot when an event with @a type happens to file @a path. 100 * This static function calls a slot when an event with @a type happens to file @a path.
101 * 101 *
102 * It is very convenient to use this function because you do not need to 102 * It is very convenient to use this function because you do not need to
103 * bother with a timerEvent or to create a local QTimer object. 103 * bother with a timerEvent or to create a local QTimer object.
104 * 104 *
105 * Example: 105 * Example:
106 * <pre> 106 * <pre>
107 * 107 *
108 * #include <opie2/oapplication.h> 108 * #include <opie2/oapplication.h>
109 * #include <opie2/onitify.h> 109 * #include <opie2/onitify.h>
110 * using namespace Opie::Core; 110 * using namespace Opie::Core;
111 * 111 *
112 * int main( int argc, char **argv ) 112 * int main( int argc, char **argv )
113 * { 113 * {
114 * OApplication a( argc, argv, "File Notification Example" ); 114 * OApplication a( argc, argv, "File Notification Example" );
115 * OFileNotification::singleShot( "/tmp/quit", &a, SLOT(quit()), Create ); 115 * OFileNotification::singleShot( "/tmp/quit", &a, SLOT(quit()), Create );
116 * ... // create and show your widgets 116 * ... // create and show your widgets
117 * return a.exec(); 117 * return a.exec();
118 * } 118 * }
119 * </pre>
119 * 120 *
120 * This sample program automatically terminates when the file "/tmp/quite" has been created. 121 * This sample program automatically terminates when the file "/tmp/quite" has been created.
121 * 122 *
122 * 123 *
123 * The @a receiver is the receiving object and the @a member is the slot. 124 * The @a receiver is the receiving object and the @a member is the slot.
124 **/ 125 **/
125 static void singleShot( const QString& path, QObject* receiver, const char* member, OFileNotificationType type = Modify ); 126 static void singleShot( const QString& path, QObject* receiver, const char* member, OFileNotificationType type = Modify );
126 /** 127 /**
127 * Starts to watch for @a type changes to @a path. Set @a sshot to True if you want to be notified only once. 128 * Starts to watch for @a type changes to @a path. Set @a sshot to True if you want to be notified only once.
128 * Note that in that case it may be more convenient to use @ref OFileNotification::singleShot() then. 129 * Note that in that case it may be more convenient to use @ref OFileNotification::singleShot() then.
129 **/ 130 **/
130 int start( const QString& path, bool sshot = false, OFileNotificationType type = Modify ); 131 int start( const QString& path, bool sshot = false, OFileNotificationType type = Modify );
131 /** 132 /**
132 * Stop watching for file events. 133 * Stop watching for file events.
133 **/ 134 **/
134 void stop(); 135 void stop();
135 /** 136 /**
136 * @returns the notification type as set by @ref start(). 137 * @returns the notification type as set by @ref start().
137 **/ 138 **/
138 OFileNotificationType type() const; 139 OFileNotificationType type() const;
139 /** 140 /**
140 * @returns the path to the file being watched by this instance. 141 * @returns the path to the file being watched by this instance.
141 **/ 142 **/
142 QString path() const; 143 QString path() const;
143 /** 144 /**
144 * @returns the UNIX file descriptor for the file being watched. 145 * @returns the UNIX file descriptor for the file being watched.
145 **/ 146 **/
146 int fileno() const; 147 int fileno() const;
147 /** 148 /**
148 * @returns if a file is currently being watched. 149 * @returns if a file is currently being watched.
149 **/ 150 **/
150 bool isActive() const; 151 bool isActive() const;
151 152
152 signals: 153 signals:
153 /** 154 /**
154 * This signal is emitted if an event happens of the specified type happens to the file being watched. 155 * This signal is emitted if an event happens of the specified type happens to the file being watched.
155 **/ 156 **/
156 void triggered(); 157 void triggered();
157 158
158 protected: 159 protected:
159 bool activate(); 160 bool activate();
160 virtual bool hasChanged(); 161 virtual bool hasChanged();
161 static bool registerSignalHandler(); 162 static bool registerSignalHandler();
162 static void unregisterSignalHandler(); 163 static void unregisterSignalHandler();
163 static void __signalHandler( int sig, siginfo_t *si, void *data ); 164 static void __signalHandler( int sig, siginfo_t *si, void *data );
164 165
165 private: 166 private:
166 QString _path; 167 QString _path;