00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TelepathyQt4_cli_contact_manager_h_HEADER_GUARD_
00023 #define _TelepathyQt4_cli_contact_manager_h_HEADER_GUARD_
00024
00025 #ifndef IN_TELEPATHY_QT4_HEADER
00026 #error IN_TELEPATHY_QT4_HEADER
00027 #endif
00028
00029 #include <QObject>
00030
00031 #include <QList>
00032 #include <QSet>
00033 #include <QSharedPointer>
00034
00035 #include <TelepathyQt4/Types>
00036 #include <TelepathyQt4/Client/Contact>
00037
00038 namespace Telepathy
00039 {
00040 namespace Client
00041 {
00042
00043 class Connection;
00044 class PendingContacts;
00045 class PendingOperation;
00046
00047 class ContactManager : public QObject
00048 {
00049 Q_OBJECT
00050
00051 public:
00052
00053 Connection *connection() const;
00054
00055 bool isSupported() const;
00056 QSet<Contact::Feature> supportedFeatures() const;
00057
00058 PendingContacts *contactsForHandles(const UIntList &handles,
00059 const QSet<Contact::Feature> &features = QSet<Contact::Feature>());
00060 PendingContacts *contactsForHandles(const ReferencedHandles &handles,
00061 const QSet<Contact::Feature> &features = QSet<Contact::Feature>());
00062
00063 PendingContacts *contactsForIdentifiers(const QStringList &identifiers,
00064 const QSet<Contact::Feature> &features = QSet<Contact::Feature>());
00065
00066 PendingContacts *upgradeContacts(const QList<QSharedPointer<Contact> > &contacts,
00067 const QSet<Contact::Feature> &features);
00068
00069 private Q_SLOTS:
00070 void onAliasesChanged(const Telepathy::AliasPairList &);
00071 void onAvatarUpdated(uint, const QString &);
00072 void onPresencesChanged(const Telepathy::SimpleContactPresences &);
00073
00074 private:
00075 ContactManager(Connection *parent);
00076 ~ContactManager();
00077
00078 QSharedPointer<Contact> ensureContact(const ReferencedHandles &handle,
00079 const QSet<Contact::Feature> &features, const QVariantMap &attributes);
00080
00081 struct Private;
00082 friend struct Private;
00083 friend class Connection;
00084 friend class PendingContacts;
00085 Private *mPriv;
00086 };
00087
00088 }
00089 }
00090
00091 #endif