#include <TelepathyQt4/Prototype/ContactManager.h>
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::Contact > | contactForHandle (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 |
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] |
bool ContactManager::authorizeContact | ( | const Contact * | contact | ) |
Authorize contact. A remote contact should be authorized.
contact | The contact to autorize. |
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.
References TpPrototype::Contact::telepathyHandle().
QList< QPointer< Contact > > ContactManager::blockedContacts | ( | ) |
List of contacts that are blocked.
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.
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.
int ContactManager::count | ( | ) |
Number of Contacts. Returns how many contacts are 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] |
..
References slotPublishedMembersChanged().
Referenced by TpPrototype::Connection::slotNewChannel().
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.
bool ContactManager::removeContact | ( | const TpPrototype::Contact * | contactToRemove | ) |
Remove a contact. The contact should be removed.
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.
id | The id identifies the contact (protocol specific) |
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.
contact | The removed contact. This object is deleted after this call! |
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.
void TpPrototype::ContactManager::signalContactBlocked | ( | TpPrototype::ContactManager * | contactManager, | |
TpPrototype::Contact * | contact | |||
) | [signal] |
Referenced by slotDeniedMembersChanged().
void TpPrototype::ContactManager::signalContactKnown | ( | TpPrototype::ContactManager * | contactManager, | |
TpPrototype::Contact * | contact | |||
) | [signal] |
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.
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.
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.
contact | The contact that received the text message and contains the StreamedMediaChannel object. |
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.
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] |
References Contact, contactForHandle(), TpPrototype::Contact::CT_Known, TpPrototype::Contact::CT_LocalPending, TpPrototype::Contact::CT_RemotePending, TpPrototype::Contact::CT_Subscribed, Telepathy::HandleTypeContact, TpPrototype::Contact::isValid(), signalAboutToRemoveContact(), signalContactKnown(), signalContactLocalPending(), signalContactRemotePending(), signalContactRemoved(), signalContactSubscribed(), and signalMembersChanged().
Referenced by slotKnownMembersChanged(), slotPublishedMembersChanged(), and slotSubscribedMembersChanged().
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.
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.
References TpPrototype::Contact::telepathyHandle().
friend class Connection [friend] |
friend class ConnectionPrivate [friend] |
friend class Contact [friend] |
Referenced by slotDeniedMembersChanged(), and slotMembersChanged().