|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Designer of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #include "abstractintrospection_p.h" |
|
43 |
|
44 QT_BEGIN_NAMESPACE |
|
45 |
|
46 /*! |
|
47 \class QDesignerMetaEnumInterface |
|
48 \internal |
|
49 \since 4.4 |
|
50 |
|
51 \brief QDesignerMetaEnumInterface is part of \QD's introspection interface and represents an enumeration. |
|
52 |
|
53 \inmodule QtDesigner |
|
54 |
|
55 The QDesignerMetaEnumInterface class provides meta-data about an enumerator. |
|
56 |
|
57 \sa QDesignerMetaObjectInterface |
|
58 */ |
|
59 |
|
60 /*! |
|
61 Constructs a QDesignerMetaEnumInterface object. |
|
62 */ |
|
63 |
|
64 QDesignerMetaEnumInterface::QDesignerMetaEnumInterface() |
|
65 { |
|
66 } |
|
67 |
|
68 /*! |
|
69 Destroys the QDesignerMetaEnumInterface object. |
|
70 */ |
|
71 QDesignerMetaEnumInterface::~QDesignerMetaEnumInterface() |
|
72 { |
|
73 } |
|
74 |
|
75 /*! |
|
76 \fn bool QDesignerMetaEnumInterface::isFlag() const |
|
77 |
|
78 Returns true if this enumerator is used as a flag. |
|
79 */ |
|
80 |
|
81 /*! |
|
82 \fn QString QDesignerMetaEnumInterface::key(int index) const |
|
83 |
|
84 Returns the key with the given \a index. |
|
85 */ |
|
86 |
|
87 /*! |
|
88 \fn int QDesignerMetaEnumInterface::keyCount() const |
|
89 |
|
90 Returns the number of keys. |
|
91 */ |
|
92 |
|
93 /*! |
|
94 \fn int QDesignerMetaEnumInterface::keyToValue(const QString &key) const |
|
95 |
|
96 Returns the integer value of the given enumeration \a key, or -1 if \a key is not defined. |
|
97 */ |
|
98 |
|
99 /*! |
|
100 \fn int QDesignerMetaEnumInterface::keysToValue(const QString &keys) const |
|
101 |
|
102 Returns the value derived from combining together the values of the \a keys using the OR operator, or -1 if keys is not defined. Note that the strings in \a keys must be '|'-separated. |
|
103 */ |
|
104 |
|
105 /*! |
|
106 \fn QString QDesignerMetaEnumInterface::name() const |
|
107 |
|
108 Returns the name of the enumerator (without the scope). |
|
109 */ |
|
110 |
|
111 /*! |
|
112 \fn QString QDesignerMetaEnumInterface::scope() const |
|
113 |
|
114 Returns the scope this enumerator was declared in. |
|
115 */ |
|
116 |
|
117 /*! |
|
118 \fn QString QDesignerMetaEnumInterface::separator() const |
|
119 |
|
120 Returns the separator to be used when building enumeration names. |
|
121 */ |
|
122 |
|
123 /*! |
|
124 \fn int QDesignerMetaEnumInterface::value(int index) const |
|
125 |
|
126 Returns the value with the given \a index; or returns -1 if there is no such value. |
|
127 */ |
|
128 |
|
129 /*! |
|
130 \fn QString QDesignerMetaEnumInterface::valueToKey(int value) const |
|
131 |
|
132 Returns the string that is used as the name of the given enumeration \a value, or QString::null if value is not defined. |
|
133 */ |
|
134 |
|
135 /*! |
|
136 \fn QString QDesignerMetaEnumInterface::valueToKeys(int value) const |
|
137 |
|
138 Returns a byte array of '|'-separated keys that represents the given \a value. |
|
139 */ |
|
140 |
|
141 /*! |
|
142 \class QDesignerMetaPropertyInterface |
|
143 \internal |
|
144 \since 4.4 |
|
145 |
|
146 \brief QDesignerMetaPropertyInterface is part of \QD's introspection interface and represents a property. |
|
147 |
|
148 \inmodule QtDesigner |
|
149 |
|
150 The QDesignerMetaPropertyInterface class provides meta-data about a property. |
|
151 |
|
152 \sa QDesignerMetaObjectInterface |
|
153 */ |
|
154 |
|
155 /*! |
|
156 Constructs a QDesignerMetaPropertyInterface object. |
|
157 */ |
|
158 |
|
159 QDesignerMetaPropertyInterface::QDesignerMetaPropertyInterface() |
|
160 { |
|
161 } |
|
162 |
|
163 /*! |
|
164 Destroys the QDesignerMetaPropertyInterface object. |
|
165 */ |
|
166 |
|
167 QDesignerMetaPropertyInterface::~QDesignerMetaPropertyInterface() |
|
168 { |
|
169 } |
|
170 |
|
171 /*! |
|
172 \enum QDesignerMetaPropertyInterface::Kind |
|
173 |
|
174 This enum indicates whether the property is of a special type. |
|
175 |
|
176 \value EnumKind The property is of an enumeration type |
|
177 \value FlagKind The property is of an flag type |
|
178 \value OtherKind The property is of another type |
|
179 */ |
|
180 |
|
181 /*! |
|
182 \enum QDesignerMetaPropertyInterface::AccessFlag |
|
183 |
|
184 These flags specify the access the property provides. |
|
185 |
|
186 \value ReadAccess Property can be read |
|
187 \value WriteAccess Property can be written |
|
188 \value ResetAccess Property can be reset to a default value |
|
189 */ |
|
190 |
|
191 /*! |
|
192 \enum QDesignerMetaPropertyInterface::Attribute |
|
193 |
|
194 Various attributes of the property. |
|
195 |
|
196 \value DesignableAttribute Property is designable (visible in \QD) |
|
197 \value ScriptableAttribute Property is scriptable |
|
198 \value StoredAttribute Property is stored, that is, not calculated |
|
199 \value UserAttribute Property is the property that the user can edit for the QObject |
|
200 */ |
|
201 |
|
202 /*! |
|
203 \fn const QDesignerMetaEnumInterface *QDesignerMetaPropertyInterface::enumerator() const |
|
204 |
|
205 Returns the enumerator if this property's type is an enumerator type; |
|
206 */ |
|
207 |
|
208 /*! |
|
209 \fn Kind QDesignerMetaPropertyInterface::kind() const |
|
210 |
|
211 Returns the type of the property. |
|
212 */ |
|
213 |
|
214 /*! |
|
215 \fn AccessFlags QDesignerMetaPropertyInterface::accessFlags() const |
|
216 |
|
217 Returns a combination of access flags. |
|
218 */ |
|
219 |
|
220 /*! |
|
221 \fn Attributes QDesignerMetaPropertyInterface::attributes(const QObject *object) const |
|
222 |
|
223 Returns the attributes of the property for the gives \a object. |
|
224 */ |
|
225 |
|
226 /*! |
|
227 \fn QVariant::Type QDesignerMetaPropertyInterface::type() const |
|
228 |
|
229 Returns the type of the property. |
|
230 */ |
|
231 |
|
232 /*! |
|
233 \fn QString QDesignerMetaPropertyInterface::name() const |
|
234 |
|
235 Returns the name of the property. |
|
236 */ |
|
237 |
|
238 /*! |
|
239 \fn QString QDesignerMetaPropertyInterface::typeName() const |
|
240 |
|
241 Returns the name of this property's type. |
|
242 */ |
|
243 |
|
244 |
|
245 /*! |
|
246 \fn int QDesignerMetaPropertyInterface::userType() const |
|
247 |
|
248 Returns this property's user type. |
|
249 */ |
|
250 |
|
251 /*! |
|
252 \fn bool QDesignerMetaPropertyInterface::hasSetter() const |
|
253 |
|
254 Returns whether getter and setter methods exist for this property. |
|
255 */ |
|
256 |
|
257 /*! |
|
258 \fn QVariant QDesignerMetaPropertyInterface::read(const QObject *object) const |
|
259 |
|
260 Reads the property's value from the given \a object. Returns the value if it was able to read it; otherwise returns an invalid variant. |
|
261 */ |
|
262 |
|
263 /*! |
|
264 \fn bool QDesignerMetaPropertyInterface::reset(QObject *object) const |
|
265 |
|
266 Resets the property for the given \a object with a reset method. Returns true if the reset worked; otherwise returns false. |
|
267 */ |
|
268 |
|
269 /*! |
|
270 \fn bool QDesignerMetaPropertyInterface::write(QObject *object, const QVariant &value) const |
|
271 |
|
272 Writes \a value as the property's value to the given \a object. Returns true if the write succeeded; otherwise returns false. |
|
273 */ |
|
274 |
|
275 /*! |
|
276 \class QDesignerMetaMethodInterface |
|
277 \internal |
|
278 \since 4.4 |
|
279 |
|
280 \brief QDesignerMetaMethodInterface is part of \QD's introspection interface and represents a member function. |
|
281 |
|
282 \inmodule QtDesigner |
|
283 |
|
284 The QDesignerMetaMethodInterface class provides meta-data about a member function. |
|
285 |
|
286 \sa QDesignerMetaObjectInterface |
|
287 */ |
|
288 |
|
289 /*! |
|
290 Constructs a QDesignerMetaMethodInterface object. |
|
291 */ |
|
292 |
|
293 QDesignerMetaMethodInterface::QDesignerMetaMethodInterface() |
|
294 { |
|
295 } |
|
296 |
|
297 /*! |
|
298 Destroys the QDesignerMetaMethodInterface object. |
|
299 */ |
|
300 |
|
301 QDesignerMetaMethodInterface::~QDesignerMetaMethodInterface() |
|
302 { |
|
303 } |
|
304 |
|
305 /*! |
|
306 \enum QDesignerMetaMethodInterface::MethodType |
|
307 |
|
308 This enum specifies the type of the method |
|
309 |
|
310 \value Method The function is a plain member function. |
|
311 \value Signal The function is a signal. |
|
312 \value Slot The function is a slot. |
|
313 \value Constructor The function is a constructor. |
|
314 |
|
315 */ |
|
316 |
|
317 /*! |
|
318 \enum QDesignerMetaMethodInterface::Access |
|
319 |
|
320 This enum represents the access specification of the method |
|
321 |
|
322 \value Private A private member function |
|
323 \value Protected A protected member function |
|
324 \value Public A public member function |
|
325 */ |
|
326 |
|
327 /*! |
|
328 \fn QDesignerMetaMethodInterface::Access QDesignerMetaMethodInterface::access() const |
|
329 |
|
330 Returns the access specification of this method. |
|
331 */ |
|
332 |
|
333 |
|
334 /*! |
|
335 \fn QDesignerMetaMethodInterface::MethodType QDesignerMetaMethodInterface::methodType() const |
|
336 |
|
337 Returns the type of this method. |
|
338 */ |
|
339 |
|
340 /*! |
|
341 \fn QStringList QDesignerMetaMethodInterface::parameterNames() const |
|
342 |
|
343 Returns a list of parameter names. |
|
344 */ |
|
345 |
|
346 /*! |
|
347 \fn QStringList QDesignerMetaMethodInterface::parameterTypes() const |
|
348 |
|
349 Returns a list of parameter types. |
|
350 */ |
|
351 |
|
352 /*! |
|
353 \fn QString QDesignerMetaMethodInterface::signature() const |
|
354 |
|
355 Returns the signature of this method. |
|
356 */ |
|
357 |
|
358 /*! |
|
359 \fn QString QDesignerMetaMethodInterface::normalizedSignature() const |
|
360 |
|
361 Returns the normalized signature of this method (suitable as signal/slot specification). |
|
362 */ |
|
363 |
|
364 |
|
365 /*! |
|
366 \fn QString QDesignerMetaMethodInterface::tag() const |
|
367 |
|
368 Returns the tag associated with this method. |
|
369 */ |
|
370 |
|
371 /*! |
|
372 \fn QString QDesignerMetaMethodInterface::typeName() const |
|
373 |
|
374 Returns the return type of this method, or an empty string if the return type is void. |
|
375 */ |
|
376 |
|
377 /*! |
|
378 \class QDesignerMetaObjectInterface |
|
379 \internal |
|
380 \since 4.4 |
|
381 |
|
382 \brief QDesignerMetaObjectInterface is part of \QD's introspection interface and provides meta-information about Qt objects |
|
383 |
|
384 \inmodule QtDesigner |
|
385 |
|
386 The QDesignerMetaObjectInterface class provides meta-data about Qt objects. For a given object, it can be obtained |
|
387 by querying QDesignerIntrospectionInterface. |
|
388 |
|
389 \sa QDesignerIntrospectionInterface |
|
390 */ |
|
391 |
|
392 /*! |
|
393 Constructs a QDesignerMetaObjectInterface object. |
|
394 */ |
|
395 |
|
396 QDesignerMetaObjectInterface::QDesignerMetaObjectInterface() |
|
397 { |
|
398 } |
|
399 |
|
400 /*! |
|
401 Destroys the QDesignerMetaObjectInterface object. |
|
402 */ |
|
403 |
|
404 QDesignerMetaObjectInterface::~QDesignerMetaObjectInterface() |
|
405 { |
|
406 } |
|
407 |
|
408 /*! |
|
409 \fn QString QDesignerMetaObjectInterface::className() const |
|
410 |
|
411 Returns the class name. |
|
412 */ |
|
413 |
|
414 /*! |
|
415 \fn const QDesignerMetaEnumInterface *QDesignerMetaObjectInterface::enumerator(int index) const |
|
416 |
|
417 Returns the meta-data for the enumerator with the given \a index. |
|
418 */ |
|
419 |
|
420 /*! |
|
421 \fn int QDesignerMetaObjectInterface::enumeratorCount() const |
|
422 |
|
423 Returns the number of enumerators in this class. |
|
424 */ |
|
425 |
|
426 /*! |
|
427 \fn int QDesignerMetaObjectInterface::enumeratorOffset() const |
|
428 |
|
429 Returns the enumerator offset for this class; i.e. the index position of this class's first enumerator. |
|
430 */ |
|
431 |
|
432 /*! |
|
433 \fn int QDesignerMetaObjectInterface::indexOfEnumerator(const QString &name) const |
|
434 |
|
435 Finds enumerator \a name and returns its index; otherwise returns -1. |
|
436 */ |
|
437 |
|
438 /*! |
|
439 \fn int QDesignerMetaObjectInterface::indexOfMethod(const QString &method) const |
|
440 |
|
441 Finds \a method and returns its index; otherwise returns -1. |
|
442 */ |
|
443 |
|
444 /*! |
|
445 \fn int QDesignerMetaObjectInterface::indexOfProperty(const QString &name) const |
|
446 |
|
447 Finds property \a name and returns its index; otherwise returns -1. |
|
448 */ |
|
449 |
|
450 /*! |
|
451 \fn int QDesignerMetaObjectInterface::indexOfSignal(const QString &signal) const |
|
452 |
|
453 Finds \a signal and returns its index; otherwise returns -1. |
|
454 */ |
|
455 |
|
456 /*! |
|
457 \fn int QDesignerMetaObjectInterface::indexOfSlot(const QString &slot) const |
|
458 |
|
459 Finds \a slot and returns its index; otherwise returns -1. |
|
460 */ |
|
461 |
|
462 /*! |
|
463 \fn const QDesignerMetaMethodInterface *QDesignerMetaObjectInterface::method(int index) const |
|
464 |
|
465 Returns the meta-data for the method with the given \a index. |
|
466 */ |
|
467 |
|
468 /*! |
|
469 \fn int QDesignerMetaObjectInterface::methodCount() const |
|
470 |
|
471 Returns the number of methods in this class. These include ordinary methods, signals, and slots. |
|
472 */ |
|
473 |
|
474 /*! |
|
475 \fn int QDesignerMetaObjectInterface::methodOffset() const |
|
476 |
|
477 Returns the method offset for this class; i.e. the index position of this class's first member function. |
|
478 */ |
|
479 |
|
480 /*! |
|
481 \fn const QDesignerMetaPropertyInterface *QDesignerMetaObjectInterface::property(int index) const |
|
482 |
|
483 Returns the meta-data for the property with the given \a index. |
|
484 */ |
|
485 /*! |
|
486 \fn int QDesignerMetaObjectInterface::propertyCount() const |
|
487 |
|
488 Returns the number of properties in this class. |
|
489 */ |
|
490 /*! |
|
491 \fn int QDesignerMetaObjectInterface::propertyOffset() const |
|
492 |
|
493 Returns the property offset for this class; i.e. the index position of this class's first property. |
|
494 */ |
|
495 |
|
496 /*! |
|
497 \fn const QDesignerMetaObjectInterface *QDesignerMetaObjectInterface::superClass() const |
|
498 |
|
499 Returns the meta-object of the superclass, or 0 if there is no such object. |
|
500 */ |
|
501 |
|
502 /*! |
|
503 \fn const QDesignerMetaPropertyInterface *QDesignerMetaObjectInterface::userProperty() const |
|
504 |
|
505 Returns the property that has the USER flag set to true. |
|
506 */ |
|
507 |
|
508 /*! |
|
509 \class QDesignerIntrospectionInterface |
|
510 \internal |
|
511 \since 4.4 |
|
512 |
|
513 \brief QDesignerIntrospectionInterface provides access to a QDesignerMetaObjectInterface for a given Qt object. |
|
514 |
|
515 \inmodule QtDesigner |
|
516 |
|
517 QDesignerIntrospectionInterface is the main class of \QD's introspection interface. These |
|
518 interfaces provide a layer of abstraction around QMetaObject and related classes to allow for the integration |
|
519 of other programming languages. |
|
520 |
|
521 An instance of QDesignerIntrospectionInterface can be obtained from the core. |
|
522 |
|
523 \sa QDesignerMetaObjectInterface |
|
524 */ |
|
525 |
|
526 /*! |
|
527 Constructs a QDesignerIntrospectionInterface object. |
|
528 */ |
|
529 |
|
530 QDesignerIntrospectionInterface::QDesignerIntrospectionInterface() |
|
531 { |
|
532 } |
|
533 |
|
534 /*! |
|
535 Destroys the QDesignerIntrospectionInterface object. |
|
536 */ |
|
537 |
|
538 QDesignerIntrospectionInterface::~QDesignerIntrospectionInterface() |
|
539 { |
|
540 } |
|
541 |
|
542 /*! |
|
543 \fn const QDesignerMetaObjectInterface* QDesignerIntrospectionInterface::metaObject(const QObject *object) const |
|
544 |
|
545 Returns the meta object of this \a object. |
|
546 */ |
|
547 |
|
548 QT_END_NAMESPACE |