#include <TelepathyQt4/Prototype/PresenceManager.h>
Signals | |
void | signalRemotePresencesUpdated (TpPrototype::Contact *contact, const Telepathy::SimplePresence &presence) |
void | signalOwnPresenceUpdated (const TpPrototype::Account *account, const Telepathy::SimplePresence &presence) |
Public Member Functions | |
bool | isValid () |
Telepathy::SimpleStatusSpecMap | statuses () |
bool | setPresence (const QString &status, const QString &statusMessage) |
Telepathy::SimplePresence | currentPresence () |
Telepathy::SimpleContactPresences | presencesForContacts (const QList< QPointer< TpPrototype::Contact > > &contacts) |
TpPrototype::Connection * | connection () |
Protected Slots | |
void | slotPresencesChanged (const Telepathy::SimpleContactPresences &presences) |
void | slotPresencesUpdate (const Telepathy::ContactPresences &presences) |
Protected Member Functions | |
PresenceManager (TpPrototype::Connection *connection, Telepathy::Client::ConnectionInterface *interface, QObject *parent=NULL) | |
~PresenceManager () | |
Friends | |
class | Connection |
class | ConnectionPrivate |
PresenceManager::PresenceManager | ( | TpPrototype::Connection * | connection, | |
Telepathy::Client::ConnectionInterface * | interface, | |||
QObject * | parent = NULL | |||
) | [protected] |
Constructor. The presence manager cannot be instantiated directly. Use Connection::presenceManager() for it!
PresenceManager::~PresenceManager | ( | ) | [protected] |
TpPrototype::Connection * PresenceManager::connection | ( | ) |
Returns the connection that belongs to this presence information.
Telepathy::SimplePresence PresenceManager::currentPresence | ( | ) |
Gets local presence. The local presence is returned for the connection.
Referenced by TpPrototype::Account::currentPresence().
bool PresenceManager::isValid | ( | ) |
Validity. Do not access any methods if the object is invalid!
Telepathy::SimpleContactPresences TpPrototype::PresenceManager::presencesForContacts | ( | const QList< QPointer< TpPrototype::Contact > > & | contacts | ) |
Request presences. Requests a list of presences for the given list of contacts.
contacts | List of contacts. |
Future: Telepathy::SimpleContactPresences relies of an handle (the int). This should be encapsulated.
bool PresenceManager::setPresence | ( | const QString & | status, | |
const QString & | statusMessage | |||
) |
Set Presence. Request that the presence status and status message are published for the connection. Changes will be indicated by signal signalOwnPresenceUpdated().
status | The state to set the presence to as returned by statuses(). |
References signalOwnPresenceUpdated().
void TpPrototype::PresenceManager::signalOwnPresenceUpdated | ( | const TpPrototype::Account * | account, | |
const Telepathy::SimplePresence & | presence | |||
) | [signal] |
Local presence changed. This signal is emitted when the local presence state was changed.
account | The account that changes. | |
presence | The presence information. |
Referenced by setPresence(), and slotPresencesChanged().
void TpPrototype::PresenceManager::signalRemotePresencesUpdated | ( | TpPrototype::Contact * | contact, | |
const Telepathy::SimplePresence & | presence | |||
) | [signal] |
Presences of remote contacts are changed. This signal is emitted when the presence state of a remote contact is changed.
contact | The contact that changes. | |
presence | The presence information. |
Referenced by slotPresencesChanged().
void PresenceManager::slotPresencesChanged | ( | const Telepathy::SimpleContactPresences & | presences | ) | [protected, slot] |
References TpPrototype::Contact::name(), TpPrototype::Contact::setPresenceMessage(), TpPrototype::Contact::setPresenceStatus(), TpPrototype::Contact::setPresenceType(), signalOwnPresenceUpdated(), signalRemotePresencesUpdated(), Telepathy::SimplePresence::status, Telepathy::SimplePresence::statusMessage, TpPrototype::Contact::telepathyHandle(), TpPrototype::Contact::type(), and Telepathy::SimplePresence::type.
Referenced by slotPresencesUpdate().
void PresenceManager::slotPresencesUpdate | ( | const Telepathy::ContactPresences & | presences | ) | [protected, slot] |
References slotPresencesChanged(), and statuses().
Telepathy::SimpleStatusSpecMap PresenceManager::statuses | ( | ) |
Supported statuses. Returns the list of supported status states. The list may change if the status of the connection changes from disconnected to connected.
Referenced by slotPresencesUpdate().
friend class Connection [friend] |
friend class ConnectionPrivate [friend] |