Home · Modules · All Classes · All Namespaces
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Tp::Client::ConnectionInterfaceSimplePresenceInterface Class Reference

#include <TelepathyQt/Connection>

Inheritance diagram for Tp::Client::ConnectionInterfaceSimplePresenceInterface:
Inheritance graph
[legend]

Public Slots

QDBusPendingReply SetPresence (const QString &status, const QString &statusMessage, int timeout=-1)
 
QDBusPendingReply< Tp::SimpleContactPresencesGetPresences (const Tp::UIntList &contacts, int timeout=-1)
 

Signals

void PresencesChanged (const Tp::SimpleContactPresences &presence)
 
- Signals inherited from Tp::AbstractInterface
void propertiesChanged (const QVariantMap &changedProperties, const QStringList &invalidatedProperties)
 

Public Member Functions

 ConnectionInterfaceSimplePresenceInterface (const QString &busName, const QString &objectPath, QObject *parent=0)
 
 ConnectionInterfaceSimplePresenceInterface (const QDBusConnection &connection, const QString &busName, const QString &objectPath, QObject *parent=0)
 
 ConnectionInterfaceSimplePresenceInterface (Tp::DBusProxy *proxy)
 
 ConnectionInterfaceSimplePresenceInterface (const Tp::Client::ConnectionInterface &mainInterface)
 
 ConnectionInterfaceSimplePresenceInterface (const Tp::Client::ConnectionInterface &mainInterface, QObject *parent)
 
Tp::PendingVariantrequestPropertyStatuses () const
 
Tp::PendingVariantrequestPropertyMaximumStatusMessageLength () const
 
Tp::PendingVariantMaprequestAllProperties () const
 
- Public Member Functions inherited from Tp::AbstractInterface
virtual ~AbstractInterface ()
 
bool isValid () const
 
QString invalidationReason () const
 
QString invalidationMessage () const
 
void setMonitorProperties (bool monitorProperties)
 
bool isMonitoringProperties () const
 

Static Public Member Functions

static QLatin1String staticInterfaceName ()
 

Protected Member Functions

virtual void invalidate (Tp::DBusProxy *, const QString &, const QString &)
 
- Protected Member Functions inherited from Tp::AbstractInterface
 AbstractInterface (DBusProxy *proxy, const QLatin1String &interface)
 
 AbstractInterface (const QString &busName, const QString &path, const QLatin1String &interface, const QDBusConnection &connection, QObject *parent)
 
PendingVariantinternalRequestProperty (const QString &name) const
 
PendingOperationinternalSetProperty (const QString &name, const QVariant &newValue)
 
PendingVariantMapinternalRequestAllProperties () const
 

Additional Inherited Members

- Protected Slots inherited from Tp::AbstractInterface

Detailed Description

Proxy class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.Connection.Interface.SimplePresence".

Constructor & Destructor Documentation

◆ ConnectionInterfaceSimplePresenceInterface() [1/5]

Tp::Client::ConnectionInterfaceSimplePresenceInterface::ConnectionInterfaceSimplePresenceInterface ( const QString &  busName,
const QString &  objectPath,
QObject *  parent = 0 
)

Creates a ConnectionInterfaceSimplePresenceInterface associated with the given object on the session bus.

Parameters
busNameName of the service the object is on.
objectPathPath to the object on the service.
parentPassed to the parent class constructor.

◆ ConnectionInterfaceSimplePresenceInterface() [2/5]

Tp::Client::ConnectionInterfaceSimplePresenceInterface::ConnectionInterfaceSimplePresenceInterface ( const QDBusConnection &  connection,
const QString &  busName,
const QString &  objectPath,
QObject *  parent = 0 
)

Creates a ConnectionInterfaceSimplePresenceInterface associated with the given object on the given bus.

Parameters
connectionThe bus via which the object can be reached.
busNameName of the service the object is on.
objectPathPath to the object on the service.
parentPassed to the parent class constructor.

◆ ConnectionInterfaceSimplePresenceInterface() [3/5]

Tp::Client::ConnectionInterfaceSimplePresenceInterface::ConnectionInterfaceSimplePresenceInterface ( Tp::DBusProxy proxy)

