TelepathyQt4: ConnectionInterfaceSimplePresenceInterface Class Reference

| Home · All Classes · All Namespaces · Modules · Functions · Files

# ConnectionInterfaceSimplePresenceInterface Class Reference
[Connection proxies]

`#include <TelepathyQt4/Connection>`

Inherits Tp::AbstractInterface.

List of all members.

## Public Slots

- QDBusPendingReply SetPresence (const QString &status, const QString &statusMessage)
- QDBusPendingReply
  < Tp::SimpleContactPresences > GetPresences (const Tp::UIntList &contacts)

## Signals

- void PresencesChanged (const Tp::SimpleContactPresences &presence)

## 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::SimpleStatusSpecMap Statuses () const TELEPATHY_GNUC_DEPRECATED

## Static Public Member Functions

- static const char * staticInterfaceName ()

## Protected Member Functions

- virtual void invalidate (Tp::DBusProxy *, const QString &, const QString &)

## Properties

- Tp::SimpleStatusSpecMap Statuses

## Detailed Description

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

## Constructor & Destructor Documentation

ConnectionInterfaceSimplePresenceInterface | ( | const QString & | busName,
|  | const QString & | objectPath,
|  | QObject * | parent = `0` |
| ) |  |  |

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

Parameters:

  | busName | Name of the service the object is on.
  | objectPath | Path to the object on the service.
  | parent | Passed to the parent class constructor.

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:

  | connection | The bus via which the object can be reached.
  | busName | Name of the service the object is on.
  | objectPath | Path to the object on the service.
  | parent | Passed to the parent class constructor.

ConnectionInterfaceSimplePresenceInterface | ( | Tp::DBusProxy * | proxy | ) |

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

Parameters:

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

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:

  | mainInterface | The proxy to use.

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:

  | mainInterface | The proxy to use.
  | parent | Passed to the parent class constructor.

## Member Function Documentation

static const char* staticInterfaceName | ( |  | ) | `[inline, static]`

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

Returns:
  The D-Bus interface name.

Tp::SimpleStatusSpecMap Statuses | ( |  | ) | const`[inline]`

Getter for the remote object property "Statuses".

Don't use this: it blocks the main loop.

Returns:
  The value of the property, or a default-constructed value if the property is not readable.

QDBusPendingReply SetPresence | ( | const QString & | status,
|  | const QString & | statusMessage |
| ) |  |  | `[inline, slot]`

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 <tp:member-ref>PresencesChanged</tp:member-ref> 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 <tp:member-ref>Statuses</tp:member-ref> 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.

Parameters:

  | status |

The string identifier of the desired status. Possible status identifiers are defined in the <tp:member-ref>Statuses</tp:member-ref> property.

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.

<tp:rationale>

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.

If the user requests "Busy" 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. </tp:rationale>

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.

<tp:rationale>

To go offline, call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">Disconnect</tp:dbus-ref> instead. The "error" and "unknown" statuses make no sense. </tp:rationale>

Parameters:

  | statusMessage | The status message associated with the current status.

QDBusPendingReply<Tp::SimpleContactPresences> GetPresences | ( | const Tp::UIntList & | contacts | ) | `[inline, slot]`

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.

Parameters:

  | contacts | An array of the contacts whose presence should be obtained.

Returns:

Presence information in the same format as for the <tp:member-ref>PresencesChanged</tp:member-ref> signal. The returned mapping MUST include an entry for each contact in the method's argument.

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.

void 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.

virtual void invalidate | ( | Tp::DBusProxy * | ,
|  | const QString & | ,
|  | const QString & |  |
| ) |  |  | `[protected, virtual]`

## Property Documentation

Tp::SimpleStatusSpecMap Statuses`[read]`

Represents property "Statuses" on the remote object.

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.

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