Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > c5a68a1bfbb41dd7ab32131d8bbca747 > files > 2354

qt4-doc-4.3.4-6mdv2008.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.3.4-qt-1203442408707/qt-x11-opensource-src-4.3.4/tools/qdbus/src/qdbusconnectioninterface.cpp -->
<head>
  <title>Qt 4.3: QDBusConnectionInterface Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QDBusConnectionInterface Class Reference<br /><sup><sup>[<a href="qtdbus.html">QtDBus</a> module]</sup></sup></h1>
<p>The QDBusConnectionInterface class provides access to the D-Bus bus daemon service. <a href="#details">More...</a></p>
<pre> #include &lt;QDBusConnectionInterface&gt;</pre><p>Inherits <a href="qdbusabstractinterface.html">QDBusAbstractInterface</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qdbusconnectioninterface-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qdbusconnectioninterface.html#RegisterServiceReply-enum">RegisterServiceReply</a></b> { ServiceNotRegistered, ServiceRegistered, ServiceQueued }</li>
<li><div class="fn"/>enum <b><a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">ServiceQueueOptions</a></b> { DontQueueService, QueueService, ReplaceExistingService }</li>
<li><div class="fn"/>enum <b><a href="qdbusconnectioninterface.html#ServiceReplacementOptions-enum">ServiceReplacementOptions</a></b> { DontAllowReplacement, AllowReplacement }</li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<ul>
<li><div class="fn"/><b><a href="qdbusconnectioninterface.html#registeredServiceNames-prop">registeredServiceNames</a></b> : const QDBusReply&lt;QStringList&gt;</li>
</ul>
<ul>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h3>Public Slots</h3>
<ul>
<li><div class="fn"/>QDBusReply&lt;bool&gt; <b><a href="qdbusconnectioninterface.html#isServiceRegistered">isServiceRegistered</a></b> ( const QString &amp; <i>serviceName</i> ) const</li>
<li><div class="fn"/>QDBusReply&lt;QDBusConnectionInterface::RegisterServiceReply&gt; <b><a href="qdbusconnectioninterface.html#registerService">registerService</a></b> ( const QString &amp; <i>serviceName</i>, ServiceQueueOptions <i>qoption</i> = DontQueueService, ServiceReplacementOptions <i>roption</i> = DontAllowReplacement )</li>
<li><div class="fn"/>QDBusReply&lt;QStringList&gt; <b><a href="qdbusconnectioninterface.html#registeredServiceNames-prop">registeredServiceNames</a></b> () const</li>
<li><div class="fn"/>QDBusReply&lt;QString&gt; <b><a href="qdbusconnectioninterface.html#serviceOwner">serviceOwner</a></b> ( const QString &amp; <i>name</i> ) const</li>
<li><div class="fn"/>QDBusReply&lt;uint&gt; <b><a href="qdbusconnectioninterface.html#servicePid">servicePid</a></b> ( const QString &amp; <i>serviceName</i> ) const</li>
<li><div class="fn"/>QDBusReply&lt;uint&gt; <b><a href="qdbusconnectioninterface.html#serviceUid">serviceUid</a></b> ( const QString &amp; <i>serviceName</i> ) const</li>
<li><div class="fn"/>QDBusReply&lt;void&gt; <b><a href="qdbusconnectioninterface.html#startService">startService</a></b> ( const QString &amp; <i>name</i> )</li>
<li><div class="fn"/>QDBusReply&lt;bool&gt; <b><a href="qdbusconnectioninterface.html#unregisterService">unregisterService</a></b> ( const QString &amp; <i>serviceName</i> )</li>
</ul>
<ul>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h3>Signals</h3>
<ul>
<li><div class="fn"/>void <b><a href="qdbusconnectioninterface.html#callWithCallbackFailed">callWithCallbackFailed</a></b> ( const QDBusError &amp; <i>error</i>, const QDBusMessage &amp; <i>call</i> )</li>
<li><div class="fn"/>void <b><a href="qdbusconnectioninterface.html#serviceOwnerChanged">serviceOwnerChanged</a></b> ( const QString &amp; <i>name</i>, const QString &amp; <i>oldOwner</i>, const QString &amp; <i>newOwner</i> )</li>
<li><div class="fn"/>void <b><a href="qdbusconnectioninterface.html#serviceRegistered">serviceRegistered</a></b> ( const QString &amp; <i>serviceName</i> )</li>
<li><div class="fn"/>void <b><a href="qdbusconnectioninterface.html#serviceUnregistered">serviceUnregistered</a></b> ( const QString &amp; <i>serviceName</i> )</li>
</ul>
<ul>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>11 public functions inherited from <a href="qdbusabstractinterface.html#public-functions">QDBusAbstractInterface</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QDBusConnectionInterface class provides access to the D-Bus bus daemon service.</p>
<p>The D-BUS bus server daemon provides one special interface <tt>org.freedesktop.DBus</tt> that allows clients to access certain properties of the bus, such as the current list of clients connected. The QDBusConnectionInterface class provides access to that interface.</p>
<p>The most common uses of this class are to register and unregister service names on the bus using the <a href="qdbusconnectioninterface.html#registerService">registerService</a>() and <a href="qdbusconnectioninterface.html#unregisterService">unregisterService</a>() functions, query about existing names using the <a href="qdbusconnectioninterface.html#isServiceRegistered">isServiceRegistered</a>(), <a href="qdbusconnectioninterface.html#registeredServiceNames-prop">registeredServiceNames</a>() and <a href="qdbusconnectioninterface.html#serviceOwner">serviceOwner</a>() functions, and to receive notification that a client has registered or de-registered through the <a href="qdbusconnectioninterface.html#serviceRegistered">serviceRegistered</a>(), <a href="qdbusconnectioninterface.html#serviceUnregistered">serviceUnregistered</a>() and <a href="qdbusconnectioninterface.html#serviceOwnerChanged">serviceOwnerChanged</a>() signals.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="RegisterServiceReply-enum"></a>enum QDBusConnectionInterface::RegisterServiceReply</h3>
<p>The possible return values from <a href="qdbusconnectioninterface.html#registerService">registerService</a>():</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::ServiceNotRegistered</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The call failed and the service name was not registered.</td></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::ServiceRegistered</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The caller is now the owner of the service name.</td></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::ServiceQueued</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The caller specified the <a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">QueueService</a> flag and the service was already registered, so we are in queue.</td></tr>
</table></p>
<p>The <a href="qdbusconnectioninterface.html#serviceRegistered">serviceRegistered</a>() signal will be emitted when the service is acquired by this application.</p>
<h3 class="fn"><a name="ServiceQueueOptions-enum"></a>enum QDBusConnectionInterface::ServiceQueueOptions</h3>
<p>Flags for determining how a service registration should behave, in case the service name is already registered.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::DontQueueService</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">If an application requests a name that is already owned, no queueing will be performed. The registeredService() call will simply fail. This is the default.</td></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::QueueService</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Attempts to register the requested service, but do not try to replace it if another application already has it registered. Instead, simply put this application in queue, until it is given up. The <a href="qdbusconnectioninterface.html#serviceRegistered">serviceRegistered</a>() signal will be emitted when that happens.</td></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::ReplaceExistingService</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">If another application already has the service name registered, attempt to replace it.</td></tr>
</table></p>
<p>See also <a href="qdbusconnectioninterface.html#ServiceReplacementOptions-enum">ServiceReplacementOptions</a>.</p>
<h3 class="fn"><a name="ServiceReplacementOptions-enum"></a>enum QDBusConnectionInterface::ServiceReplacementOptions</h3>
<p>Flags for determining if the D-BUS server should allow another application to replace a name that this application has registered with the <a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">ReplaceExistingService</a> option.</p>
<p>The possible values are:</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::DontAllowReplacement</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Do not allow another application to replace us. The service must be explicitly unregistered with <a href="qdbusconnectioninterface.html#unregisterService">unregisterService</a>() for another application to acquire it. This is the default.</td></tr>
<tr><td valign="top"><tt>QDBusConnectionInterface::AllowReplacement</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Allow other applications to replace us with the <a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">ReplaceExistingService</a> option to <a href="qdbusconnectioninterface.html#registerService">registerService</a>() without intervention. If that happens, the <a href="qdbusconnectioninterface.html#serviceUnregistered">serviceUnregistered</a>() signal will be emitted.</td></tr>
</table></p>
<p>See also <a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">ServiceQueueOptions</a>.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="registeredServiceNames-prop"></a>registeredServiceNames : const <a href="qdbusreply.html">QDBusReply</a>&lt;<a href="qstringlist.html">QStringList</a>&gt;</h3>
<p>This property holds holds the registered service names.</p>
<p>Lists all names currently registered on the bus.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>QDBusReply&lt;QStringList&gt; registeredServiceNames () const</b></li>
</ul>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="callWithCallbackFailed"></a>void QDBusConnectionInterface::callWithCallbackFailed ( const <a href="qdbuserror.html">QDBusError</a> &amp; <i>error</i>, const <a href="qdbusmessage.html">QDBusMessage</a> &amp; <i>call</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when there is an error during a <a href="qdbusconnection.html#callWithCallback">QDBusConnection::callWithCallback</a>(). <i>error</i> specifies the error. <i>call</i> is the message that couldn't be delivered.</p>
<p>See also <a href="qdbusconnection.html#callWithCallback">QDBusConnection::callWithCallback</a>().</p>
<h3 class="fn"><a name="isServiceRegistered"></a><a href="qdbusreply.html">QDBusReply</a>&lt;bool&gt; QDBusConnectionInterface::isServiceRegistered ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> ) const&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Returns true if the service name <i>serviceName</i> has is currently registered.</p>
<h3 class="fn"><a name="registerService"></a><a href="qdbusreply.html">QDBusReply</a>&lt;<a href="qdbusconnectioninterface.html#RegisterServiceReply-enum">QDBusConnectionInterface::RegisterServiceReply</a>&gt; QDBusConnectionInterface::registerService ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i>, <a href="qdbusconnectioninterface.html#ServiceQueueOptions-enum">ServiceQueueOptions</a> <i>qoption</i> = DontQueueService, <a href="qdbusconnectioninterface.html#ServiceReplacementOptions-enum">ServiceReplacementOptions</a> <i>roption</i> = DontAllowReplacement )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Requests to register the service name <i>serviceName</i> on the bus. The <i>qoption</i> flag specifies how the D-BUS server should behave if <i>serviceName</i> is already registered. The <i>roption</i> flag specifies if the server should allow another application to replace our registered name.</p>
<p>If the service registration succeeds, the <a href="qdbusconnectioninterface.html#serviceRegistered">serviceRegistered</a>() signal will be emitted. If we are placed in queue, the signal will be emitted when we obtain the name. If <i>roption</i> is <a href="qdbusconnectioninterface.html#ServiceReplacementOptions-enum">AllowReplacement</a>, the <a href="qdbusconnectioninterface.html#serviceUnregistered">serviceUnregistered</a>() signal will be emitted if another application replaces this one.</p>
<p>See also <a href="qdbusconnectioninterface.html#unregisterService">unregisterService</a>().</p>
<h3 class="fn"><a name="serviceOwner"></a><a href="qdbusreply.html">QDBusReply</a>&lt;<a href="qstring.html">QString</a>&gt; QDBusConnectionInterface::serviceOwner ( const <a href="qstring.html">QString</a> &amp; <i>name</i> ) const&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Returns the unique connection name of the primary owner of the name <i>name</i>. If the requested name doesn't have an owner, returns a <tt>org.freedesktop.DBus.Error.NameHasNoOwner</tt> error.</p>
<h3 class="fn"><a name="serviceOwnerChanged"></a>void QDBusConnectionInterface::serviceOwnerChanged ( const <a href="qstring.html">QString</a> &amp; <i>name</i>, const <a href="qstring.html">QString</a> &amp; <i>oldOwner</i>, const <a href="qstring.html">QString</a> &amp; <i>newOwner</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted by the D-BUS server whenever a service ownership change happens in the bus, including apparition and disparition of names.</p>
<p>This signal means the application <i>oldOwner</i> lost ownership of bus name <i>name</i> to application <i>newOwner</i>. If <i>oldOwner</i> is an empty string, it means the name <i>name</i> has just been created; if <i>newOwner</i> is empty, the name <i>name</i> has no current owner and is no longer available.</p>
<h3 class="fn"><a name="servicePid"></a><a href="qdbusreply.html">QDBusReply</a>&lt;<a href="qtglobal.html#uint-typedef">uint</a>&gt; QDBusConnectionInterface::servicePid ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> ) const&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Returns the Unix Process ID (PID) for the process currently holding the bus service <i>serviceName</i>.</p>
<h3 class="fn"><a name="serviceRegistered"></a>void QDBusConnectionInterface::serviceRegistered ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted by the D-BUS server when the bus service name (unique connection name or well-known service name) given by <i>serviceName</i> is acquired by this application.</p>
<p>Acquisition happens after the application requested a name using <a href="qdbusconnectioninterface.html#registerService">registerService</a>().</p>
<h3 class="fn"><a name="serviceUid"></a><a href="qdbusreply.html">QDBusReply</a>&lt;<a href="qtglobal.html#uint-typedef">uint</a>&gt; QDBusConnectionInterface::serviceUid ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> ) const&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Returns the Unix User ID (UID) for the process currently holding the bus service <i>serviceName</i>.</p>
<h3 class="fn"><a name="serviceUnregistered"></a>void QDBusConnectionInterface::serviceUnregistered ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted by the D-BUS server when the application loses ownership of the bus service name given by <i>serviceName</i>.</p>
<h3 class="fn"><a name="startService"></a><a href="qdbusreply.html">QDBusReply</a>&lt;void&gt; QDBusConnectionInterface::startService ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Requests that the bus start the service given by the name <i>name</i>.</p>
<h3 class="fn"><a name="unregisterService"></a><a href="qdbusreply.html">QDBusReply</a>&lt;bool&gt; QDBusConnectionInterface::unregisterService ( const <a href="qstring.html">QString</a> &amp; <i>serviceName</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Releases the claim on the bus service name <i>serviceName</i>, that had been previously registered with <a href="qdbusconnectioninterface.html#registerService">registerService</a>(). 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.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.4</div></td>
</tr></table></div></address></body>
</html>