Creates a ConnectionInterfaceSimplePresenceInterface associated with the same object as the given proxy.

Parameters
proxyThe proxy to use. It will also be the QObject::parent() for this object.

◆ ConnectionInterfaceSimplePresenceInterface() [4/5]

Tp::Client::ConnectionInterfaceSimplePresenceInterface::ConnectionInterfaceSimplePresenceInterface ( const Tp::Client::ConnectionInterface mainInterface)
explicit

Creates a ConnectionInterfaceSimplePresenceInterface associated with the same object as the given proxy. Additionally, the created proxy will have the same parent as the given proxy.

Parameters
mainInterfaceThe proxy to use.

◆ ConnectionInterfaceSimplePresenceInterface() [5/5]

Tp::Client::ConnectionInterfaceSimplePresenceInterface::ConnectionInterfaceSimplePresenceInterface ( const Tp::Client::ConnectionInterface mainInterface,
QObject *  parent 
)

Creates a ConnectionInterfaceSimplePresenceInterface associated with the same object as the given proxy. However, a different parent object can be specified.

Parameters
mainInterfaceThe proxy to use.
parentPassed to the parent class constructor.

Member Function Documentation

◆ staticInterfaceName()

static QLatin1String Tp::Client::ConnectionInterfaceSimplePresenceInterface::staticInterfaceName ( )
inlinestatic

Returns the name of the interface "org.freedesktop.Telepathy.Connection.Interface.SimplePresence", which this class represents.

Returns
The D-Bus interface name.

◆ requestPropertyStatuses()

Tp::PendingVariant* Tp::Client::ConnectionInterfaceSimplePresenceInterface::requestPropertyStatuses ( ) const
inline

Asynchronous getter for the remote object property Statuses of type Tp::SimpleStatusSpecMap.

A dictionary where the keys are the presence statuses that are available on this connection, and the values are the corresponding presence types.

While the connection is in the DISCONNECTED state, it contains the set of presence statuses allowed to be set before connecting. The connection manager will attempt to set the appropriate status when the connection becomes connected, but cannot necessarily guarantee it. The available statuses cannot change until the connection status changes, so there is no change notification.

While the connection is in the CONNECTED state, this property contains the set of presence statuses which are actually available on this protocol. This set is constant for the remaining lifetime of the connection, so again, there is no change notification.

While the connection is in the CONNECTING state, the value of this property is undefined and SHOULD NOT be used. It can change at any time without notification (in particular, any cached values from when the connection was in the DISCONNECTED or CONNECTING state MUST NOT be assumed to still be correct when the state has become CONNECTED).

This property MUST include the special statuses "unknown" and "error" if and only if the connection manager can emit them as a contact's status.

For instance, connection managers for local-xmpp (XEP-0174) would omit "unknown" since there is no such concept.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestPropertyMaximumStatusMessageLength()

Tp::PendingVariant* Tp::Client::ConnectionInterfaceSimplePresenceInterface::requestPropertyMaximumStatusMessageLength ( ) const
inline

Asynchronous getter for the remote object property MaximumStatusMessageLength of type uint.

The maximum length in characters for any individual status message, or 0 if there is no limit.

While the connection is in the DISCONNECTED state, this property will be 0. The connection manager will attempt to set the appropriate value when the connection becomes connected, but cannot necessarily guarantee it. The maximum length cannot change until the connection status changes, so there is no change notification.

While the connection is in the CONNECTED state, this property contains the maximum length in characters for any individual status message which is actually allowed on this protocol. This value is constant for the remaining lifetime of the connection, so again, there is no change notification.

While the connection is in the CONNECTING state, the value of this property is undefined and SHOULD NOT be used. It can change at any time without notification (in particular, any cached values from when the connection was in the DISCONNECTED or CONNECTING state MUST NOT be assumed to still be correct when the state has become CONNECTED).

If a message passed to SetPresence() is longer than allowed by this property, the connection manager MUST truncate the supplied message; when emitting PresencesChanged() , the truncated version of the message MUST be used.

Some XMPP servers, like Google Talk, define a maximum length for status messages. Whether the user's server is one of these cannot be detected until quite late in the connection process.

