| Home · All Classes · All Namespaces · Modules · Functions · Files

pending-contacts.h
1
23 #ifndef _TelepathyQt_pending_contacts_h_HEADER_GUARD_
24 #define _TelepathyQt_pending_contacts_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/PendingOperation>
31
32 #include <QHash>
33 #include <QList>
34 #include <QMap>
35 #include <QSet>
36 #include <QStringList>
37
38 #include <TelepathyQt/Types>
39 #include <TelepathyQt/Contact>
40
41 namespace Tp
42 {
43
44 class ContactManager;
45
46 class TP_QT_EXPORT PendingContacts : public PendingOperation
47 {
48 Q_OBJECT
49 Q_DISABLE_COPY(PendingContacts);
50
51 public:
52 ~PendingContacts();
53
54 ContactManagerPtr manager() const;
55 Features features() const;
56
57 bool isForHandles() const;
58 UIntList handles() const;
59
60 bool isForIdentifiers() const;
61 QStringList identifiers() const;
62
63 bool isForVCardAddresses() const;
64 QString vcardField() const;
65 QStringList vcardAddresses() const;
66
67 bool isForUris() const;
68 QStringList uris() const;
69
70 bool isUpgrade() const;
71 QList<ContactPtr> contactsToUpgrade() const;
72
73 QList<ContactPtr> contacts() const;
74 UIntList invalidHandles() const;
75 QStringList validIdentifiers() const;
76 QHash<QString, QPair<QString, QString> > invalidIdentifiers() const;
77 QStringList validVCardAddresses() const;
78 QStringList invalidVCardAddresses() const;
79 QStringList validUris() const;
80 QStringList invalidUris() const;
81
82 private Q_SLOTS:
83 TP_QT_NO_EXPORT void onAttributesFinished(Tp::PendingOperation *);
84 TP_QT_NO_EXPORT void onRequestHandlesFinished(Tp::PendingOperation *);
85 TP_QT_NO_EXPORT void onAddressingGetContactsFinished(Tp::PendingOperation *);
86 TP_QT_NO_EXPORT void onReferenceHandlesFinished(Tp::PendingOperation *);
87 TP_QT_NO_EXPORT void onNestedFinished(Tp::PendingOperation *);
88 TP_QT_NO_EXPORT void onInspectHandlesFinished(QDBusPendingCallWatcher *);
89
90 private:
91 friend class ContactManager;
92
93 enum RequestType
94 {
95 ForHandles,
96 ForIdentifiers,
97 ForVCardAddresses,
98 ForUris,
99 Upgrade
100 };
101
102 // If errorName is non-empty, these will fail instantly
103 TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const UIntList &handles,
104 const Features &features,
105 const Features &missingFeatures,
106 const QStringList &interfaces,
107 const QMap<uint, ContactPtr> &satisfyingContacts,
108 const QSet<uint> &otherContacts,
109 const QString &errorName = QString(),
110 const QString &errorMessage = QString());
111 TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QStringList &list,
112 RequestType requestType,
113 const Features &features,
114 const QStringList &interfaces,
115 const QString &errorName = QString(),
116 const QString &errorMessage = QString());
117 TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QString &vcardField,
118 const QStringList &vcardAddresses,
119 const Features &features,
120 const QStringList &interfaces,
121 const QString &errorName = QString(),
122 const QString &errorMessage = QString());
123 TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QList<ContactPtr> &contacts,
124 const Features &features,
125 const QString &errorName = QString(),
126 const QString &errorMessage = QString());
127
128 TP_QT_NO_EXPORT void allAttributesFetched();
129
130 struct Private;
131 friend struct Private;
132 Private *mPriv;
133 };
134
135 } // Tp
136
137 #endif
Tp::ContactManager
The ContactManager class is responsible for managing contacts.
Definition: contact-manager.h:50
Tp::PendingOperation
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
Tp::UIntList
Definition: build/TelepathyQt/_gen/types.h:101
Tp::PendingContacts
The PendingContacts class is used by ContactManager when creating/updating Contact objects...
Definition: pending-contacts.h:46
Tp::Features
The Features class represents a list of Feature.
Definition: feature.h:61