1/****************************************************************************
2**
3** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the test suite of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef QDBUSCPP2XML_TEST1_H
30#define QDBUSCPP2XML_TEST1_H
31
32#include <QObject>
33
34class QDBusObjectPath;
35class QDBusUnixFileDescriptor;
36class QDBusSignature;
37
38class Test1 : public QObject
39{
40 Q_OBJECT
41 Q_CLASSINFO("D-Bus Interface", "org.qtProject.qdbuscpp2xmlTests.Test1")
42 Q_PROPERTY(int numProperty1 READ numProperty1 CONSTANT)
43 Q_PROPERTY(int numProperty2 READ numProperty2 WRITE setNumProperty2)
44 Q_ENUMS(Salaries)
45public:
46 // C++1y allows use of single quote as a digit separator, useful for large
47 // numbers. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
48 // Ensure that qdbuscpp2xml does not get confused with this appearing.
49 enum Salaries {
50 Steve
51#ifdef Q_MOC_RUN
52 = 1'234'567
53#endif
54 };
55
56 Test1(QObject *parent = 0) : QObject(parent) {}
57
58 int numProperty1() { return 42; }
59
60 int numProperty2() { return 42; }
61 void setNumProperty2(int) {}
62
63signals:
64 void signalVoidType();
65 int signalIntType();
66 void signal_primitive_args(int a1, bool a2, short a3, ushort a4, uint a5, qlonglong a6, double a7, qlonglong a8 = 0);
67 void signal_string_args(const QByteArray &ba, const QString &a2);
68 void signal_Qt_args1(const QDate &a1, const QTime &a2, const QDateTime &a3,
69 const QRect &a4, const QRectF &a5, const QSize &a6, const QSizeF &a7);
70 void signal_Qt_args2(const QPoint &a1, const QPointF &a2, const QLine &a3, const QLineF &a4,
71 const QVariantList &a5, const QVariantMap &a6, const QVariantHash &a7);
72
73 void signal_QDBus_args(const QDBusObjectPath &a1, const QDBusSignature &a2, const QDBusUnixFileDescriptor &a3);
74
75 void signal_container_args1(const QList<bool> &a1, const QList<short> &a2, const QList<ushort> &a3, const QList<int> &a4, const QList<uint> &a5);
76 void signal_container_args2(const QList<qlonglong> &a1, const QList<qulonglong> &a2, const QList<double> &a3, const QList<QDBusObjectPath> &a4, const QList<QDBusSignature> &a5, const QList<QDBusUnixFileDescriptor> &a6);
77
78 Q_SCRIPTABLE void signalVoidType_scriptable();
79 Q_SCRIPTABLE int signalIntType_scriptable();
80 Q_SCRIPTABLE void signal_primitive_args_scriptable(int a1, bool a2, short a3, ushort a4, uint a5, qlonglong a6, double a7, qlonglong a8 = 0);
81 Q_SCRIPTABLE void signal_string_args_scriptable(const QByteArray &ba, const QString &a2);
82 Q_SCRIPTABLE void signal_Qt_args1_scriptable(const QDate &a1, const QTime &a2, const QDateTime &a3,
83 const QRect &a4, const QRectF &a5, const QSize &a6, const QSizeF &a7);
84 Q_SCRIPTABLE void signal_Qt_args2_scriptable(const QPoint &a1, const QPointF &a2, const QLine &a3, const QLineF &a4,
85 const QVariantList &a5, const QVariantMap &a6, const QVariantHash &a7);
86
87 Q_SCRIPTABLE void signal_QDBus_args_scriptable(const QDBusObjectPath &a1, const QDBusSignature &a2, const QDBusUnixFileDescriptor &a3);
88
89 Q_SCRIPTABLE void signal_container_args1_scriptable(const QList<bool> &a1, const QList<short> &a2, const QList<ushort> &a3, const QList<int> &a4, const QList<uint> &a5);
90 Q_SCRIPTABLE void signal_container_args2_scriptable(const QList<qlonglong> &a1, const QList<qulonglong> &a2, const QList<double> &a3, const QList<QDBusObjectPath> &a4, const QList<QDBusSignature> &a5, const QList<QDBusUnixFileDescriptor> &a6);
91
92public slots:
93 void slotVoidType() {}
94 int slotIntType() { return 42; }
95
96 Q_SCRIPTABLE void slotVoidType_scriptable() {}
97 Q_SCRIPTABLE int slotIntType_scriptable() { return 42; }
98
99protected slots:
100 void neverExported1() {}
101 int neverExported2() { return 42; }
102
103 Q_SCRIPTABLE void neverExported3() {}
104 Q_SCRIPTABLE int neverExported4() { return 42; }
105
106private slots:
107 void neverExported5() {}
108 int neverExported6() { return 42; }
109
110 Q_SCRIPTABLE void neverExported7() {}
111 Q_SCRIPTABLE int neverExported8() { return 42; }
112
113public:
114 Q_SCRIPTABLE void methodVoidType() {}
115 Q_SCRIPTABLE int methodIntType() { return 42; }
116
117protected:
118 Q_SCRIPTABLE void neverExported9() {}
119 Q_SCRIPTABLE int neverExported10() { return 42; }
120
121private:
122 Q_SCRIPTABLE void neverExported11() {}
123 Q_SCRIPTABLE int neverExported12() { return 42; }
124};
125
126#endif
127

source code of qtbase/tests/auto/tools/qdbuscpp2xml/test1.h