QDBusPendingCallPrivate: save 8 bytes on 64-bit archs
[profile/ivi/qtbase.git] / src / dbus / qdbusabstractinterface.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtDBus module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QDBUSABSTRACTINTERFACE_H
43 #define QDBUSABSTRACTINTERFACE_H
44
45 #include <QtCore/qstring.h>
46 #include <QtCore/qvariant.h>
47 #include <QtCore/qlist.h>
48 #include <QtCore/qobject.h>
49
50 #include <QtDBus/qdbusmessage.h>
51 #include <QtDBus/qdbusextratypes.h>
52 #include <QtDBus/qdbusconnection.h>
53
54 #ifndef QT_NO_DBUS
55
56 QT_BEGIN_HEADER
57
58 QT_BEGIN_NAMESPACE
59
60
61 class QDBusError;
62 class QDBusPendingCall;
63
64 class QDBusAbstractInterfacePrivate;
65
66 class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
67 {
68 public:
69     int qt_metacall(QMetaObject::Call, int, void**);
70 protected:
71     QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &dd, QObject *parent);
72 private:
73     Q_DECLARE_PRIVATE(QDBusAbstractInterface)
74 };
75
76 class Q_DBUS_EXPORT QDBusAbstractInterface:
77 #ifdef Q_QDOC
78         public QObject
79 #else
80         public QDBusAbstractInterfaceBase
81 #endif
82 {
83     Q_OBJECT
84
85 public:
86     virtual ~QDBusAbstractInterface();
87     bool isValid() const;
88
89     QDBusConnection connection() const;
90
91     QString service() const;
92     QString path() const;
93     QString interface() const;
94
95     QDBusError lastError() const;
96
97     void setTimeout(int timeout);
98     int timeout() const;
99
100     QDBusMessage call(const QString &method,
101                       const QVariant &arg1 = QVariant(),
102                       const QVariant &arg2 = QVariant(),
103                       const QVariant &arg3 = QVariant(),
104                       const QVariant &arg4 = QVariant(),
105                       const QVariant &arg5 = QVariant(),
106                       const QVariant &arg6 = QVariant(),
107                       const QVariant &arg7 = QVariant(),
108                       const QVariant &arg8 = QVariant());
109
110     QDBusMessage call(QDBus::CallMode mode,
111                       const QString &method,
112                       const QVariant &arg1 = QVariant(),
113                       const QVariant &arg2 = QVariant(),
114                       const QVariant &arg3 = QVariant(),
115                       const QVariant &arg4 = QVariant(),
116                       const QVariant &arg5 = QVariant(),
117                       const QVariant &arg6 = QVariant(),
118                       const QVariant &arg7 = QVariant(),
119                       const QVariant &arg8 = QVariant());
120
121     QDBusMessage callWithArgumentList(QDBus::CallMode mode,
122                                       const QString &method,
123                                       const QList<QVariant> &args);
124
125     bool callWithCallback(const QString &method,
126                           const QList<QVariant> &args,
127                           QObject *receiver, const char *member, const char *errorSlot);
128     bool callWithCallback(const QString &method,
129                           const QList<QVariant> &args,
130                           QObject *receiver, const char *member);
131
132     QDBusPendingCall asyncCall(const QString &method,
133                                const QVariant &arg1 = QVariant(),
134                                const QVariant &arg2 = QVariant(),
135                                const QVariant &arg3 = QVariant(),
136                                const QVariant &arg4 = QVariant(),
137                                const QVariant &arg5 = QVariant(),
138                                const QVariant &arg6 = QVariant(),
139                                const QVariant &arg7 = QVariant(),
140                                const QVariant &arg8 = QVariant());
141     QDBusPendingCall asyncCallWithArgumentList(const QString &method,
142                                                const QList<QVariant> &args);
143
144 protected:
145     QDBusAbstractInterface(const QString &service, const QString &path, const char *interface,
146                            const QDBusConnection &connection, QObject *parent);
147     QDBusAbstractInterface(QDBusAbstractInterfacePrivate &, QObject *parent);
148
149     void connectNotify(const QMetaMethod &signal);
150     void disconnectNotify(const QMetaMethod &signal);
151     QVariant internalPropGet(const char *propname) const;
152     void internalPropSet(const char *propname, const QVariant &value);
153     QDBusMessage internalConstCall(QDBus::CallMode mode,
154                                    const QString &method,
155                                    const QList<QVariant> &args = QList<QVariant>()) const;
156
157 private:
158     Q_DECLARE_PRIVATE(QDBusAbstractInterface)
159     Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString))
160 };
161
162 QT_END_NAMESPACE
163
164 QT_END_HEADER
165
166 #endif // QT_NO_DBUS
167 #endif