summaryrefslogtreecommitdiffstats
path: root/qt/src/qdbusbus.cpp
blob: f46966b47aa5978a91fbfe63045448ddcd0dbec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
/* -*- C++ -*-
 *
 * Copyright (C) 2006 Trolltech AS. All rights reserved.
 *    Author: Thiago Macieira <thiago.macieira@trolltech.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

/*
 * This file was generated by dbusidl2cpp version 0.3
 * when processing input file -
 *
 * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
 *
 * This file has been hand-edited! Be careful when re-generating it!
 *
 */

#include "qdbusbus.h"

#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>

/*
 * Implementation of interface class QDBusBusService
 */

/*!
    \class QDBusBusService
    \brief Provides access to the D-Bus bus daemon service.

*/

/*!
    \enum QDBusBusService::RequestNameOption

    Flags for requesting a name on the bus.

    \value AllowReplacingName   Allow another application requesting the same name to take the name
                                from this application.
    \value ReplaceExistingName  If another application already has the name and allows replacing,
                                take the name and assign it to us.
    \value DoNotQueueName       Without this flag, if an application requests a name that is already
                                owned and does not allow replacing, it will be queued until the
                                name is given up. If this flag is given, no queueing will be
                                performed and the requestName() call will simply fail.
*/

/*!
    \enum QDBusBusService::RequestNameReply

    The possible return values from requestName():

    \value PrimaryOwnerReply    The caller is now the primary owner of the name.
    \value InQueueReply         The caller is in queue for the name, but does not own it.
    \value NameExistsReply      The name exists and could not be replaced, or the caller did
                                specify DoNotQueueName.
    \value AlreadyOwnerReply    The caller tried to request a name that it already owns.
*/

/*!
    \enum QDBusBusService::ReleaseNameReply

    The possible return values from releaseName():

    \value NameReleasedReply    The caller released his claim on the name.
    \value NameNonExistentReply The caller tried to release a name that did not exist.
    \value NotOwnerReply        The caller tried to release a name that it did not own or was not in
                                queue for.
*/

/*!
    \enum QDBusBusService::StartServiceReply

    The possible return values from startServiceByName():

    \value Success              The service was successfully started.
    \value AlreadyRunning       The service was already running.
*/

/*!
    \internal
*/
const char *QDBusBusService::staticInterfaceName()
{ return "org.freedesktop.DBus"; }


/*!
    \internal
*/
QDBusBusService::QDBusBusService(QDBusAbstractInterfacePrivate *p)
    : QDBusAbstractInterface(p)
{
    connect(this, SIGNAL(NameAcquired(QString)), this, SIGNAL(nameAcquired(QString)));
    connect(this, SIGNAL(NameLost(QString)), this, SIGNAL(nameLost(QString)));
    connect(this, SIGNAL(NameOwnerChanged(QString,QString,QString)),
            this, SIGNAL(nameOwnerChanged(QString,QString,QString)));
}

/*!
    \internal
*/
QDBusBusService::~QDBusBusService()
{
}

/*!
    \fn QDBusBusService::hello()
    \internal
    Sends a "Hello" request to the bus service. You do not want to call this.
*/
QDBusReply<QString> QDBusBusService::Hello()
{
    return call(QLatin1String("Hello"));
}

/*!
    \fn QDBusBusService::nameOwner(const QString &name)
    Returns the unique connection name of the primary owner of the name \a name. If the requested
    name doesn't have an owner, returns a org.freedesktop.DBus.Error.NameHasNoOwner error.
*/
QDBusReply<QString> QDBusBusService::GetNameOwner(const QString &name)
{
    return call(QLatin1String("GetNameOwner.s"), name);
}

/*!
    \fn QDBusBusService::listNames()
    Lists all names currently existing on the bus.
*/
QDBusReply<QStringList> QDBusBusService::ListNames()
{
    return call(QLatin1String("ListNames"));
}

/*!
    \fn QDBusBusService::listQueuedOwners(const QString &serviceName)
    Returns a list of all unique connection names in queue for the service name \a service.
*/
QDBusReply<QStringList> QDBusBusService::ListQueuedOwners(const QString &serviceName)
{
    return call(QLatin1String("ListQueuedOwners.s"), serviceName);
}

/*!
    \fn QDBusBusService::nameHasOwner(const QString &serviceName)
    Returns true if the service name \a service has an owner.
*/
QDBusReply<bool> QDBusBusService::NameHasOwner(const QString &serviceName)
{
    return call(QLatin1String("NameHasOwner.s"), serviceName);
}

