3 * Copyright (C) 2006 Trolltech AS. All rights reserved.
4 * Author: Thiago Macieira <thiago.macieira@trolltech.com>
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.
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.
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.
23 * This file was generated by dbusidl2cpp version 0.3
24 * when processing input file -
26 * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
28 * This file has been hand-edited! Be careful when re-generating it!
34 #include <QtCore/QByteArray>
35 #include <QtCore/QList>
36 #include <QtCore/QMap>
37 #include <QtCore/QString>
38 #include <QtCore/QStringList>
39 #include <QtCore/QVariant>
42 * Implementation of interface class QDBusBusService
46 \class QDBusBusService
47 \brief Provides access to the D-Bus bus daemon service.
52 \enum QDBusBusService::RequestNameOption
54 Flags for requesting a name on the bus.
56 \value AllowReplacingName Allow another application requesting the same name to take the name
57 from this application.
58 \value ReplaceExistingName If another application already has the name and allows replacing,
59 take the name and assign it to us.
60 \value DoNotQueueName Without this flag, if an application requests a name that is already
61 owned and does not allow replacing, it will be queued until the
62 name is given up. If this flag is given, no queueing will be
63 performed and the requestName() call will simply fail.
67 \enum QDBusBusService::RequestNameReply
69 The possible return values from requestName():
71 \value PrimaryOwnerReply The caller is now the primary owner of the name.
72 \value InQueueReply The caller is in queue for the name, but does not own it.
73 \value NameExistsReply The name exists and could not be replaced, or the caller did
74 specify DoNotQueueName.
75 \value AlreadyOwnerReply The caller tried to request a name that it already owns.
79 \enum QDBusBusService::ReleaseNameReply
81 The possible return values from releaseName():
83 \value NameReleasedReply The caller released his claim on the name.
84 \value NameNonExistentReply The caller tried to release a name that did not exist.
85 \value NotOwnerReply The caller tried to release a name that it did not own or was not in
90 \enum QDBusBusService::StartServiceReply
92 The possible return values from startServiceByName():
94 \value Success The service was successfully started.
95 \value AlreadyRunning The service was already running.
101 const char *QDBusBusService::staticInterfaceName()
102 { return "org.freedesktop.DBus"; }
108 QDBusBusService::QDBusBusService(QDBusAbstractInterfacePrivate *p)
109 : QDBusAbstractInterface(p)
111 connect(this, SIGNAL(NameAcquired(QString)), this, SIGNAL(nameAcquired(QString)));
112 connect(this, SIGNAL(NameLost(QString)), this, SIGNAL(nameLost(QString)));
113 connect(this, SIGNAL(NameOwnerChanged(QString,QString,QString)),
114 this, SIGNAL(nameOwnerChanged(QString,QString,QString)));
120 QDBusBusService::~QDBusBusService()
125 \fn QDBusBusService::hello()
127 Sends a "Hello" request to the bus service. You do not want to call this.
129 QDBusReply<QString> QDBusBusService::Hello()
131 return call(QLatin1String("Hello"));
135 \fn QDBusBusService::nameOwner(const QString &name)
136 Returns the unique connection name of the primary owner of the name \a name. If the requested
137 name doesn't have an owner, returns a org.freedesktop.DBus.Error.NameHasNoOwner error.
139 QDBusReply<QString> QDBusBusService::GetNameOwner(const QString &name)
141 return call(QLatin1String("GetNameOwner.s"), name);
145 \fn QDBusBusService::listNames()
146 Lists all names currently existing on the bus.
148 QDBusReply<QStringList> QDBusBusService::ListNames()
150 return call(QLatin1String("ListNames"));
154 \fn QDBusBusService::listQueuedOwners(const QString &service)
155 Returns a list of all unique connection names in queue for the service name \a service.
157 QDBusReply<QStringList> QDBusBusService::ListQueuedOwners(const QString &service)
159 return call(QLatin1String("ListQueuedOwners.s"), service);
163 \fn QDBusBusService::nameHasOwner(const QString &service)
164 Returns true if the service name \a service has an owner.
166 QDBusReply<bool> QDBusBusService::NameHasOwner(const QString &service)
168 return call(QLatin1String("NameHasOwner.s"), service);
172 \fn QDBusBusService::addMatch(const QString &rule)
173 Adds the rule \a rule for requesting messages from the bus.
177 QDBusReply<void> QDBusBusService::AddMatch(const QString &rule)
179 return call(QLatin1String("AddMatch.s"), rule);
183 \fn QDBusBusService::removeMatch(const QString &rule)
184 Removes the rule \a rule, that had previously been added with addMatch().
186 QDBusReply<void> QDBusBusService::RemoveMatch(const QString &rule)
188 return call(QLatin1String("RemoveMatch.s"), rule);
192 \fn QDBusBusService::connectionSELinuxSecurityContext(const QString &service)
193 Returns the SELinux security context of the process currently holding the bus service \a
196 QDBusReply<QByteArray> QDBusBusService::GetConnectionSELinuxSecurityContext(const QString &service)
198 return call(QLatin1String("GetConnectionSELinuxSecurityContext.s"), service);
202 \fn QDBusBusService::connectionUnixProcessID(const QString &service)
203 Returns the Unix Process ID (PID) for the process currently holding the bus service \a service.
205 QDBusReply<uint> QDBusBusService::GetConnectionUnixProcessID(const QString &service)
207 return call(QLatin1String("GetConnectionUnixProcessID.s"), service);
211 \fn QDBusBusService::connectionUnixUser(const QString &service)
212 Returns the Unix User ID (UID) for the process currently holding the bus service \a service.
214 QDBusReply<uint> QDBusBusService::GetConnectionUnixUser(const QString &service)
216 return call(QLatin1String("GetConnectionUnixUser.s"), service);
220 \fn QDBusBusService::reloadConfig()
221 Asks the D-Bus server daemon to reload its configuration.
223 QDBusReply<void> QDBusBusService::ReloadConfig()
225 return call(QLatin1String("ReloadConfig"));
228 inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::StartServiceReply *)
229 { return QVariant::Int; }
232 \fn QDBusBusService::startServiceByName(const QString &name, uint flags)
233 Requests that the bus start the service given by the name \a name.
235 The \a flags parameter is currently not used.
237 QDBusReply<QDBusBusService::StartServiceReply>
238 QDBusBusService::StartServiceByName(const QString &name, uint flags)
240 return call(QLatin1String("StartServiceByName.su"), name, flags);
243 inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::RequestNameReply *)
244 { return QVariant::Int; }
247 \fn QDBusBusService::requestName(const QString &service, RequestNameOptions flags)
248 Requests the bus service name \a service from the bus. The \a flags parameter specifies how the
249 bus server daemon should act when the same name is requested by two different applications.
253 QDBusReply<QDBusBusService::RequestNameReply>
254 QDBusBusService::RequestName(const QString &service, RequestNameOptions flags)
256 return call(QLatin1String("RequestName.su"), service, uint(int(flags)));
259 inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::ReleaseNameReply *)
260 { return QVariant::Int; }
263 \fn QDBusBusService::releaseName(const QString &service)
264 Releases the claim on the bus service name \a service, that had been previously requested with
265 requestName(). If this application had ownership of the name, it will be released for other
266 applications to claim. If it only had the name queued, it gives up its position in the queue.
268 QDBusReply<QDBusBusService::ReleaseNameReply>
269 QDBusBusService::ReleaseName(const QString &service)
271 return call(QLatin1String("ReleaseName.s"), service);
276 \fn QDBusBusService::nameAcquired(const QString &service)
278 This signal is emitted by the D-Bus bus server when the bus service name (unique connection name
279 or well-known service name) given by \a service is acquired by this application.
281 Name acquisition happens after the application requested a name using requestName().
285 \fn QDBusBusService::nameLost(const QString &service)
287 This signal is emitted by the D-Bus bus server when the application loses ownership of the bus
288 service name given by \a service.
292 \fn QDBusBusService::nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
294 This signal is emitted by the D-Bus bus server whenever a name ownership change happens in the
295 bus, including apparition and disparition of names.
297 This signal means the application \a oldOwner lost ownership of bus name \a name to application
298 \a newOwner. If \a oldOwner is an empty string, it means the name \a name has just been created;
299 if \a newOwner is empty, the name \a name has no current owner.
302 #include "qdbusbus.moc"