Returns
A pending variant which will emit finished when the property has been retrieved.

◆ requestAllProperties()

Tp::PendingVariantMap* Tp::Client::ConnectionInterfaceSimplePresenceInterface::requestAllProperties ( ) const
inline

Request all of the DBus properties on the interface.

Returns
A pending variant map which will emit finished when the properties have been retrieved.

◆ SetPresence

QDBusPendingReply Tp::Client::ConnectionInterfaceSimplePresenceInterface::SetPresence ( const QString &  status,
const QString &  statusMessage,
int  timeout = -1 
)
inlineslot

Begins a call to the D-Bus method SetPresence on the remote object.

Request that the presence status and status message are published for the connection. Changes will be indicated by PresencesChanged() signals being emitted.

This method may be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the selected status.

In DISCONNECTED state the Statuses property will indicate which statuses are allowed to be set while DISCONNECTED (none, if the Connection Manager doesn't allow this). This value MUST NOT be cached, as the set of allowed presences might change upon connecting.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
status
\htmlonly
<p>The string identifier of the desired status. Possible status
  identifiers are defined in the
   \endhtmlonly \link requestPropertyStatuses() Statuses \endlink \htmlonly  property.</p>

<p>Clients MUST NOT set a status whose string value they do not
  recognise, even if its presence type in Statuses
  matches what the user requested.</p>

<div class="rationale">
  <p>Suppose a protocol has statuses that include 'phone' (of type
    BUSY) and 'in-a-meeting' (of type BUSY), but there is no
    generic 'busy' status.</p>

  <p>If the user requests &quot;Busy&quot; status from a menu, a
    client author might be tempted to pick an arbitrary status
    that has type BUSY. However, on this protocol, neither of
    the choices would be appropriate, and incorrect information
    about the user would be conveyed.</p>
</div>

<p>Statuses whose <tp:type>Connection_Presence_Type</tp:type>
  is Offline, Error or Unknown MUST NOT be passed to this
  function. Connection managers SHOULD reject these statuses.</p>

<div class="rationale">
  <p>To go offline, call  \endhtmlonly ConnectionInterface::Disconnect() \htmlonly 
  instead. The &quot;error&quot; and &quot;unknown&quot; statuses make no sense.</p>
</div>
\endhtmlonly
statusMessage
The status message associated with the current status.
timeoutThe timeout in milliseconds.

◆ GetPresences

QDBusPendingReply<Tp::SimpleContactPresences> Tp::Client::ConnectionInterfaceSimplePresenceInterface::GetPresences ( const Tp::UIntList contacts,
int  timeout = -1 
)
inlineslot

Begins a call to the D-Bus method GetPresences on the remote object.

Get presence previously emitted by PresencesChanged for the given contacts. Data is returned in the same structure as the PresencesChanged signal; no additional network requests are made.

Note that timeout is ignored as of now. It will be used once http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed.

Parameters
contacts
An array of the contacts whose presence should be obtained.
timeoutThe timeout in milliseconds.
Returns
\htmlonly
<p>Presence information in the same format as for the
   \endhtmlonly PresencesChanged() \htmlonly  signal.
  The returned mapping MUST include an entry for each contact
  in the method's argument.</p>

<p>The definition of the connection presence types Unknown
  and Offline means that if a connection manager will return
  Unknown for contacts not on the subscribe list, it MUST delay
  the reply to this method call until it has found out which
  contacts are, in fact, on the subscribe list.</p>
\endhtmlonly

◆ PresencesChanged

void Tp::Client::ConnectionInterfaceSimplePresenceInterface::PresencesChanged ( const Tp::SimpleContactPresences presence)
signal

Represents the signal PresencesChanged on the remote object.

This signal should be emitted when your own presence has been changed, or the presence of the member of any of the connection's channels has been changed.

Parameters
presence
A dictionary of contact handles mapped to the status, presence type 
and status message.

◆ invalidate()

void Tp::Client::ConnectionInterfaceSimplePresenceInterface::invalidate ( Tp::DBusProxy proxy,
const QString &  error,
const QString &  message 
)
protectedvirtual

Reimplemented from Tp::AbstractInterface.