Added ContactManager class.
[situare] / src / engine / contactmanagerprivate.h
diff --git a/src/engine/contactmanagerprivate.h b/src/engine/contactmanagerprivate.h
new file mode 100644 (file)
index 0000000..ef1a6b0
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef CONTACTMANAGERPRIVATE_H
+#define CONTACTMANAGERPRIVATE_H
+
+#include <QObject>
+
+#include <QContactManager>
+
+class ContactManager;
+
+QTM_USE_NAMESPACE
+
+class ContactManagerPrivate : public QObject
+{
+    Q_OBJECT
+public:
+    ContactManagerPrivate(QObject *parent = 0);
+
+    /**
+    * @brief Returns contact's guid from contact's facebook ID.
+    *
+    * @param facebookId contact's facebook ID
+    * @return contact guid
+    */
+    QString contactGuid(const QString &facebookId) const;
+
+    /**
+    * @brief Requests contact guids.
+    *
+    * Guid is a globally unique ID of a contact, which can be used with
+    * other datastores.
+    */
+    void requestContactGuids();
+
+private:
+    /**
+    * @brief Parses Facebook id from account URI.
+    *
+    * @param accountUri Accounts universal resource identifier.
+    * @return Facebook ID or empty if cannot parse the ID.
+    */
+    QString parseFacebookId(const QString &accountUri) const;
+
+private:
+    ContactManager *m_parent;   ///< Parent
+    QContactManager *m_manager; ///< Contact manager
+    QHash<QString, QString> m_contactGuids;
+};
+
+#endif // CONTACTMANAGERPRIVATE_H