TpPrototype::ContactManager Class Reference
[Connection ManagementContact Management]

#include <TelepathyQt4/Prototype/ContactManager.h>

Collaboration diagram for TpPrototype::ContactManager:

Collaboration graph
[legend]

List of all members.

Signals

void signalTextChannelOpenedForContact (TpPrototype::Contact *contact)
void signalStreamedMediaChannelOpenedForContact (TpPrototype::Contact *contact)
void signalContactAdded (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactLocalPending (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactRemotePending (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactSubscribed (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalAboutToRemoveContact (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactRemoved (TpPrototype::ContactManager *contactManager)
void signalContactKnown (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactBlocked (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalContactUnblocked (TpPrototype::ContactManager *contactManager, TpPrototype::Contact *contact)
void signalMembersChanged (TpPrototype::ContactManager *contactManager, const QString &message, QList< QPointer< TpPrototype::Contact > > members, QList< QPointer< TpPrototype::Contact > > localPending, QList< QPointer< TpPrototype::Contact > > remotePending, TpPrototype::Contact *actor, Telepathy::ChannelGroupChangeReason reason)

Public Member Functions

bool isValid ()
int count ()
QList< QPointer
< TpPrototype::Contact > > 
contactList ()
QList< QPointer
< TpPrototype::Contact > > 
toAuthorizeList ()
QList< QPointer
< TpPrototype::Contact > > 
remoteAuthorizationPendingList ()
QList< QPointer
< TpPrototype::Contact > > 
blockedContacts ()
bool requestContact (const QString &id)
bool authorizeContact (const Contact *contact)
bool removeContact (const TpPrototype::Contact *contactToRemove)
bool blockContact (const Contact *contactToBlock)
bool unblockContact (const Contact *contactToUnblock)
QPointer< TpPrototype::ContactcontactForHandle (uint handle)
uint localHandle ()

Protected Slots

void slotMembersChanged (const QString &message, const Telepathy::UIntList &members_added, const Telepathy::UIntList &members_removed, const Telepathy::UIntList &local_pending, const Telepathy::UIntList &remote_pending, uint actor, uint reason)
void slotKnownMembersChanged (const QString &message, const Telepathy::UIntList &members_added, const Telepathy::UIntList &members_removed, const Telepathy::UIntList &local_pending, const Telepathy::UIntList &remote_pending, uint actor, uint reason)
void slotPublishedMembersChanged (const QString &message, const Telepathy::UIntList &members_added, const Telepathy::UIntList &members_removed, const Telepathy::UIntList &local_pending, const Telepathy::UIntList &remote_pending, uint actor, uint reason)
void slotSubscribedMembersChanged (const QString &message, const Telepathy::UIntList &members_added, const Telepathy::UIntList &members_removed, const Telepathy::UIntList &local_pending, const Telepathy::UIntList &remote_pending, uint actor, uint reason)
void slotDeniedMembersChanged (const QString &message, const Telepathy::UIntList &members_added, const Telepathy::UIntList &members_removed, const Telepathy::UIntList &local_pending, const Telepathy::UIntList &remote_pending, uint actor, uint reason)

Protected Member Functions

 ContactManager (Telepathy::Client::ConnectionInterface *connection, QObject *parent=NULL)
 ~ContactManager ()
void openSubscribedContactsChannel (uint handle, const QDBusObjectPath &objectPath, const QString &channelType)
void openPublishContactsChannel (uint handle, const QDBusObjectPath &objectPath, const QString &channelType)
void openKnownContactsChannel (uint handle, const QDBusObjectPath &objectPath, const QString &channelType)
void openDenyContactsChannel (uint handle, const QDBusObjectPath &objectPath, const QString &channelType)
void openTextChannel (uint handle, uint handleType, const QString &channelPath, const QString &channelType)
void openStreamedMediaChannel (uint handle, uint handleType, const QString &channelPath, const QString &channelType)

Friends

class Connection
class ConnectionPrivate
class Contact


Detailed Description

This class manages all contacts. This class provides the list of contacts associated with an account. It is possible to register new contacts by requestContact(), or remove contacts by removeContact(). Signals providing information whether any contact changes or wether a communication channel is opened.
Todo:
We need a ContactGroup that contains the Contacts instead use QList< QPointer<> >. If a contact is removed we get a NULL element in the list instead to remove one element from the list (seil)

Constructor & Destructor Documentation

ContactManager::ContactManager ( Telepathy::Client::ConnectionInterface connection,
QObject *  parent = NULL 
) [protected]

Constructor. The contact manager cannot be instantiated directly. Use Connection::contactManager() for it!

ContactManager::~ContactManager (  )  [protected]


Member Function Documentation

bool ContactManager::authorizeContact ( const Contact contact  ) 

Authorize contact. A remote contact should be authorized.

Parameters:
contact The contact to autorize.
Returns:
true if ...

References TpPrototype::Contact::telepathyHandle().

bool ContactManager::blockContact ( const Contact contactToBlock  ) 

Block a contact. The contact is moved to the list of blocked contacts. This may not be supported by the protocol/contact manager. In this case false is returned. A blocked contact will not receive any presence information from the local account. Messages from this contact are ignored. The signal signalContactBlocked() is emitted if this call was successful.
Hint:Blocking support is currently available with the connection manager Gabble and GoogleTalk.

Returns:
true if blocking is supported.

References TpPrototype::Contact::telepathyHandle().

QList< QPointer< Contact > > ContactManager::blockedContacts (  ) 

List of contacts that are blocked.

Todo:
: Return ContactGroup here, instead of a list of pointer.

QPointer< TpPrototype::Contact > ContactManager::contactForHandle ( uint  handle  ) 

Returns a contact pointer for handle id. This function provides a fast lookup of a contact if a valid handle is provided.

Returns:
The contact that corresponds to the handle or NULL if the handle is unknown.

Referenced by slotMembersChanged().

QList< QPointer< Contact > > ContactManager::contactList (  ) 

List of contacts. The contact pointer is stored in a QPointer. If the contact is removed it is deleted by the contact manager. Thus, the pointer is set to 0.

Todo:
: Return ContactGroup here, instead a list of a pointer.

int ContactManager::count (  ) 

Number of Contacts. Returns how many contacts are available.

Returns:
Number of contacts available.

bool ContactManager::isValid (  ) 

Validity of this class. Do not access any methods if this object is invalid.

uint ContactManager::localHandle (  ) 

The local handle. The local user has a handle that is returned by this function. The local handle cannot be used to get a valid contact with contactForHandle()!

References TpPrototype::ConnectionFacade::instance(), and TpPrototype::ConnectionFacade::selfHandleForConnectionInterface().

void ContactManager::openDenyContactsChannel ( uint  handle,
const QDBusObjectPath &  objectPath,
const QString &  channelType 
) [protected]

void ContactManager::openKnownContactsChannel ( uint  handle,
const QDBusObjectPath &  objectPath,
const QString &  channelType 
) [protected]

void ContactManager::openPublishContactsChannel ( uint  handle,
const QDBusObjectPath &  objectPath,
const QString &  channelType 
) [protected]

void ContactManager::openStreamedMediaChannel ( uint  handle,
uint  handleType,
const QString &  channelPath,
const QString &  channelType 
) [protected]

void ContactManager::openSubscribedContactsChannel ( uint  handle,
const QDBusObjectPath &  objectPath,
const QString &  channelType 
) [protected]

void ContactManager::openTextChannel ( uint  handle,
uint  handleType,
const QString &  channelPath,
const QString &  channelType 
) [protected]

QList< QPointer< Contact > > ContactManager::remoteAuthorizationPendingList (  ) 

List of contacts we asked to authorize us to see their presence state.

The contact pointer is stored in a QPointer. If the contact is removed it is deleted by the contact manager. Thus, the pointer is set to 0.

Todo:
: Return ContactGroup here, instead of a list of pointer.

bool ContactManager::removeContact ( const TpPrototype::Contact contactToRemove  ) 

Remove a contact. The contact should be removed.

Parameters:
contactToRemove The contact that should be removed. Do not use this pointer after this call!

References TpPrototype::Contact::telepathyHandle().

bool ContactManager::requestContact ( const QString &  id  ) 

Request a contact. A remote contact should be added to the list of known contacts.

Parameters:
id The id identifies the contact (protocol specific)
Returns:
true if the handle was found else false.

References Telepathy::HandleTypeContact.

void TpPrototype::ContactManager::signalAboutToRemoveContact ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

A Contact will be removed. This signal is emitted after the contact was removed but immediately before the account is removed from the internal lists.
Use this signal to obtain all necessary information to handle this remove operation properly. The signal signalContactRemoved() will be called immediately after cleaning the internal lists.

Parameters:
contact The removed contact. This object is deleted after this call!
See also:
signalContactRemoved()

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactAdded ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

A Contact was added. A new remote Contact was added but needs to be accepted remotely.

See also:
signalContactRemotePending()

void TpPrototype::ContactManager::signalContactBlocked ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

Todo:
: Add doc! Contact was blocked. This signal is emitted after a contact was blocked.

Referenced by slotDeniedMembersChanged().

void TpPrototype::ContactManager::signalContactKnown ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

Todo:
: Add doc! (seil)

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactLocalPending ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

A Contact is pending locally. A Contact that is local pending have requested membership of the channel, but the local user of the framework must accept their request before they may join.

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactRemotePending ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

A Contact is pending remotely. A Contact that is remote pending list have been invited to the channel, but the remote user has not accepted the invitation.

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactRemoved ( TpPrototype::ContactManager contactManager  )  [signal]

A contact is removed. This signal is emmited immediately after signalAboutToRemoveContact() if all internal lists are updated.

See also:
signalAboutToRemoveContact()

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactSubscribed ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

A Contact was subscribed. This signal is emitted if a new contact was subscribed.

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalContactUnblocked ( TpPrototype::ContactManager contactManager,
TpPrototype::Contact contact 
) [signal]

Contact was unblocked. This signal is emitted after a contact was unblocked.

Referenced by slotDeniedMembersChanged().

void TpPrototype::ContactManager::signalMembersChanged ( TpPrototype::ContactManager contactManager,
const QString &  message,
QList< QPointer< TpPrototype::Contact > >  members,
QList< QPointer< TpPrototype::Contact > >  localPending,
QList< QPointer< TpPrototype::Contact > >  remotePending,
TpPrototype::Contact actor,
Telepathy::ChannelGroupChangeReason  reason 
) [signal]

Members changed. This signal is emitted whenever one of the internal lists of contacts (member, local pending, remote pending) changes.

Parameters:
contactManager The contact manager that handles the contacts.
message A string message from the server, or blank if not
members List of contacts currently listed as members.
localPending Contacts that are waiting for a local approval.
remotePending Contacs that are waiting for a remote approval.
actor The contact that causes the change. May be NULL if unkown.
reason The reason of the change.

Referenced by slotMembersChanged().

void TpPrototype::ContactManager::signalStreamedMediaChannelOpenedForContact ( TpPrototype::Contact contact  )  [signal]

A streamed media channel was opened. This signal is emitted when a streamed media channel was opened for a contact and all interfaces were established successfully. This usually means that you received a call.
The StreamedMedia channel object can be retrieved from the contact. Use acceptIncomingStream() or rejectIncomingStream() to accept or reject.

Parameters:
contact The contact that received the text message and contains the StreamedMediaChannel object.
See also:
StreamMediaChannel

Referenced by openStreamedMediaChannel().

void TpPrototype::ContactManager::signalTextChannelOpenedForContact ( TpPrototype::Contact contact  )  [signal]

A text channel was opened. This signal is emitted when a text channel was opened for a contact. This usually means that you received a text message.
The chat channel object can be retrieved from the contact.

Parameters:
contact The contact that received the text message and contains the text channel object.

Referenced by openTextChannel().

void ContactManager::slotDeniedMembersChanged ( const QString &  message,
const Telepathy::UIntList members_added,
const Telepathy::UIntList members_removed,
const Telepathy::UIntList local_pending,
const Telepathy::UIntList remote_pending,
uint  actor,
uint  reason 
) [protected, slot]

void ContactManager::slotKnownMembersChanged ( const QString &  message,
const Telepathy::UIntList members_added,
const Telepathy::UIntList members_removed,
const Telepathy::UIntList local_pending,
const Telepathy::UIntList remote_pending,
uint  actor,
uint  reason 
) [protected, slot]

void ContactManager::slotMembersChanged ( const QString &  message,
const Telepathy::UIntList members_added,
const Telepathy::UIntList members_removed,
const Telepathy::UIntList local_pending,
const Telepathy::UIntList remote_pending,
uint  actor,
uint  reason 
) [protected, slot]

void ContactManager::slotPublishedMembersChanged ( const QString &  message,
const Telepathy::UIntList members_added,
const Telepathy::UIntList members_removed,
const Telepathy::UIntList local_pending,
const Telepathy::UIntList remote_pending,
uint  actor,
uint  reason 
) [protected, slot]

void ContactManager::slotSubscribedMembersChanged ( const QString &  message,
const Telepathy::UIntList members_added,
const Telepathy::UIntList members_removed,
const Telepathy::UIntList local_pending,
const Telepathy::UIntList remote_pending,
uint  actor,
uint  reason 
) [protected, slot]

QList< QPointer< Contact > > ContactManager::toAuthorizeList (  ) 

List of contacts that have requested authorization from us.

The contact pointer is stored in a QPointer. If the contact is removed it is deleted by the contact manager. Thus, the pointer is set to 0.

Todo:
: Return ContactGroup here, instead a list of a pointer.

bool ContactManager::unblockContact ( const Contact contactToUnblock  ) 

Block a contact. The contact is moved to the list of blocked contacts. This may not be supported by the protocol/contact manager. In this case false is returned. A blocked contact will not receive any presence information from the local account. Messages from this contact are ignored.
The signal signalContactUnblocked() is emitted if this call was successful.
Hint:Blocking support is currently available with the connection manager Gabble and GoogleTalk.

Returns:
true if blocking is supported

References TpPrototype::Contact::telepathyHandle().


Friends And Related Function Documentation

friend class Connection [friend]

friend class ConnectionPrivate [friend]

friend class Contact [friend]


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