TpPrototype::Connection Class Reference
[Connection Management]

#include <TelepathyQt4/Prototype/Connection.h>

Collaboration diagram for TpPrototype::Connection:

Collaboration graph
[legend]

List of all members.

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 ()
ContactManagercontactManager ()
PresenceManagerpresenceManager ()
CapabilitiesManagercapabilitiesManager ()
AvatarManageravatarManager ()
Accountaccount () 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::ConnectionInterfaceinterface ()
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


Detailed Description

This class manages a connection. The connection object provides access to optional interfaces that are related to the connection using contactManager(), capabilitiesManager(), presenceManager(), avatarManager().
Todo:
In order to allow custom extensions, we need a support for register proxies in the Account object

Constructor & Destructor Documentation

Connection::~Connection (  ) 

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.

Parameters:
account Account to create connection with.


Member Function Documentation

Account * Connection::account (  )  const

Returns the account for this connection. Every connection belongs to an account that is returned with this call.

Returns:
The account for this connection or NULL if no valid account exists.

Referenced by slotStatusChanged().

AvatarManager * Connection::avatarManager (  ) 

Returns the avatar manager. The avatar manager provides you information about the avatars of the connection.

Note:

  • You have to request a connection with requestConnect() before an avatar manager can be returned.
  • You have to call this function in order to get your contacts updated automatically.
Returns:
Pointer to the avatar manager or NULL if no avatar support is available or no connection was requested.
See also:
requestConnect()

CapabilitiesManager * Connection::capabilitiesManager (  ) 

Returns the capabilities manager. The capabilities manager handles your capabilities state for this connection.

Note:

  • You have to request a connection with requestConnect() before a capability manager can be returned.
  • You have to call this function in order to get your contacts updated automatically.
Returns:
Pointer to the capabilities manager or NULL if no capabilities handling is supported or no connection was requested.
See also:
requestConnect()

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!

Returns:
Pointer to the contact manager or NULL if something went wrong.
See also:
requestConnect()

References Telepathy::ConnectionStatusConnected.

Referenced by slotNewChannel().

template<class Manager >
Manager* TpPrototype::Connection::createManager ( QPointer< Manager > &  pManager,
const QString &  managerName 
) [inline, protected]

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:

  • You have to request a connection with requestConnect() before a presence manager can be returned.
  • You have to call this function in order to get your contacts updated automatically.
Returns:
Pointer to the presence manager or NULL if no presence handling is supported or no connection was requested.
See also:
requestConnect()

Referenced by TpPrototype::Account::currentPresence().

Telepathy::ConnectionStatusReason Connection::reason (  ) 

Reason for last state change.

Returns:
The reason.
See also:
Telepathy::ConnectionStatusReason defined in constants.h

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.

See also:
signalStatusChanged()

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.

Parameters:
handleType The type of handle required.
handlestrings An array of names of entities to request handles for
Returns:
An array of integer handle numbers in the same order as the given strings

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

Parameters:
connection The connection which changes its status.
newStatus The new status that is valid now.
oldStatus The old status that was valid before.
See also:
Telepathy::ConnectionStatus

Referenced by slotStatusChanged().

void Connection::slotNewChannel ( const QDBusObjectPath &  objectPath,
const QString &  channelType,
uint  handleType,
uint  handle,
bool  suppressHandler 
) [protected, slot]

void Connection::slotStatusChanged ( uint  status,
uint  reason 
) [protected, slot]

Telepathy::ConnectionStatus Connection::status (  ) 

Connection Status.

Returns:
The current connection status.
See also:
Telepathy::ConnectionStatus defined in constants.h

Referenced by createManager().


Friends And Related Function Documentation

friend class Account [friend]


Property Documentation

bool TpPrototype::Connection::valid [read]


Generated on Thu Mar 5 18:52:15 2009 for TelepathyQt4-0.1.1 by  doxygen 1.5.8