author | zecke <zecke> | 2005-03-17 23:59:00 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-03-17 23:59:00 (UTC) |
commit | c3ba7d98dc7d13132a75a14fce2cdaac6631dd26 (patch) (unidiff) | |
tree | 5732025b302537adf518bd3d5f8b36a8e18f84cc | |
parent | c87b38dc7b0acc53f5c92ac5e53f40cfff15d956 (diff) | |
download | opie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.zip opie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.tar.gz opie-c3ba7d98dc7d13132a75a14fce2cdaac6631dd26.tar.bz2 |
Update the API Documentation for OProcess and OApplicationFactory
-rw-r--r-- | libopie2/opiecore/oapplicationfactory.h | 2 | ||||
-rw-r--r-- | libopie2/opiecore/oprocess.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opiecore/oapplicationfactory.h b/libopie2/opiecore/oapplicationfactory.h index cabaf79..8516565 100644 --- a/libopie2/opiecore/oapplicationfactory.h +++ b/libopie2/opiecore/oapplicationfactory.h | |||
@@ -178,97 +178,97 @@ template <> | |||
178 | struct OPrivate <Opie::NullType, Opie::NullType > { | 178 | struct OPrivate <Opie::NullType, Opie::NullType > { |
179 | inline static QWidget* multiFactory( const QString& , QWidget* , | 179 | inline static QWidget* multiFactory( const QString& , QWidget* , |
180 | const char* , Qt::WFlags ) { | 180 | const char* , Qt::WFlags ) { |
181 | return 0l; | 181 | return 0l; |
182 | } | 182 | } |
183 | 183 | ||
184 | inline static QStringList multiString( const QStringList& _list ) { | 184 | inline static QStringList multiString( const QStringList& _list ) { |
185 | return _list; | 185 | return _list; |
186 | } | 186 | } |
187 | }; | 187 | }; |
188 | */ | 188 | */ |
189 | 189 | ||
190 | template <class Product, class ProductListTail> | 190 | template <class Product, class ProductListTail> |
191 | struct OPrivate< Opie::Core::Typelist<Product, ProductListTail> > { | 191 | struct OPrivate< Opie::Core::Typelist<Product, ProductListTail> > { |
192 | inline static QWidget* multiFactory( const QString& appName, QWidget* parent, | 192 | inline static QWidget* multiFactory( const QString& appName, QWidget* parent, |
193 | const char* name, Qt::WFlags fl) { | 193 | const char* name, Qt::WFlags fl) { |
194 | QWidget* wid = OPrivate<Product>::multiFactory( appName, parent, name, fl ); | 194 | QWidget* wid = OPrivate<Product>::multiFactory( appName, parent, name, fl ); |
195 | 195 | ||
196 | if (!wid ) | 196 | if (!wid ) |
197 | wid = OPrivate<ProductListTail>::multiFactory( appName, parent, name, fl ); | 197 | wid = OPrivate<ProductListTail>::multiFactory( appName, parent, name, fl ); |
198 | 198 | ||
199 | return wid; | 199 | return wid; |
200 | } | 200 | } |
201 | 201 | ||
202 | inline static QStringList multiString( const QStringList& _list ) { | 202 | inline static QStringList multiString( const QStringList& _list ) { |
203 | QStringList list = _list; | 203 | QStringList list = _list; |
204 | 204 | ||
205 | list = OPrivate<Product>::multiString( list ); | 205 | list = OPrivate<Product>::multiString( list ); |
206 | list = OPrivate<ProductListTail>::multiString( list ); | 206 | list = OPrivate<ProductListTail>::multiString( list ); |
207 | 207 | ||
208 | return list; | 208 | return list; |
209 | } | 209 | } |
210 | }; | 210 | }; |
211 | 211 | ||
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | 218 | ||
219 | /* Internal END */ | 219 | /* Internal END */ |
220 | 220 | ||
221 | /* | 221 | /* |
222 | * If you want to export more than one Widget use that function | 222 | * If you want to export more than one Widget use that function |
223 | * Make sure all your Widgets provide the appName() static method | 223 | * Make sure all your Widgets provide the appName() static method |
224 | * otherwise you'll get a compiler error | 224 | * otherwise you'll get a compiler error |
225 | * | 225 | * |
226 | * typedef Opie::MakeTypeList<MyWidget, MyDialog, MyMediaPlayer >::Result MyTypes; | 226 | * typedef Opie::Core::MakeTypelist<MyWidget, MyDialog, MyMediaPlayer >::Result MyTypes; |
227 | * OPIE_EXPORT_APP( OApplicationFactory<MyTypes> ) | 227 | * OPIE_EXPORT_APP( OApplicationFactory<MyTypes> ) |
228 | */ | 228 | */ |
229 | 229 | ||
230 | template<class Product, class ProductListTail> | 230 | template<class Product, class ProductListTail> |
231 | struct OApplicationFactory< Opie::Core::Typelist<Product, ProductListTail > > | 231 | struct OApplicationFactory< Opie::Core::Typelist<Product, ProductListTail > > |
232 | : ApplicationInterface { | 232 | : ApplicationInterface { |
233 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { | 233 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { |
234 | *iface = 0; | 234 | *iface = 0; |
235 | if ( uuid == IID_QUnknown ) *iface = this; | 235 | if ( uuid == IID_QUnknown ) *iface = this; |
236 | else if ( uuid ==IID_QtopiaApplication ) *iface = this; | 236 | else if ( uuid ==IID_QtopiaApplication ) *iface = this; |
237 | else return QS_FALSE; | 237 | else return QS_FALSE; |
238 | (*iface)->addRef(); | 238 | (*iface)->addRef(); |
239 | return QS_OK; | 239 | return QS_OK; |
240 | } | 240 | } |
241 | 241 | ||
242 | QWidget* createMainWindow ( const QString& appName, QWidget* parent, | 242 | QWidget* createMainWindow ( const QString& appName, QWidget* parent, |
243 | const char* name, Qt::WFlags fl ) { | 243 | const char* name, Qt::WFlags fl ) { |
244 | qWarning("StringList is %s", applications().join(":").latin1() ); | 244 | qWarning("StringList is %s", applications().join(":").latin1() ); |
245 | return OPrivate< Opie::Core::Typelist<Product, ProductListTail > >::multiFactory( appName, parent, name, fl ); | 245 | return OPrivate< Opie::Core::Typelist<Product, ProductListTail > >::multiFactory( appName, parent, name, fl ); |
246 | } | 246 | } |
247 | 247 | ||
248 | QStringList applications()const { | 248 | QStringList applications()const { |
249 | QStringList _list; | 249 | QStringList _list; |
250 | return OPrivate< Opie::Core::Typelist<Product, ProductListTail> >::multiString( _list ); | 250 | return OPrivate< Opie::Core::Typelist<Product, ProductListTail> >::multiString( _list ); |
251 | } | 251 | } |
252 | 252 | ||
253 | Q_REFCOUNT | 253 | Q_REFCOUNT |
254 | }; | 254 | }; |
255 | 255 | ||
256 | } | 256 | } |
257 | } | 257 | } |
258 | 258 | ||
259 | /* If the library version should be build */ | 259 | /* If the library version should be build */ |
260 | #ifdef OPIE_APP_INTERFACE | 260 | #ifdef OPIE_APP_INTERFACE |
261 | #define OPIE_EXPORT_APP( factory ) Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( factory ) } | 261 | #define OPIE_EXPORT_APP( factory ) Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( factory ) } |
262 | #else | 262 | #else |
263 | 263 | ||
264 | #include <qpe/qpeapplication.h> | 264 | #include <qpe/qpeapplication.h> |
265 | 265 | ||
266 | #define OPIE_EXPORT_APP( Factory ) \ | 266 | #define OPIE_EXPORT_APP( Factory ) \ |
267 | int main( int argc, char **argv ) { \ | 267 | int main( int argc, char **argv ) { \ |
268 | QPEApplication a(argc, argv ); \ | 268 | QPEApplication a(argc, argv ); \ |
269 | QWidget *mw = 0;\ | 269 | QWidget *mw = 0;\ |
270 | \ | 270 | \ |
271 | /* method from TT */ \ | 271 | /* method from TT */ \ |
272 | QString executableName = QString::fromLatin1( argv[0] ); \ | 272 | QString executableName = QString::fromLatin1( argv[0] ); \ |
273 | executableName = executableName.right(executableName.length() \ | 273 | executableName = executableName.right(executableName.length() \ |
274 | - executableName.findRev('/') - 1); \ | 274 | - executableName.findRev('/') - 1); \ |
diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h index ac6be98..23e9b10 100644 --- a/libopie2/opiecore/oprocess.h +++ b/libopie2/opiecore/oprocess.h | |||
@@ -56,98 +56,98 @@ class OProcessPrivate; | |||
56 | * | 56 | * |
57 | * @par General usage and features | 57 | * @par General usage and features |
58 | * | 58 | * |
59 | *This class allows a KDE and OPIE application to start child processes without having | 59 | *This class allows a KDE and OPIE application to start child processes without having |
60 | *to worry about UN*X signal handling issues and zombie process reaping. | 60 | *to worry about UN*X signal handling issues and zombie process reaping. |
61 | * | 61 | * |
62 | *@see KProcIO | 62 | *@see KProcIO |
63 | * | 63 | * |
64 | *Basically, this class distinguishes three different ways of running | 64 | *Basically, this class distinguishes three different ways of running |
65 | *child processes: | 65 | *child processes: |
66 | * | 66 | * |
67 | *@li OProcess::DontCare -- The child process is invoked and both the child | 67 | *@li OProcess::DontCare -- The child process is invoked and both the child |
68 | *process and the parent process continue concurrently. | 68 | *process and the parent process continue concurrently. |
69 | * | 69 | * |
70 | *Starting a DontCare child process means that the application is | 70 | *Starting a DontCare child process means that the application is |
71 | *not interested in any notification to determine whether the | 71 | *not interested in any notification to determine whether the |
72 | *child process has already exited or not. | 72 | *child process has already exited or not. |
73 | * | 73 | * |
74 | *@li OProcess::NotifyOnExit -- The child process is invoked and both the | 74 | *@li OProcess::NotifyOnExit -- The child process is invoked and both the |
75 | *child and the parent process run concurrently. | 75 | *child and the parent process run concurrently. |
76 | * | 76 | * |
77 | *When the child process exits, the OProcess instance | 77 | *When the child process exits, the OProcess instance |
78 | *corresponding to it emits the Qt signal @ref processExited(). | 78 | *corresponding to it emits the Qt signal @ref processExited(). |
79 | * | 79 | * |
80 | *Since this signal is @em not emitted from within a UN*X | 80 | *Since this signal is @em not emitted from within a UN*X |
81 | *signal handler, arbitrary function calls can be made. | 81 | *signal handler, arbitrary function calls can be made. |
82 | * | 82 | * |
83 | *Be aware: When the OProcess objects gets destructed, the child | 83 | *Be aware: When the OProcess objects gets destructed, the child |
84 | *process will be killed if it is still running! | 84 | *process will be killed if it is still running! |
85 | *This means in particular, that you cannot use a OProcess on the stack | 85 | *This means in particular, that you cannot use a OProcess on the stack |
86 | *with OProcess::NotifyOnExit. | 86 | *with OProcess::NotifyOnExit. |
87 | * | 87 | * |
88 | *@li OProcess::Block -- The child process starts and the parent process | 88 | *@li OProcess::Block -- The child process starts and the parent process |
89 | *is suspended until the child process exits. (@em Really not recommended | 89 | *is suspended until the child process exits. (@em Really not recommended |
90 | *for programs with a GUI.) | 90 | *for programs with a GUI.) |
91 | * | 91 | * |
92 | *OProcess also provides several functions for determining the exit status | 92 | *OProcess also provides several functions for determining the exit status |
93 | *and the pid of the child process it represents. | 93 | *and the pid of the child process it represents. |
94 | * | 94 | * |
95 | *Furthermore it is possible to supply command-line arguments to the process | 95 | *Furthermore it is possible to supply command-line arguments to the process |
96 | *in a clean fashion (no null -- terminated stringlists and such...) | 96 | *in a clean fashion (no null -- terminated stringlists and such...) |
97 | * | 97 | * |
98 | *A small usage example: | 98 | *A small usage example: |
99 | *<pre> | 99 | *<pre> |
100 | *OProcess *proc = new OProcess; | 100 | *OProcess *proc = new OProcess; |
101 | * | 101 | * |
102 | **proc << "my_executable"; | 102 | **proc << "my_executable"; |
103 | **proc << "These" << "are" << "the" << "command" << "line" << "args"; | 103 | **proc << "These" << "are" << "the" << "command" << "line" << "args"; |
104 | *QApplication::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)), | 104 | *QObject::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)), |
105 | * pointer_to_my_object, SLOT(my_objects_slot(Opie::Core::OProcess *))); | 105 | * pointer_to_my_object, SLOT(my_objects_slot(Opie::Core::OProcess *))); |
106 | *proc->start(); | 106 | *proc->start(); |
107 | *</pre> | 107 | *</pre> |
108 | * | 108 | * |
109 | *This will start "my_executable" with the commandline arguments "These"... | 109 | *This will start "my_executable" with the commandline arguments "These"... |
110 | * | 110 | * |
111 | *When the child process exits, the respective Qt signal will be emitted. | 111 | *When the child process exits, the respective Qt signal will be emitted. |
112 | * | 112 | * |
113 | *@par Communication with the child process | 113 | *@par Communication with the child process |
114 | * | 114 | * |
115 | *OProcess supports communication with the child process through | 115 | *OProcess supports communication with the child process through |
116 | *stdin/stdout/stderr. | 116 | *stdin/stdout/stderr. |
117 | * | 117 | * |
118 | *The following functions are provided for getting data from the child | 118 | *The following functions are provided for getting data from the child |
119 | *process or sending data to the child's stdin (For more information, | 119 | *process or sending data to the child's stdin (For more information, |
120 | *have a look at the documentation of each function): | 120 | *have a look at the documentation of each function): |
121 | * | 121 | * |
122 | *@li bool @ref writeStdin(char *buffer, int buflen); | 122 | *@li bool @ref writeStdin(char *buffer, int buflen); |
123 | *@li -- Transmit data to the child process's stdin. | 123 | *@li -- Transmit data to the child process's stdin. |
124 | * | 124 | * |
125 | *@li bool @ref closeStdin(); | 125 | *@li bool @ref closeStdin(); |
126 | *@li -- Closes the child process's stdin (which causes it to see an feof(stdin)). | 126 | *@li -- Closes the child process's stdin (which causes it to see an feof(stdin)). |
127 | *Returns false if you try to close stdin for a process that has been started | 127 | *Returns false if you try to close stdin for a process that has been started |
128 | *without a communication channel to stdin. | 128 | *without a communication channel to stdin. |
129 | * | 129 | * |
130 | *@li bool @ref closeStdout(); | 130 | *@li bool @ref closeStdout(); |
131 | *@li -- Closes the child process's stdout. | 131 | *@li -- Closes the child process's stdout. |
132 | *Returns false if you try to close stdout for a process that has been started | 132 | *Returns false if you try to close stdout for a process that has been started |
133 | *without a communication channel to stdout. | 133 | *without a communication channel to stdout. |
134 | * | 134 | * |
135 | *@li bool @ref closeStderr(); | 135 | *@li bool @ref closeStderr(); |
136 | *@li -- Closes the child process's stderr. | 136 | *@li -- Closes the child process's stderr. |
137 | *Returns false if you try to close stderr for a process that has been started | 137 | *Returns false if you try to close stderr for a process that has been started |
138 | *without a communication channel to stderr. | 138 | *without a communication channel to stderr. |
139 | * | 139 | * |
140 | * | 140 | * |
141 | *@par QT signals: | 141 | *@par QT signals: |
142 | * | 142 | * |
143 | *@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen); | 143 | *@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen); |
144 | *@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen); | 144 | *@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen); |
145 | *@li -- Indicates that new data has arrived from either the | 145 | *@li -- Indicates that new data has arrived from either the |
146 | *child process's stdout or stderr. | 146 | *child process's stdout or stderr. |
147 | * | 147 | * |
148 | *@li void @ref wroteStdin(OProcess *proc); | 148 | *@li void @ref wroteStdin(OProcess *proc); |
149 | *@li -- Indicates that all data that has been sent to the child process | 149 | *@li -- Indicates that all data that has been sent to the child process |
150 | *by a prior call to @ref writeStdin() has actually been transmitted to the | 150 | *by a prior call to @ref writeStdin() has actually been transmitted to the |
151 | *client . | 151 | *client . |
152 | * | 152 | * |
153 | *@author Christian Czezakte e9025461@student.tuwien.ac.at | 153 | *@author Christian Czezakte e9025461@student.tuwien.ac.at |