#include <TelepathyQt4/Prototype/Connection.h>
Signals | |
void | signalStatusChanged (TpPrototype::Connection *connection, Telepathy::ConnectionStatus newStatus, Telepathy::ConnectionStatus oldStatus) |
Public Member Functions | |
~Connection () | |
bool | isValid () |
Telepathy::ConnectionStatus | status () |
Telepathy::ConnectionStatusReason | reason () |
bool | requestConnect () |
bool | requestDisconnect () |
ContactManager * | contactManager () |
PresenceManager * | presenceManager () |
CapabilitiesManager * | capabilitiesManager () |
AvatarManager * | avatarManager () |
Account * | account () const |
Protected Slots | |
void | slotStatusChanged (uint status, uint reason) |
void | slotNewChannel (const QDBusObjectPath &objectPath, const QString &channelType, uint handleType, uint handle, bool suppressHandler) |
Protected Member Functions | |
Connection (TpPrototype::Account *account, QObject *parent) | |
QString | handle () const |
Telepathy::Client::ConnectionInterface * | interface () |
QList< uint > | RequestHandles (Telepathy::HandleType handletype, QStringList &handlestrings) |
bool | managerSupported (const QString &managerName) |
template<class Manager > | |
Manager * | createManager (QPointer< Manager > &pManager, const QString &managerName) |
Properties | |
bool | valid |
Friends | |
class | Account |
Connection::~Connection | ( | ) |
References Telepathy::ConnectionStatusDisconnected, and requestDisconnect().
TpPrototype::Connection::Connection | ( | TpPrototype::Account * | account, | |
QObject * | parent | |||
) | [protected] |
Constructor. The connection cannot be instantiated directly. Use Account::connection() to receive a valid connection object.
account | Account to create connection with. |
Account * Connection::account | ( | ) | const |
Returns the account for this connection. Every connection belongs to an account that is returned with this call.
Referenced by slotStatusChanged().
AvatarManager * Connection::avatarManager | ( | ) |
Returns the avatar manager. The avatar manager provides you information about the avatars of the connection.
Note:
CapabilitiesManager * Connection::capabilitiesManager | ( | ) |
Returns the capabilities manager. The capabilities manager handles your capabilities state for this connection.
Note:
ContactManager * Connection::contactManager | ( | ) |
Returns the contact list manager. The contact list manager contains the list of contacts and provides functions like add and remove.
Note: You have to request a connection with requestConnect() before a contact manager can be returned. If the connection disconnects the ContactManager will be invalid!
References Telepathy::ConnectionStatusConnected.
Referenced by slotNewChannel().
Manager* TpPrototype::Connection::createManager | ( | QPointer< Manager > & | pManager, | |
const QString & | managerName | |||
) | [inline, protected] |
References Telepathy::ConnectionStatusConnected, interface(), and status().
QString Connection::handle | ( | ) | const [protected] |
Returns the handle. The handle is an internal representation to access the real data. Its format should not be interpreted.
Telepathy::Client::ConnectionInterface * Connection::interface | ( | ) | [protected] |
D-BUS interface. This protected access to the D-BUS interface can be used to extend this class with special features.
Referenced by createManager(), and managerSupported().
bool Connection::isValid | ( | ) |
Validity check. Do not access any functions if this account is invalid.
Referenced by requestDisconnect().
bool Connection::managerSupported | ( | const QString & | managerName | ) | [protected] |
Check if manager is supported.
References Telepathy::Client::ConnectionInterface::GetInterfaces(), and interface().
PresenceManager * Connection::presenceManager | ( | ) |
Returns the presence manager. The presence manager handles your presence state for this connection.
Note:
Referenced by TpPrototype::Account::currentPresence().
Telepathy::ConnectionStatusReason Connection::reason | ( | ) |
Reason for last state change.
bool Connection::requestConnect | ( | ) |
Connect to server. This call is asynchrous. Wait until signalStatusChanged() was emitted and the connection state is Telepathy::ConnectionStatusConnected before calling contactManager() or presenceManager() will succeed.
References Telepathy::ConnectionStatusConnected, Telepathy::ConnectionStatusConnecting, and Telepathy::ConnectionStatusDisconnected.
bool Connection::requestDisconnect | ( | ) |
Disconnect. Disconnects from the server.
References Telepathy::ConnectionStatusDisconnected, and isValid().
Referenced by ~Connection().
QList< uint > Connection::RequestHandles | ( | Telepathy::HandleType | handletype, | |
QStringList & | handlestrings | |||
) | [protected] |
Provides a generic handle.
handleType | The type of handle required. | |
handlestrings | An array of names of entities to request handles for |
References TpPrototype::registerTypes().
void TpPrototype::Connection::signalStatusChanged | ( | TpPrototype::Connection * | connection, | |
Telepathy::ConnectionStatus | newStatus, | |||
Telepathy::ConnectionStatus | oldStatus | |||
) | [signal] |
Connection status changed. This signal is emitted if the status of the connection was changed
connection | The connection which changes its status. | |
newStatus | The new status that is valid now. | |
oldStatus | The old status that was valid before. |
Referenced by slotStatusChanged().
void Connection::slotNewChannel | ( | const QDBusObjectPath & | objectPath, | |
const QString & | channelType, | |||
uint | handleType, | |||
uint | handle, | |||
bool | suppressHandler | |||
) | [protected, slot] |
References contactManager(), Telepathy::HandleTypeContact, TpPrototype::ContactManager::openDenyContactsChannel(), TpPrototype::ContactManager::openKnownContactsChannel(), TpPrototype::ContactManager::openPublishContactsChannel(), TpPrototype::ContactManager::openStreamedMediaChannel(), TpPrototype::ContactManager::openSubscribedContactsChannel(), and TpPrototype::ContactManager::openTextChannel().
void Connection::slotStatusChanged | ( | uint | status, | |
uint | reason | |||
) | [protected, slot] |
References account(), TpPrototype::Account::setParameters(), and signalStatusChanged().
Telepathy::ConnectionStatus Connection::status | ( | ) |
Connection Status.
Referenced by createManager().
friend class Account [friend] |
bool TpPrototype::Connection::valid [read] |