TpPrototype::Contact Class Reference
[Connection ManagementContact Management]

#include <TelepathyQt4/Prototype/Contact.h>

Collaboration diagram for TpPrototype::Contact:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ContactTypes {
  CT_Subscribed = 0, CT_LocalPending, CT_RemotePending, CT_Removed,
  CT_Known, CT_Blocked
}

Public Member Functions

bool isValid () const
ContactTypes type () const
void setType (ContactTypes type)
uint telepathyHandle () const
uint telepathyHandleType () const
QString name () const
Telepathy::SimplePresence presence ()
uint presenceType () ATTRIBUTE_DEPRECATED
QString presenceStatus () ATTRIBUTE_DEPRECATED
bool isPresenceStateAvailable ()
QString presenceMessage () ATTRIBUTE_DEPRECATED
Telepathy::ContactCapabilityList capabilities () const
TpPrototype::AvatarManager::Avatar avatar () const
TpPrototype::ChatChannelchatChannel ()
TpPrototype::StreamedMediaChannelstreamedMediaChannel ()
TpPrototype::ContactManagercontactManager ()

Protected Member Functions

 Contact (const uint &handle, const QString &name, ContactTypes type, Telepathy::Client::ConnectionInterface *connectionInterface, TpPrototype::ContactManager *contactManager)
 ~Contact ()
void setPresenceType (uint _presenceType)
void setPresenceStatus (QString _presenceStatus)
void setPresenceMessage (QString _presenceMessage)
void setCapabilities (const Telepathy::ContactCapabilityList &capabilityList)
void setAvatar (const TpPrototype::AvatarManager::Avatar &avatar)
Telepathy::Client::ConnectionInterfaceinterface ()

Friends

class ContactManager
class AvatarManager
class PresenceManager
class CapabilitiesManager


Detailed Description

This class handles information related to a contact. Contact objects are always owned by ContactManager. Therefore, there is no way to create or remove a contact without using the ContactManager object.
Other Managers (like PresenceManager, AvatarManager) are accessing the contacts inside of the contact manager to update its information. Whether a contact was updated is signalled by the Managers but the new information is stored in the contact object and can be retrieved from it.

Todo:
Do not provide a function for every presence parameter. Use SimplePresence instead.

Use implicit sharing instead of expolicit sharig!

See also:
CapabilitiesManager, AvatarManager, PresenceManager

Member Enumeration Documentation

Enumerator:
CT_Subscribed 
CT_LocalPending 
CT_RemotePending 
CT_Removed 
CT_Known 
CT_Blocked 


Constructor & Destructor Documentation

Contact::Contact ( const uint &  handle,
const QString &  name,
ContactTypes  type,
Telepathy::Client::ConnectionInterface connectionInterface,
TpPrototype::ContactManager contactManager 
) [protected]

Contstuctor. This object is never created directly. Use ContactManager to create or request a contact.

See also:
ContactManager

Contact::~Contact (  )  [protected]


Member Function Documentation

TpPrototype::AvatarManager::Avatar Contact::avatar (  )  const

Get Avatar for this contact. This function does not return valid information after the avatar was not requested by avatarForContactList()

See also:
AvatarManager

Referenced by TpPrototype::AvatarManager::slotAvatarRetrieved(), and TpPrototype::AvatarManager::slotAvatarUpdated().

Telepathy::ContactCapabilityList Contact::capabilities (  )  const

Todo:
: Add Doc and get/setr in presence manager

Referenced by TpPrototype::CapabilitiesManager::slotCapabilitiesChanged().

ChatChannel * Contact::chatChannel (  ) 

Get chat channel for this contact. This function provides the chat channel object for this contact. It contains all information to do a text chat

Returns:
The channel object.

Referenced by TpPrototype::ContactManager::openTextChannel().

TpPrototype::ContactManager * Contact::contactManager (  ) 

Get the contact manager where this object is stored.

Returns:
The contact manager that owns this object.

Telepathy::Client::ConnectionInterface * Contact::interface (  )  [protected]

D-BUS interface. This protected access to the D-BUS interface can be used to extend this class with special features.

bool Contact::isPresenceStateAvailable (  ) 

Returns whether there is any presence information available. This functionreturns false if there is no valid presence information available.

Returns:
true if valid resence information is available. Otherwise false is returned.

bool Contact::isValid (  )  const

Validity. Do not access any method if this function returns false.

Referenced by TpPrototype::ContactManager::slotMembersChanged().

QString Contact::name (  )  const

Returns the name of the contact.

Returns:
The name of the contact as it is used by protocol (E.g. user@jabber.org).
Todo:
Make this private. We need an encapsulation for PresenceManager::presencesForContacts() first. (ses) THUN: Stefan, this is not possible as this information is required to work with all telepathy classes unknown to this lib.

Referenced by TpPrototype::PresenceManager::slotPresencesChanged().

Telepathy::SimplePresence TpPrototype::Contact::presence (  )  [inline]

Returns the presence information of this contact. This presence information is automatically updated after the presence information was requested for the first time (PresenceManager::presencesForContacts()).
Note: Use isPresenceStateAvailable() to check whether the returned presence is valid!

Todo:
Implement this!
See also:
PresenceManager

QString Contact::presenceMessage (  ) 

Todo:
: Add Doc and get/setr in presence manager
Deprecated:
Use presence() instead.

QString Contact::presenceStatus (  ) 

Todo:
: Add Doc and get/setr in presence manager
Deprecated:
Use presence() instead.

uint Contact::presenceType (  ) 

Todo:
: Add Doc and get/setr in presence manager
Deprecated:
Use presence() instead.

void Contact::setAvatar ( const TpPrototype::AvatarManager::Avatar avatar  )  [protected]

Set the avatar. This avatar is set by the AvatarManager.

Referenced by TpPrototype::AvatarManager::slotAvatarRetrieved().

void Contact::setCapabilities ( const Telepathy::ContactCapabilityList capabilityList  )  [protected]

void Contact::setPresenceMessage ( QString  _presenceMessage  )  [protected]

Todo:
: Add Doc and get/setr in presence manager

Referenced by TpPrototype::PresenceManager::slotPresencesChanged().

void Contact::setPresenceStatus ( QString  _presenceStatus  )  [protected]

Todo:
: Add Doc and get/setr in presence manager

Referenced by TpPrototype::PresenceManager::slotPresencesChanged().

void Contact::setPresenceType ( uint  _presenceType  )  [protected]

Todo:
: Add Doc and get/setr in presence manager

Referenced by TpPrototype::PresenceManager::slotPresencesChanged().

void Contact::setType ( ContactTypes  type  ) 

Set type.

Parameters:
type The new type
See also:
ContactTypes

Referenced by TpPrototype::ContactManager::slotDeniedMembersChanged().

TpPrototype::StreamedMediaChannel * Contact::streamedMediaChannel (  ) 

Get channel for media streaming. This function returns the media streaming object for this contact. It contains all information and functions for VoIP and Video Over IP communication.

Referenced by TpPrototype::ContactManager::openStreamedMediaChannel().

uint Contact::telepathyHandle (  )  const

uint Contact::telepathyHandleType (  )  const

Returns the telepathy internal handle type.

Returns:
The telepathy internal handle type.

References Telepathy::HandleTypeContact.

Contact::ContactTypes Contact::type (  )  const

Returns the contact type.

Returns:
The contact type.

Referenced by TpPrototype::PresenceManager::slotPresencesChanged().


Friends And Related Function Documentation

friend class AvatarManager [friend]

friend class CapabilitiesManager [friend]

friend class ContactManager [friend]

friend class PresenceManager [friend]


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