Qt 4.8
qdbusabstractinterface.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDBus module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
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 
57 
59 
60 QT_MODULE(DBus)
61 
62 class QDBusError;
63 class QDBusPendingCall;
64 
66 
68 {
69 public:
70  int qt_metacall(QMetaObject::Call, int, void**);
71 protected:
73 private:
75 };
76 
78 #ifdef Q_QDOC
79  public QObject
80 #else
82 #endif
83 {
84  Q_OBJECT
85 
86 public:
87  virtual ~QDBusAbstractInterface();
88  bool isValid() const;
89 
90  QDBusConnection connection() const;
91 
92  QString service() const;
93  QString path() const;
94  QString interface() const;
95 
96  QDBusError lastError() const;
97 
98  void setTimeout(int timeout);
99  int timeout() const;
100 
101  QDBusMessage call(const QString &method,
102  const QVariant &arg1 = QVariant(),
103  const QVariant &arg2 = QVariant(),
104  const QVariant &arg3 = QVariant(),
105  const QVariant &arg4 = QVariant(),
106  const QVariant &arg5 = QVariant(),
107  const QVariant &arg6 = QVariant(),
108  const QVariant &arg7 = QVariant(),
109  const QVariant &arg8 = QVariant());
110 
111  QDBusMessage call(QDBus::CallMode mode,
112  const QString &method,
113  const QVariant &arg1 = QVariant(),
114  const QVariant &arg2 = QVariant(),
115  const QVariant &arg3 = QVariant(),
116  const QVariant &arg4 = QVariant(),
117  const QVariant &arg5 = QVariant(),
118  const QVariant &arg6 = QVariant(),
119  const QVariant &arg7 = QVariant(),
120  const QVariant &arg8 = QVariant());
121 
122  QDBusMessage callWithArgumentList(QDBus::CallMode mode,
123  const QString &method,
124  const QList<QVariant> &args);
125 
126  bool callWithCallback(const QString &method,
127  const QList<QVariant> &args,
128  QObject *receiver, const char *member, const char *errorSlot);
129  bool callWithCallback(const QString &method,
130  const QList<QVariant> &args,
131  QObject *receiver, const char *member);
132 
133  QDBusPendingCall asyncCall(const QString &method,
134  const QVariant &arg1 = QVariant(),
135  const QVariant &arg2 = QVariant(),
136  const QVariant &arg3 = QVariant(),
137  const QVariant &arg4 = QVariant(),
138  const QVariant &arg5 = QVariant(),
139  const QVariant &arg6 = QVariant(),
140  const QVariant &arg7 = QVariant(),
141  const QVariant &arg8 = QVariant());
142  QDBusPendingCall asyncCallWithArgumentList(const QString &method,
143  const QList<QVariant> &args);
144 
145 protected:
146  QDBusAbstractInterface(const QString &service, const QString &path, const char *interface,
147  const QDBusConnection &connection, QObject *parent);
149 
150  void connectNotify(const char *signal);
151  void disconnectNotify(const char *signal);
152  QVariant internalPropGet(const char *propname) const;
153  void internalPropSet(const char *propname, const QVariant &value);
154  QDBusMessage internalConstCall(QDBus::CallMode mode,
155  const QString &method,
156  const QList<QVariant> &args = QList<QVariant>()) const;
157 
158 private:
160  Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString))
161 };
162 
164 
166 
167 #endif // QT_NO_DBUS
168 #endif
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
CallMode
This enum describes the various ways of placing a function call.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
Definition: qdbuserror.h:60
The QDBusPendingCall class refers to one pending asynchronous call.
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
virtual void connectNotify(const char *signal)
This virtual function is called when something has been connected to signal in this object...
Definition: qobject.cpp:3142
The QDBusAbstractInterface class is the base class for all D-Bus interfaces in the QtDBus binding...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
#define Q_OBJECT
Definition: qobjectdefs.h:157
virtual void disconnectNotify(const char *signal)
This virtual function is called when something has been disconnected from signal in this object...
Definition: qobject.cpp:3162
The QDBusConnection class represents a connection to the D-Bus bus daemon.
#define Q_DBUS_EXPORT
Definition: qglobal.h:1463
The QDBusMessage class represents one message sent or received over the D-Bus bus.
Definition: qdbusmessage.h:59
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
#define QT_END_HEADER
Definition: qglobal.h:137