author | kergoth <kergoth> | 2002-11-01 00:10:42 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-11-01 00:10:42 (UTC) |
commit | 5042e3cf0d3514552769e441f5aad590c8eaf967 (patch) (unidiff) | |
tree | 4a5ea45f3519d981a172ab5275bf38c6fa778dec /qmake/include/private/qucom_p.h | |
parent | 108c1c753e74e989cc13923086996791428c9af4 (diff) | |
download | opie-5042e3cf0d3514552769e441f5aad590c8eaf967.zip opie-5042e3cf0d3514552769e441f5aad590c8eaf967.tar.gz opie-5042e3cf0d3514552769e441f5aad590c8eaf967.tar.bz2 |
Adding qmake in preperation for new build system
Diffstat (limited to 'qmake/include/private/qucom_p.h') (more/less context) (show whitespace changes)
-rw-r--r-- | qmake/include/private/qucom_p.h | 499 |
1 files changed, 499 insertions, 0 deletions
diff --git a/qmake/include/private/qucom_p.h b/qmake/include/private/qucom_p.h new file mode 100644 index 0000000..d2ff48e --- a/dev/null +++ b/qmake/include/private/qucom_p.h | |||
@@ -0,0 +1,499 @@ | |||
1 | /**************************************************************************** | ||
2 | ** $Id$ | ||
3 | ** | ||
4 | ** Definition of the QUcom interfaces | ||
5 | ** | ||
6 | ** Created : 990101 | ||
7 | ** | ||
8 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. | ||
9 | ** | ||
10 | ** This file is part of the tools module of the Qt GUI Toolkit. | ||
11 | ** | ||
12 | ** This file may be distributed under the terms of the Q Public License | ||
13 | ** as defined by Trolltech AS of Norway and appearing in the file | ||
14 | ** LICENSE.QPL included in the packaging of this file. | ||
15 | ** | ||
16 | ** This file may be distributed and/or modified under the terms of the | ||
17 | ** GNU General Public License version 2 as published by the Free Software | ||
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
19 | ** packaging of this file. | ||
20 | ** | ||
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | ||
22 | ** licenses may use this file in accordance with the Qt Commercial License | ||
23 | ** Agreement provided with the Software. | ||
24 | ** | ||
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
27 | ** | ||
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | ||
29 | ** information about Qt Commercial License Agreements. | ||
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | ||
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
32 | ** | ||
33 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
34 | ** not clear to you. | ||
35 | ** | ||
36 | **********************************************************************/ | ||
37 | |||
38 | #ifndef QUCOM_H | ||
39 | #define QUCOM_H | ||
40 | |||
41 | #ifndef QT_H | ||
42 | #include <qstring.h> | ||
43 | #include "quuid.h" | ||
44 | #endif // QT_H | ||
45 | |||
46 | // | ||
47 | // W A R N I N G | ||
48 | // ------------- | ||
49 | // | ||
50 | // This file is not part of the Qt API. It exists for the convenience | ||
51 | // of a number of Qt sources files. This header file may change from | ||
52 | // version to version without notice, or even be removed. | ||
53 | // | ||
54 | // We mean it. | ||
55 | // | ||
56 | // | ||
57 | |||
58 | #ifdef check | ||
59 | #undef check | ||
60 | #endif | ||
61 | |||
62 | struct QUObject; | ||
63 | struct QUInterfaceDescription; | ||
64 | struct QUnknownInterface; | ||
65 | struct QDispatchInterface; | ||
66 | |||
67 | |||
68 | struct Q_EXPORT QUBuffer | ||
69 | { | ||
70 | virtual long read( char *data, ulong maxlen ) = 0; | ||
71 | virtual long write( const char *data, ulong len ) = 0; | ||
72 | }; | ||
73 | |||
74 | |||
75 | // A type for a QUObject | ||
76 | struct Q_EXPORT QUType | ||
77 | { | ||
78 | virtual const QUuid *uuid() const = 0; | ||
79 | virtual const char *desc() const = 0; | ||
80 | |||
81 | |||
82 | virtual bool canConvertFrom( QUObject *, QUType * ) = 0; | ||
83 | // virtual private, only called by canConvertFrom | ||
84 | virtual bool canConvertTo( QUObject *, QUType * ) = 0; | ||
85 | |||
86 | |||
87 | virtual bool convertFrom( QUObject *, QUType * ) = 0; | ||
88 | // virtual private, only called by convertFrom | ||
89 | virtual bool convertTo( QUObject *, QUType * ) = 0; | ||
90 | |||
91 | virtual void clear( QUObject * ) = 0; | ||
92 | |||
93 | virtual int serializeTo( QUObject *, QUBuffer * ) = 0; | ||
94 | virtual int serializeFrom( QUObject *, QUBuffer * ) = 0; | ||
95 | |||
96 | static bool isEqual( const QUType *t1, const QUType *t2 ); | ||
97 | static bool check( QUObject* o, QUType* t ); | ||
98 | }; | ||
99 | |||
100 | |||
101 | // {DE56510E-4E9F-4b76-A3C2-D1E2EF42F1AC} | ||
102 | extern Q_EXPORT const QUuid TID_QUType_Null; | ||
103 | struct Q_EXPORT QUType_Null : public QUType | ||
104 | { | ||
105 | const QUuid *uuid() const; | ||
106 | const char *desc() const; | ||
107 | |||
108 | bool canConvertFrom( QUObject *, QUType * ); | ||
109 | bool canConvertTo( QUObject *, QUType * ); | ||
110 | bool convertFrom( QUObject *, QUType * ); | ||
111 | bool convertTo( QUObject *, QUType * ); | ||
112 | void clear( QUObject * ); | ||
113 | int serializeTo( QUObject *, QUBuffer * ); | ||
114 | int serializeFrom( QUObject *, QUBuffer * ); | ||
115 | }; | ||
116 | extern Q_EXPORT QUType_Null static_QUType_Null; | ||
117 | |||
118 | |||
119 | // The magic QUObject | ||
120 | struct Q_EXPORT QUObject | ||
121 | { | ||
122 | public: // scary MSVC bug makes this necessary | ||
123 | QUObject() : type( &static_QUType_Null ) {} | ||
124 | ~QUObject() { type->clear( this ); } | ||
125 | |||
126 | QUType *type; | ||
127 | |||
128 | // the unavoidable union | ||
129 | union | ||
130 | { | ||
131 | bool b; | ||
132 | |||
133 | char c; | ||
134 | short s; | ||
135 | int i; | ||
136 | long l; | ||
137 | |||
138 | unsigned char uc; | ||
139 | unsigned short us; | ||
140 | unsigned int ui; | ||
141 | unsigned long ul; | ||
142 | |||
143 | float f; | ||
144 | double d; | ||
145 | |||
146 | char byte[16]; | ||
147 | |||
148 | struct { | ||
149 | char* data; | ||
150 | unsigned long size; | ||
151 | } bytearray; | ||
152 | |||
153 | void* ptr; | ||
154 | |||
155 | struct { | ||
156 | void *ptr; | ||
157 | bool owner; | ||
158 | } voidstar; | ||
159 | |||
160 | struct { | ||
161 | char *ptr; | ||
162 | bool owner; | ||
163 | } charstar; | ||
164 | |||
165 | struct { | ||
166 | char *ptr; | ||
167 | bool owner; | ||
168 | } utf8; | ||
169 | |||
170 | struct { | ||
171 | char *ptr; | ||
172 | bool owner; | ||
173 | } local8bit; | ||
174 | |||
175 | QUnknownInterface* iface; | ||
176 | QDispatchInterface* idisp; | ||
177 | |||
178 | } payload; | ||
179 | |||
180 | }; | ||
181 | |||
182 | |||
183 | // A parameter description describes one method parameters. A | ||
184 | // parameter has a name, a type and a flag describing whether it's an | ||
185 | // in parameter, an out parameter, or both ways | ||
186 | struct Q_EXPORT QUParameter | ||
187 | { | ||
188 | const char* name; | ||
189 | QUType *type; | ||
190 | const void* typeExtra; //Usually 0, UEnum* for QUType_enum, const char* for QUType_ptr, int* for QUType_varptr | ||
191 | enum { In = 1, Out = 2, InOut = In | Out }; | ||
192 | int inOut; | ||
193 | }; | ||
194 | |||
195 | // A method description describes one method. A method has a name and | ||
196 | // an array of parameters. | ||
197 | struct Q_EXPORT QUMethod | ||
198 | { | ||
199 | const char* name; | ||
200 | int count; | ||
201 | const QUParameter* parameters; | ||
202 | }; | ||
203 | |||
204 | // A Property description. Not used yet in the example. | ||
205 | struct Q_EXPORT QUProperty | ||
206 | { | ||
207 | const char* name; | ||
208 | QUType* type; | ||
209 | const void* typeExtra; //type dependend. Usually 0, but UEnum for QUTypeenum or const char* for QUTypeptr | ||
210 | |||
211 | int set; // -1 undefined | ||
212 | int get; // -1 undefined | ||
213 | |||
214 | int designable; // -1 FALSE, -2 TRUE, else method | ||
215 | int stored; // -1 FALSE, -2 TRUE, else method | ||
216 | }; | ||
217 | |||
218 | // An interface description describes one interface, that is all its | ||
219 | // methods and properties. | ||
220 | struct Q_EXPORT QUInterfaceDescription | ||
221 | { | ||
222 | int methodCount; | ||
223 | const QUMethod* methods; | ||
224 | int propertyCount; | ||
225 | const QUProperty* properties; | ||
226 | }; | ||
227 | |||
228 | |||
229 | // A component description describe one component, that is its name, | ||
230 | // vendor, release, info, its component uuid and all its interface | ||
231 | // uuids. | ||
232 | struct Q_EXPORT QUComponentDescription | ||
233 | { | ||
234 | const char* name; | ||
235 | const char* vendor; | ||
236 | const char* release; | ||
237 | const char* info; | ||
238 | QUuid cid; | ||
239 | int count; | ||
240 | const QUuid* interfaces; | ||
241 | }; | ||
242 | |||
243 | |||
244 | // A component server description describe one component server, that | ||
245 | // is its name, vendor, release, info and the descriptions of all | ||
246 | // components it can instantiate. | ||
247 | struct Q_EXPORT QUComponentServerDescription | ||
248 | { | ||
249 | const char* name; | ||
250 | const char* vendor; | ||
251 | const char* release; | ||
252 | const char* info; | ||
253 | int count; | ||
254 | const QUComponentDescription* components; | ||
255 | }; | ||
256 | |||
257 | |||
258 | |||
259 | struct Q_EXPORT QUEnumItem // - a name/value pair | ||
260 | { | ||
261 | const char *key; | ||
262 | int value; | ||
263 | }; | ||
264 | |||
265 | struct Q_EXPORT QUEnum | ||
266 | { | ||
267 | const char *name; // - enumerator name | ||
268 | unsigned int count; // - number of values | ||
269 | const QUEnumItem *items; // - the name/value pairs | ||
270 | bool set; // whether enum has to be treated as a set | ||
271 | }; | ||
272 | |||
273 | inline bool QUType::isEqual( const QUType *t1, const QUType *t2 ) { | ||
274 | return t1 == t2 || t1->uuid() == t2->uuid() || | ||
275 | *(t1->uuid()) == *(t2->uuid()); | ||
276 | } | ||
277 | |||
278 | inline bool QUType::check( QUObject* o, QUType* t ) { | ||
279 | return isEqual( o->type, t ) || t->convertFrom( o, o->type ); | ||
280 | } | ||
281 | |||
282 | |||
283 | |||
284 | // {7EE17B08-5419-47e2-9776-8EEA112DCAEC} | ||
285 | extern Q_EXPORT const QUuid TID_QUType_enum; | ||
286 | struct Q_EXPORT QUType_enum : public QUType | ||
287 | { | ||
288 | const QUuid *uuid() const; | ||
289 | const char *desc() const; | ||
290 | |||
291 | void set( QUObject *, int ); | ||
292 | int &get( QUObject * o ) { return o->payload.i; } | ||
293 | bool canConvertFrom( QUObject *, QUType * ); | ||
294 | bool canConvertTo( QUObject *, QUType * ); | ||
295 | bool convertFrom( QUObject *, QUType * ); | ||
296 | bool convertTo( QUObject *, QUType * ); | ||
297 | void clear( QUObject * ) {} | ||
298 | int serializeTo( QUObject *, QUBuffer * ); | ||
299 | int serializeFrom( QUObject *, QUBuffer * ); | ||
300 | }; | ||
301 | extern Q_EXPORT QUType_enum static_QUType_enum; | ||
302 | |||
303 | |||
304 | // {8AC26448-5AB4-49eb-968C-8F30AB13D732} | ||
305 | extern Q_EXPORT const QUuid TID_QUType_ptr; | ||
306 | struct Q_EXPORT QUType_ptr : public QUType | ||
307 | { | ||
308 | const QUuid *uuid() const; | ||
309 | const char *desc() const; | ||
310 | |||
311 | void set( QUObject *, const void* ); | ||
312 | void* &get( QUObject * o ) { return o->payload.ptr; } | ||
313 | bool canConvertFrom( QUObject *, QUType * ); | ||
314 | bool canConvertTo( QUObject *, QUType * ); | ||
315 | bool convertFrom( QUObject *, QUType * ); | ||
316 | bool convertTo( QUObject *, QUType * ); | ||
317 | void clear( QUObject * ) {} | ||
318 | int serializeTo( QUObject *, QUBuffer * ); | ||
319 | int serializeFrom( QUObject *, QUBuffer * ); | ||
320 | }; | ||
321 | extern Q_EXPORT QUType_ptr static_QUType_ptr; | ||
322 | |||
323 | // {97A2594D-6496-4402-A11E-55AEF2D4D25C} | ||
324 | extern Q_EXPORT const QUuid TID_QUType_iface; | ||
325 | struct Q_EXPORT QUType_iface : public QUType | ||
326 | { | ||
327 | const QUuid *uuid() const; | ||
328 | const char *desc() const; | ||
329 | |||
330 | void set( QUObject *, QUnknownInterface* ); | ||
331 | QUnknownInterface* &get( QUObject *o ){ return o->payload.iface; } | ||
332 | bool canConvertFrom( QUObject *, QUType * ); | ||
333 | bool canConvertTo( QUObject *, QUType * ); | ||
334 | bool convertFrom( QUObject *, QUType * ); | ||
335 | bool convertTo( QUObject *, QUType * ); | ||
336 | void clear( QUObject * ) {} | ||
337 | int serializeTo( QUObject *, QUBuffer * ); | ||
338 | int serializeFrom( QUObject *, QUBuffer * ); | ||
339 | }; | ||
340 | extern Q_EXPORT QUType_iface static_QUType_iface; | ||
341 | |||
342 | // {2F358164-E28F-4bf4-9FA9-4E0CDCABA50B} | ||
343 | extern Q_EXPORT const QUuid TID_QUType_idisp; | ||
344 | struct Q_EXPORT QUType_idisp : public QUType | ||
345 | { | ||
346 | const QUuid *uuid() const; | ||
347 | const char *desc() const; | ||
348 | |||
349 | void set( QUObject *, QDispatchInterface* ); | ||
350 | QDispatchInterface* &get( QUObject *o ){ return o->payload.idisp; } | ||
351 | bool canConvertFrom( QUObject *, QUType * ); | ||
352 | bool canConvertTo( QUObject *, QUType * ); | ||
353 | bool convertFrom( QUObject *, QUType * ); | ||
354 | bool convertTo( QUObject *, QUType * ); | ||
355 | void clear( QUObject * ) {} | ||
356 | int serializeTo( QUObject *, QUBuffer * ); | ||
357 | int serializeFrom( QUObject *, QUBuffer * ); | ||
358 | }; | ||
359 | extern Q_EXPORT QUType_idisp static_QUType_idisp; | ||
360 | |||
361 | // {CA42115D-13D0-456c-82B5-FC10187F313E} | ||
362 | extern Q_EXPORT const QUuid TID_QUType_bool; | ||
363 | struct Q_EXPORT QUType_bool : public QUType | ||
364 | { | ||
365 | const QUuid *uuid() const; | ||
366 | const char *desc() const; | ||
367 | |||
368 | void set( QUObject *, bool ); | ||
369 | bool &get( QUObject *o ) { return o->payload.b; } | ||
370 | bool canConvertFrom( QUObject *, QUType * ); | ||
371 | bool canConvertTo( QUObject *, QUType * ); | ||
372 | bool convertFrom( QUObject *, QUType * ); | ||
373 | bool convertTo( QUObject *, QUType * ); | ||
374 | void clear( QUObject * ) {} | ||
375 | int serializeTo( QUObject *, QUBuffer * ); | ||
376 | int serializeFrom( QUObject *, QUBuffer * ); | ||
377 | }; | ||
378 | extern Q_EXPORT QUType_bool static_QUType_bool; | ||
379 | |||
380 | // {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5} | ||
381 | extern Q_EXPORT const QUuid TID_QUType_int; | ||
382 | struct Q_EXPORT QUType_int : public QUType | ||
383 | { | ||
384 | const QUuid *uuid() const; | ||
385 | const char *desc() const; | ||
386 | |||
387 | void set( QUObject *, int ); | ||
388 | int &get( QUObject *o ) { return o->payload.i; } | ||
389 | bool canConvertFrom( QUObject *, QUType * ); | ||
390 | bool canConvertTo( QUObject *, QUType * ); | ||
391 | bool convertFrom( QUObject *, QUType * ); | ||
392 | bool convertTo( QUObject *, QUType * ); | ||
393 | void clear( QUObject * ) {} | ||
394 | int serializeTo( QUObject *, QUBuffer * ); | ||
395 | int serializeFrom( QUObject *, QUBuffer * ); | ||
396 | }; | ||
397 | extern Q_EXPORT QUType_int static_QUType_int; | ||
398 | |||
399 | // {5938712A-C496-11D5-8CB2-00C0F03BC0F3} | ||
400 | extern Q_EXPORT const QUuid TID_QUType_uint; | ||
401 | struct Q_EXPORT QUType_uint : public QUType | ||
402 | { | ||
403 | const QUuid *uuid() const; | ||
404 | const char *desc() const; | ||
405 | |||
406 | void set( QUObject *, uint ); | ||
407 | uint &get( QUObject *o ) { return o->payload.ui; } | ||
408 | bool canConvertFrom( QUObject *, QUType * ); | ||
409 | bool canConvertTo( QUObject *, QUType * ); | ||
410 | bool convertFrom( QUObject *, QUType * ); | ||
411 | bool convertTo( QUObject *, QUType * ); | ||
412 | void clear( QUObject * ) {} | ||
413 | int serializeTo( QUObject *, QUBuffer * ); | ||
414 | int serializeFrom( QUObject *, QUBuffer * ); | ||
415 | }; | ||
416 | extern Q_EXPORT QUType_uint static_QUType_uint; | ||
417 | |||
418 | // {2D0974E5-0BA6-4ec2-8837-C198972CB48C} | ||
419 | extern Q_EXPORT const QUuid TID_QUType_double; | ||
420 | struct Q_EXPORT QUType_double : public QUType | ||
421 | { | ||
422 | const QUuid *uuid() const; | ||
423 | const char *desc() const; | ||
424 | |||
425 | void set( QUObject *, double ); | ||
426 | double &get( QUObject *o ) { return o->payload.d; } | ||
427 | bool canConvertFrom( QUObject *, QUType * ); | ||
428 | bool canConvertTo( QUObject *, QUType * ); | ||
429 | bool convertFrom( QUObject *, QUType * ); | ||
430 | bool convertTo( QUObject *, QUType * ); | ||
431 | void clear( QUObject * ) {} | ||
432 | int serializeTo( QUObject *, QUBuffer * ); | ||
433 | int serializeFrom( QUObject *, QUBuffer * ); | ||
434 | }; | ||
435 | extern Q_EXPORT QUType_double static_QUType_double; | ||
436 | |||
437 | // {544C5175-6993-4486-B04D-CEC4D21BF4B9 } | ||
438 | extern Q_EXPORT const QUuid TID_QUType_float; | ||
439 | struct Q_EXPORT QUType_float : public QUType | ||
440 | { | ||
441 | const QUuid *uuid() const; | ||
442 | const char *desc() const; | ||
443 | |||
444 | void set( QUObject *, float ); | ||
445 | float &get( QUObject *o ) { return o->payload.f; } | ||
446 | bool canConvertFrom( QUObject *, QUType * ); | ||
447 | bool canConvertTo( QUObject *, QUType * ); | ||
448 | bool convertFrom( QUObject *, QUType * ); | ||
449 | bool convertTo( QUObject *, QUType * ); | ||
450 | void clear( QUObject * ) {} | ||
451 | int serializeTo( QUObject *, QUBuffer * ); | ||
452 | int serializeFrom( QUObject *, QUBuffer * ); | ||
453 | }; | ||
454 | extern Q_EXPORT QUType_float static_QUType_float; | ||
455 | |||
456 | // {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} | ||
457 | extern Q_EXPORT const QUuid TID_QUType_charstar; | ||
458 | struct Q_EXPORT QUType_charstar : public QUType | ||
459 | { | ||
460 | const QUuid *uuid() const; | ||
461 | const char *desc() const; | ||
462 | |||
463 | void set( QUObject *, const char*, bool take = FALSE ); | ||
464 | char* get( QUObject *o ){ return o->payload.charstar.ptr; } | ||
465 | bool canConvertFrom( QUObject *, QUType * ); | ||
466 | bool canConvertTo( QUObject *, QUType * ); | ||
467 | bool convertFrom( QUObject *, QUType * ); | ||
468 | bool convertTo( QUObject *, QUType * ); | ||
469 | void clear( QUObject * ); | ||
470 | int serializeTo( QUObject *, QUBuffer * ); | ||
471 | int serializeFrom( QUObject *, QUBuffer * ); | ||
472 | |||
473 | }; | ||
474 | extern Q_EXPORT QUType_charstar static_QUType_charstar; | ||
475 | |||
476 | // {44C2A547-01E7-4e56-8559-35AF9D2F42B7} | ||
477 | extern const QUuid TID_QUType_QString; | ||
478 | |||
479 | struct Q_EXPORT QUType_QString : public QUType | ||
480 | { | ||
481 | const QUuid *uuid() const; | ||
482 | const char *desc() const; | ||
483 | |||
484 | void set( QUObject *, const QString & ); | ||
485 | QString &get( QUObject * o ) { return *(QString*)o->payload.ptr; } | ||
486 | |||
487 | bool canConvertFrom( QUObject *, QUType * ); | ||
488 | bool canConvertTo( QUObject *, QUType * ); | ||
489 | bool convertFrom( QUObject *, QUType * ); | ||
490 | bool convertTo( QUObject *, QUType * ); | ||
491 | void clear( QUObject * ); | ||
492 | int serializeTo( QUObject *, QUBuffer * ); | ||
493 | int serializeFrom( QUObject *, QUBuffer * ); | ||
494 | |||
495 | }; | ||
496 | extern Q_EXPORT QUType_QString static_QUType_QString; | ||
497 | |||
498 | |||
499 | #endif // QUCOM_H | ||