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

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions
Tp::Client::ConnectionInterfaceSimplePresenceInterface Class Reference
Connection proxies

`#include <TelepathyQt/Connection>`

Inherits Tp::AbstractInterface.

List of all members.

## Public Slots

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

## 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::PendingVariant * requestPropertyStatuses () const
- Tp::PendingVariant * requestPropertyMaximumStatusMessageLength () const
- Tp::PendingVariantMap * requestAllProperties () const

## Static Public Member Functions

- static QLatin1String staticInterfaceName ()

## Protected Member Functions

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

## Detailed Description

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

## Constructor & Destructor Documentation

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:

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

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:

  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.

Tp::Client::ConnectionInterfaceSimplePresenceInterface::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.

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:

  mainInterface | The proxy to use.

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:

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

## Member Function Documentation

static QLatin1String Tp::Client::ConnectionInterfaceSimplePresenceInterface::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::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.

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.

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.

QDBusPendingReply Tp::Client::ConnectionInterfaceSimplePresenceInterface::SetPresence | ( | const QString & | status,
|  | const QString & | statusMessage,
|  | int | timeout = `-1`
| ) |  | `[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 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 | The string identifier of the desired status. Possible status identifiers are defined in the Statuses 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. 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. Statuses whose Connection_Presence_Type is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses. To go offline, call ConnectionInterface::Disconnect() instead. The "error" and "unknown" statuses make no sense.
  statusMessage | The status message associated with the current status.
  timeout | The timeout in milliseconds.

QDBusPendingReply<Tp::SimpleContactPresences> Tp::Client::ConnectionInterfaceSimplePresenceInterface::GetPresences | ( | const Tp::UIntList & | contacts,
|  | int | timeout = `-1`
| ) |  | `[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.

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.
  timeout | The timeout in milliseconds.

Returns:

Presence information in the same format as for the PresencesChanged() 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 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.

void Tp::Client::ConnectionInterfaceSimplePresenceInterface::invalidate | ( | Tp::DBusProxy * | proxy,
|  | const QString & | error,
|  | const QString & | message
| ) |  | `[protected, virtual]`

Reimplemented from Tp::AbstractInterface.