diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 566789a0bdad40a76059c9420d05cae130a16f6a..6e0c8d42106321d92fd4b8a9ccb3ad5751f145b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,8 +21,6 @@ set(GENERIC_LIB_VERSION "0.9.8") INCLUDE_DIRECTORIES ( ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) - - #File to compile set( qtsflphone_LIB_SRCS Call.cpp @@ -30,6 +28,7 @@ set( qtsflphone_LIB_SRCS AccountList.cpp CallModel.cpp Contact.cpp + ContactBackend.cpp Item.cpp configurationmanager_interface_singleton.cpp callmanager_interface_singleton.cpp @@ -98,7 +97,8 @@ set( qtsflphone_LIB_HDRS AccountList.h Call.h CallModel.h - Contact.h + Contact.h + ContactBackend.h Item.h configurationmanager_interface_singleton.h callmanager_interface_singleton.h diff --git a/src/ContactBackend.cpp b/src/ContactBackend.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f95c0284ea31cc1d7b034d66b2d650430af615df --- /dev/null +++ b/src/ContactBackend.cpp @@ -0,0 +1,14 @@ +#include "ContactBackend.h" + +#include "Contact.h" +#include <QHash> + +ContactBackend::ContactBackend(QObject* parent) : QObject(parent) +{ + +} + +ContactList ContactBackend::update() +{ + return update_slot(); +} diff --git a/src/ContactBackend.h b/src/ContactBackend.h new file mode 100644 index 0000000000000000000000000000000000000000..72584f8c52f51b3294b6eae5261f428589534348 --- /dev/null +++ b/src/ContactBackend.h @@ -0,0 +1,34 @@ +#ifndef CONTACT_BACKEND_H +#define CONTACT_BACKEND_H + +#include <QObject> +#include <QHash> + +#include "typedefs.h" + +class Contact; + +typedef QList<Contact*> ContactList; + +class LIB_EXPORT ContactBackend : public QObject { + Q_OBJECT +public: + ContactBackend(QObject* parent); + virtual Contact* getContactByPhone ( QString phoneNumber ) = 0; + virtual Contact* getContactByUid ( QString uid ) = 0; + virtual void editContact ( Contact* contact ) = 0; + virtual void addNewContact ( Contact* contact ) = 0; +protected: + virtual ContactList update_slot ( ) = 0; + QHash<QString,Contact*> m_pContactByPhone ; + QHash<QString,Contact*> m_pContactByUid ; +public slots: + ContactList update(); + +private slots: + +signals: + +}; + +#endif \ No newline at end of file