/*!
    \fn QDBusBusService::addMatch(const QString &rule)
    Adds the rule \a rule for requesting messages from the bus.

    \sa removeMatch()
*/
QDBusReply<void> QDBusBusService::AddMatch(const QString &rule)
{
    return call(QLatin1String("AddMatch.s"), rule);
}

/*!
    \fn QDBusBusService::removeMatch(const QString &rule)
    Removes the rule \a rule, that had previously been added with addMatch().
*/
QDBusReply<void> QDBusBusService::RemoveMatch(const QString &rule)
{
    return call(QLatin1String("RemoveMatch.s"), rule);
}

/*!
    \fn QDBusBusService::connectionSELinuxSecurityContext(const QString &serviceName)
    Returns the SELinux security context of the process currently holding the bus service \a
    service.
*/
QDBusReply<QByteArray> QDBusBusService::GetConnectionSELinuxSecurityContext(const QString &serviceName)
{
    return call(QLatin1String("GetConnectionSELinuxSecurityContext.s"), serviceName);
}

/*!
    \fn QDBusBusService::connectionUnixProcessID(const QString &serviceName)
    Returns the Unix Process ID (PID) for the process currently holding the bus service \a service.
*/
QDBusReply<uint> QDBusBusService::GetConnectionUnixProcessID(const QString &serviceName)
{
    return call(QLatin1String("GetConnectionUnixProcessID.s"), serviceName);
}

/*!
    \fn QDBusBusService::connectionUnixUser(const QString &serviceName)
    Returns the Unix User ID (UID) for the process currently holding the bus service \a service.
*/
QDBusReply<uint> QDBusBusService::GetConnectionUnixUser(const QString &serviceName)
{
    return call(QLatin1String("GetConnectionUnixUser.s"), serviceName);
}

/*!
    \fn QDBusBusService::reloadConfig()
    Asks the D-Bus server daemon to reload its configuration.
*/
QDBusReply<void> QDBusBusService::ReloadConfig()
{
    return call(QLatin1String("ReloadConfig"));
}

inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::StartServiceReply *)
{ return QVariant::Int; }

/*!
    \fn QDBusBusService::startServiceByName(const QString &name, uint flags)
    Requests that the bus start the service given by the name \a name.

    The \a flags parameter is currently not used.
*/
QDBusReply<QDBusBusService::StartServiceReply>
QDBusBusService::StartServiceByName(const QString &name, uint flags)
{
    return call(QLatin1String("StartServiceByName.su"), name, flags);
}

inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::RequestNameReply *)
{ return QVariant::Int; }

/*!
    \fn QDBusBusService::requestName(const QString &serviceName, RequestNameOptions flags)
    Requests the bus service name \a service from the bus. The \a flags parameter specifies how the
    bus server daemon should act when the same name is requested by two different applications.

    \sa releaseName()
*/
QDBusReply<QDBusBusService::RequestNameReply>
QDBusBusService::RequestName(const QString &serviceName, RequestNameOptions flags)
{
    return call(QLatin1String("RequestName.su"), serviceName, uint(int(flags)));
}

inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::ReleaseNameReply *)
{ return QVariant::Int; }

/*!
    \fn QDBusBusService::releaseName(const QString &serviceName)
    Releases the claim on the bus service name \a service, that had been previously requested with
    requestName(). If this application had ownership of the name, it will be released for other
    applications to claim. If it only had the name queued, it gives up its position in the queue.
*/
QDBusReply<QDBusBusService::ReleaseNameReply>
QDBusBusService::ReleaseName(const QString &serviceName)
{
    return call(QLatin1String("ReleaseName.s"), serviceName);
}

// signals
/*!
    \fn QDBusBusService::nameAcquired(const QString &serviceName)

    This signal is emitted by the D-Bus bus server when the bus service name (unique connection name
    or well-known service name) given by \a service is acquired by this application.

    Name acquisition happens after the application requested a name using requestName().
*/

/*!
    \fn QDBusBusService::nameLost(const QString &serviceName)

    This signal is emitted by the D-Bus bus server when the application loses ownership of the bus
    service name given by \a service.
*/

/*!
    \fn QDBusBusService::nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)

    This signal is emitted by the D-Bus bus server whenever a name ownership change happens in the
    bus, including apparition and disparition of names.

    This signal means the application \a oldOwner lost ownership of bus name \a name to application
    \a newOwner. If \a oldOwner is an empty string, it means the name \a name has just been created;
    if \a newOwner is empty, the name \a name has no current owner.
*/

#include "qdbusbus.moc"