e5fcad3 by Lars Knoll at 2009-03-23 1
/****************************************************************************
2
**
89c08c0 by Jason McDonald at 2012-01-11 3
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
04e3b30 by Jason McDonald at 2009-09-09 4
** All rights reserved.
858c70f by Jason McDonald at 2009-06-16 5
** Contact: Nokia Corporation (qt-info@nokia.com)
e5fcad3 by Lars Knoll at 2009-03-23 6
**
7
** This file is part of the QtCore module of the Qt Toolkit.
8
**
9
** $QT_BEGIN_LICENSE:LGPL$
10
** GNU Lesser General Public License Usage
1eea52e by Jyri Tahtela at 2011-05-13 11
** This file may be used under the terms of the GNU Lesser General Public
12
** License version 2.1 as published by the Free Software Foundation and
13
** appearing in the file LICENSE.LGPL included in the packaging of this
14
** file. Please review the following information to ensure the GNU Lesser
15
** General Public License version 2.1 requirements will be met:
16
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
e5fcad3 by Lars Knoll at 2009-03-23 17
**
04e3b30 by Jason McDonald at 2009-09-09 18
** In addition, as a special exception, Nokia gives you certain additional
1eea52e by Jyri Tahtela at 2011-05-13 19
** rights. These rights are described in the Nokia Qt LGPL Exception
04e3b30 by Jason McDonald at 2009-09-09 20
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
e5fcad3 by Lars Knoll at 2009-03-23 21
**
1eea52e by Jyri Tahtela at 2011-05-13 22
** GNU General Public License Usage
23
** Alternatively, this file may be used under the terms of the GNU General
24
** Public License version 3.0 as published by the Free Software Foundation
25
** and appearing in the file LICENSE.GPL included in the packaging of this
26
** file. Please review the following information to ensure the GNU General
27
** Public License version 3.0 requirements will be met:
28
** http://www.gnu.org/copyleft/gpl.html.
309db73 by Jason McDonald at 2009-08-31 29
**
1eea52e by Jyri Tahtela at 2011-05-13 30
** Other Usage
31
** Alternatively, this file may be used in accordance with the terms and
32
** conditions contained in a signed written agreement between you and Nokia.
309db73 by Jason McDonald at 2009-08-31 33
**
34
**
35
**
36
**
e5fcad3 by Lars Knoll at 2009-03-23 37
**
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
#ifndef QMETAOBJECT_H
43
#define QMETAOBJECT_H
44
45
#include <QtCore/qobjectdefs.h>
46
#include <QtCore/qvariant.h>
47
48
QT_BEGIN_HEADER
49
50
QT_BEGIN_NAMESPACE
51
52
QT_MODULE(Core)
53
54
template <typename T> class QList;
55
56
class Q_CORE_EXPORT QMetaMethod
57
{
58
public:
59
    inline QMetaMethod() : mobj(0),handle(0) {}
60
61
    const char *signature() const;
62
    const char *typeName() const;
63
    QList<QByteArray> parameterTypes() const;
64
    QList<QByteArray> parameterNames() const;
65
    const char *tag() const;
66
    enum Access { Private, Protected, Public };
67
    Access access() const;
68
    enum MethodType { Method, Signal, Slot, Constructor };
69
    MethodType methodType() const;
70
    enum Attributes { Compatibility = 0x1, Cloned = 0x2, Scriptable = 0x4 };
71
    int attributes() const;
b30a252 by Aaron Kennedy at 2009-07-31 72
    int methodIndex() const;
3f80a24 by Martin Jones at 2011-01-05 73
    int revision() const;
e5fcad3 by Lars Knoll at 2009-03-23 74
75
    inline const QMetaObject *enclosingMetaObject() const { return mobj; }
76
77
    bool invoke(QObject *object,
78
                Qt::ConnectionType connectionType,
79
                QGenericReturnArgument returnValue,
80
                QGenericArgument val0 = QGenericArgument(0),
81
                QGenericArgument val1 = QGenericArgument(),
82
                QGenericArgument val2 = QGenericArgument(),
83
                QGenericArgument val3 = QGenericArgument(),
84
                QGenericArgument val4 = QGenericArgument(),
85
                QGenericArgument val5 = QGenericArgument(),
86
                QGenericArgument val6 = QGenericArgument(),
87
                QGenericArgument val7 = QGenericArgument(),
88
                QGenericArgument val8 = QGenericArgument(),
89
                QGenericArgument val9 = QGenericArgument()) const;
90
    inline bool invoke(QObject *object,
91
                       QGenericReturnArgument returnValue,
92
                       QGenericArgument val0 = QGenericArgument(0),
93
                       QGenericArgument val1 = QGenericArgument(),
94
                       QGenericArgument val2 = QGenericArgument(),
95
                       QGenericArgument val3 = QGenericArgument(),
96
                       QGenericArgument val4 = QGenericArgument(),
97
                       QGenericArgument val5 = QGenericArgument(),
98
                       QGenericArgument val6 = QGenericArgument(),
99
                       QGenericArgument val7 = QGenericArgument(),
100
                       QGenericArgument val8 = QGenericArgument(),
101
                       QGenericArgument val9 = QGenericArgument()) const
102
    {
103
        return invoke(object, Qt::AutoConnection, returnValue,
104
                      val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
105
    }
106
    inline bool invoke(QObject *object,
107
                       Qt::ConnectionType connectionType,
108
                       QGenericArgument val0 = QGenericArgument(0),
109
                       QGenericArgument val1 = QGenericArgument(),
110
                       QGenericArgument val2 = QGenericArgument(),
111
                       QGenericArgument val3 = QGenericArgument(),
112
                       QGenericArgument val4 = QGenericArgument(),
113
                       QGenericArgument val5 = QGenericArgument(),
114
                       QGenericArgument val6 = QGenericArgument(),
115
                       QGenericArgument val7 = QGenericArgument(),
116
                       QGenericArgument val8 = QGenericArgument(),
117
                       QGenericArgument val9 = QGenericArgument()) const
118
    {
119
        return invoke(object, connectionType, QGenericReturnArgument(),
120
                      val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
121
    }
122
    inline bool invoke(QObject *object,
123
                       QGenericArgument val0 = QGenericArgument(0),
124
                       QGenericArgument val1 = QGenericArgument(),
125
                       QGenericArgument val2 = QGenericArgument(),
126
                       QGenericArgument val3 = QGenericArgument(),
127
                       QGenericArgument val4 = QGenericArgument(),
128
                       QGenericArgument val5 = QGenericArgument(),
129
                       QGenericArgument val6 = QGenericArgument(),
130
                       QGenericArgument val7 = QGenericArgument(),
131
                       QGenericArgument val8 = QGenericArgument(),
132
                       QGenericArgument val9 = QGenericArgument()) const
133
    {
134
        return invoke(object, Qt::AutoConnection, QGenericReturnArgument(),
135
                      val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
136
    }
137
138
private:
139
    const QMetaObject *mobj;
140
    uint handle;
141
    friend struct QMetaObject;
4a2ba04 by Sergey Vidyuk at 2010-06-18 142
    friend struct QMetaObjectPrivate;
143
    friend class QObject;
e5fcad3 by Lars Knoll at 2009-03-23 144
};
145
Q_DECLARE_TYPEINFO(QMetaMethod, Q_MOVABLE_TYPE);
146
147
class Q_CORE_EXPORT QMetaEnum
148
{
149
public:
150
    inline QMetaEnum() : mobj(0),handle(0) {}
151
152
    const char *name() const;
153
    bool isFlag() const;
154
155
    int keyCount() const;
156
    const char *key(int index) const;
157
    int value(int index) const;
158
159
    const char *scope() const;
160
161
    int keyToValue(const char *key) const;
162
    const char* valueToKey(int value) const;
163
    int keysToValue(const char * keys) const;
164
    QByteArray valueToKeys(int value) const;
165
166
    inline const QMetaObject *enclosingMetaObject() const { return mobj; }
167
168
    inline bool isValid() const { return name() != 0; }
169
private:
170
    const QMetaObject *mobj;
171
    uint handle;
172
    friend struct QMetaObject;
173
};
174
Q_DECLARE_TYPEINFO(QMetaEnum, Q_MOVABLE_TYPE);
175
176
class Q_CORE_EXPORT QMetaProperty
177
{
178
public:
179
    QMetaProperty();
180
181
    const char *name() const;
182
    const char *typeName() const;
183
    QVariant::Type type() const;
184
    int userType() const;
b30a252 by Aaron Kennedy at 2009-07-31 185
    int propertyIndex() const;
e5fcad3 by Lars Knoll at 2009-03-23 186
187
    bool isReadable() const;
188
    bool isWritable() const;
189
    bool isResettable() const;
190
    bool isDesignable(const QObject *obj = 0) const;
191
    bool isScriptable(const QObject *obj = 0) const;
192
    bool isStored(const QObject *obj = 0) const;
193
    bool isEditable(const QObject *obj = 0) const;
194
    bool isUser(const QObject *obj = 0) const;
29202f0 by Aaron Kennedy at 2009-07-31 195
    bool isConstant() const;
7ebd202 by Aaron Kennedy at 2009-07-31 196
    bool isFinal() const;
e5fcad3 by Lars Knoll at 2009-03-23 197
198
    bool isFlagType() const;
199
    bool isEnumType() const;
200
    QMetaEnum enumerator() const;
201
202
    bool hasNotifySignal() const;
203
    QMetaMethod notifySignal() const;
204
    int notifySignalIndex() const;
205
3f80a24 by Martin Jones at 2011-01-05 206
    int revision() const;
207
e5fcad3 by Lars Knoll at 2009-03-23 208
    QVariant read(const QObject *obj) const;
209
    bool write(QObject *obj, const QVariant &value) const;
210
    bool reset(QObject *obj) const;
211
212
    bool hasStdCppSet() const;
213
    inline bool isValid() const { return isReadable(); }
214
    inline const QMetaObject *enclosingMetaObject() const { return mobj; }
215
216
private:
217
    const QMetaObject *mobj;
218
    uint handle;
219
    int idx;
220
    QMetaEnum menum;
221
    friend struct QMetaObject;
222
};
223
224
class Q_CORE_EXPORT QMetaClassInfo
225
{
226
public:
227
    inline QMetaClassInfo() : mobj(0),handle(0) {}
228
    const char *name() const;
229
    const char *value() const;
230
    inline const QMetaObject *enclosingMetaObject() const { return mobj; }
231
private:
232
    const QMetaObject *mobj;
233
    uint handle;
234
    friend struct QMetaObject;
235
};
236
Q_DECLARE_TYPEINFO(QMetaClassInfo, Q_MOVABLE_TYPE);
237
238
QT_END_NAMESPACE
239
240
QT_END_HEADER
241
242
#endif // QMETAOBJECT_H