* dbus/dbus-sysdeps.c: Make tcp socket connection error somewhat more
[platform/upstream/dbus.git] / qt / src / qdbusbus.h
1 /* -*- C++ -*-
2  *
3  * Copyright (C) 2006 Trolltech AS. All rights reserved.
4  *    Author: Thiago Macieira <thiago.macieira@trolltech.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  */
21
22 /*
23  * This file was generated by dbusidl2cpp version 0.3
24  * when processing input file -
25  *
26  * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
27  *
28  * This file has been hand-edited! Be careful when re-generating it!
29  *
30  */
31
32 #ifndef QDBUSBUS_H
33 #define QDBUSBUS_H
34
35 #include <QtCore/qstringlist.h>
36
37 #include "qdbusabstractinterface.h"
38 #include "qdbusreply.h"
39
40 class QDBusConnection;
41 class QString;
42 class QByteArray;
43
44 /*
45  * Proxy class for interface org.freedesktop.DBus
46  */
47 class QDBUS_EXPORT QDBusBusService: public QDBusAbstractInterface
48 {
49     Q_OBJECT
50     friend class QDBusConnection;
51     static inline const char *staticInterfaceName();
52
53     explicit QDBusBusService(QDBusAbstractInterfacePrivate *p);
54
55     ~QDBusBusService();
56
57 public:
58     // taken out of http://dbus.freedesktop.org/doc/dbus-specification.html
59     // update if the standard updates
60     enum RequestNameOption {
61         AllowReplacingName = 0x1,
62         ReplaceExistingName = 0x2,
63         DoNotQueueName = 0x4
64     };
65     Q_DECLARE_FLAGS(RequestNameOptions, RequestNameOption)
66
67     enum RequestNameReply {
68         PrimaryOwnerReply = 1,
69         InQueueReply = 2,
70         NameExistsReply = 3,
71         AlreadyOwnerReply = 4
72     };
73
74     enum ReleaseNameReply {
75         NameReleasedReply = 1,
76         NameNonExistentReply = 2,
77         NotOwnerReply = 3
78     };
79
80     enum StartServiceReply {
81         Success = 1,
82         AlreadyRunning = 2
83     };    
84
85 #ifndef Q_QDOC
86     // D-Bus names
87 public: // METHODS
88     QDBusReply<QString> Hello();
89     QDBusReply<void> ReloadConfig();
90
91     QDBusReply<QStringList> ListNames();
92         
93     QDBusReply<bool> NameHasOwner(const QString &service);
94     QDBusReply<QString> GetNameOwner(const QString &name);
95     QDBusReply<ReleaseNameReply> ReleaseName(const QString &service);    
96     QDBusReply<RequestNameReply> RequestName(const QString &service, RequestNameOptions flags);
97     QDBusReply<QStringList> ListQueuedOwners(const QString &service);
98
99     QDBusReply<void> AddMatch(const QString &rule);
100     QDBusReply<void> RemoveMatch(const QString &rule);
101
102     QDBusReply<QByteArray> GetConnectionSELinuxSecurityContext(const QString &service);
103     QDBusReply<uint> GetConnectionUnixProcessID(const QString &service);
104     QDBusReply<uint> GetConnectionUnixUser(const QString &service);
105
106     QDBusReply<StartServiceReply> StartServiceByName(const QString &name, uint flags);
107
108 signals: // SIGNALS
109     void NameAcquired(const QString &service);
110     void NameLost(const QString &service);
111     void NameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
112 #endif
113
114     // Qt-style naming    
115 public slots:
116     QDBusReply<QString> hello()
117     { return Hello(); }
118     QDBusReply<void> reloadConfig()
119     { return ReloadConfig(); }
120
121     QDBusReply<QStringList> listNames()
122     { return ListNames(); }
123         
124     QDBusReply<bool> nameHasOwner(const QString &service)
125     { return NameHasOwner(service); }
126     QDBusReply<QString> nameOwner(const QString &name)
127     { return GetNameOwner(name); }
128     QDBusReply<ReleaseNameReply> releaseName(const QString &service)
129     { return ReleaseName(service); }
130     QDBusReply<RequestNameReply> requestName(const QString &service, RequestNameOptions flags)
131     { return RequestName(service, flags); }
132     QDBusReply<QStringList> listQueuedOwners(const QString &service)
133     { return ListQueuedOwners(service); }
134
135     QDBusReply<void> addMatch(const QString &rule)
136     { return AddMatch(rule); }
137     QDBusReply<void> removeMatch(const QString &rule)
138     { return RemoveMatch(rule); }
139
140     QDBusReply<QByteArray> connectionSELinuxSecurityContext(const QString &service)
141     { return GetConnectionSELinuxSecurityContext(service); }
142     QDBusReply<uint> connectionUnixProcessID(const QString &service)
143     { return GetConnectionUnixProcessID(service); }
144     QDBusReply<uint> connectionUnixUser(const QString &service)
145     { return GetConnectionUnixUser(service); }
146
147     QDBusReply<StartServiceReply> startServiceByName(const QString &name, uint flags)
148     { return StartServiceByName(name, flags); }
149
150 signals:
151     void nameAcquired(const QString &service);
152     void nameLost(const QString &service);
153     void nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
154 };
155
156 Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusBusService::RequestNameOptions)
157
158 #endif