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

pending-contacts.h

    00001
    00023 #ifndef _TelepathyQt_pending_contacts_h_HEADER_GUARD_
    00024 #define _TelepathyQt_pending_contacts_h_HEADER_GUARD_
    00025
    00026 #ifndef IN_TP_QT_HEADER
    00027 #error IN_TP_QT_HEADER
    00028 #endif
    00029
    00030 #include <TelepathyQt/PendingOperation>
    00031
    00032 #include <QHash>
    00033 #include <QList>
    00034 #include <QMap>
    00035 #include <QSet>
    00036 #include <QStringList>
    00037
    00038 #include <TelepathyQt/Types>
    00039 #include <TelepathyQt/Contact>
    00040
    00041 namespace Tp
    00042 {
    00043
    00044 class ContactManager;
    00045
    00046 class TP_QT_EXPORT PendingContacts : public PendingOperation
    00047 {
    00048     Q_OBJECT
    00049     Q_DISABLE_COPY(PendingContacts);
    00050
    00051 public:
    00052     ~PendingContacts();
    00053
    00054     ContactManagerPtr manager() const;
    00055     Features features() const;
    00056
    00057     bool isForHandles() const;
    00058     UIntList handles() const;
    00059
    00060     bool isForIdentifiers() const;
    00061     QStringList identifiers() const;
    00062
    00063     bool isForVCardAddresses() const;
    00064     QString vcardField() const;
    00065     QStringList vcardAddresses() const;
    00066
    00067     bool isForUris() const;
    00068     QStringList uris() const;
    00069
    00070     bool isUpgrade() const;
    00071     QList<ContactPtr> contactsToUpgrade() const;
    00072
    00073     QList<ContactPtr> contacts() const;
    00074     UIntList invalidHandles() const;
    00075     QStringList validIdentifiers() const;
    00076     QHash<QString, QPair<QString, QString> > invalidIdentifiers() const;
    00077     QStringList validVCardAddresses() const;
    00078     QStringList invalidVCardAddresses() const;
    00079     QStringList validUris() const;
    00080     QStringList invalidUris() const;
    00081
    00082 private Q_SLOTS:
    00083     TP_QT_NO_EXPORT void onAttributesFinished(Tp::PendingOperation *);
    00084     TP_QT_NO_EXPORT void onRequestHandlesFinished(Tp::PendingOperation *);
    00085     TP_QT_NO_EXPORT void onAddressingGetContactsFinished(Tp::PendingOperation *);
    00086     TP_QT_NO_EXPORT void onReferenceHandlesFinished(Tp::PendingOperation *);
    00087     TP_QT_NO_EXPORT void onNestedFinished(Tp::PendingOperation *);
    00088     TP_QT_NO_EXPORT void onInspectHandlesFinished(QDBusPendingCallWatcher *);
    00089
    00090 private:
    00091     friend class ContactManager;
    00092
    00093     enum RequestType
    00094     {
    00095         ForHandles,
    00096         ForIdentifiers,
    00097         ForVCardAddresses,
    00098         ForUris,
    00099         Upgrade
    00100     };
    00101
    00102     // If errorName is non-empty, these will fail instantly
    00103     TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const UIntList &handles,
    00104             const Features &features,
    00105             const Features &missingFeatures,
    00106             const QStringList &interfaces,
    00107             const QMap<uint, ContactPtr> &satisfyingContacts,
    00108             const QSet<uint> &otherContacts,
    00109             const QString &errorName = QString(),
    00110             const QString &errorMessage = QString());
    00111     TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QStringList &list,
    00112             RequestType requestType,
    00113             const Features &features,
    00114             const QStringList &interfaces,
    00115             const QString &errorName = QString(),
    00116             const QString &errorMessage = QString());
    00117     TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QString &vcardField,
    00118             const QStringList &vcardAddresses,
    00119             const Features &features,
    00120             const QStringList &interfaces,
    00121             const QString &errorName = QString(),
    00122             const QString &errorMessage = QString());
    00123     TP_QT_NO_EXPORT PendingContacts(const ContactManagerPtr &manager, const QList<ContactPtr> &contacts,
    00124             const Features &features,
    00125             const QString &errorName = QString(),
    00126             const QString &errorMessage = QString());
    00127
    00128     TP_QT_NO_EXPORT void allAttributesFetched();
    00129
    00130     struct Private;
    00131     friend struct Private;
    00132     Private *mPriv;
    00133 };
    00134
    00135 } // Tp
    00136
    00137 #endif