first release
[groupsms] / sms / contactinterface.h
1 #ifndef CONTACTINTERFACE_H
2 #define CONTACTINTERFACE_H
3
4 #include <QObject>
5 #include <QVector>
6 #include <contactwidgetitem.h>
7
8 #include "itemobserver.h"
9
10 #ifdef ONLY_FOR_EBOOK
11
12 extern "C" {
13 #include <gtk/gtk.h>
14 #include <libosso.h>
15 #include <libebook/e-book.h>
16 #include <libosso-abook/osso-abook.h>
17 }
18
19 #endif
20
21 class ContactInterface : public QObject
22 {
23     Q_OBJECT
24 public:
25     static ContactInterface* getInstance();
26     ~ContactInterface();
27
28     bool initEbook();
29
30     bool updateContactsFromEbookToXml();
31
32     void setItemObserver( ItemObserver *observer );
33     void setItemSelectObserver( ItemSelectObserver *observer );
34
35     /**
36       get all contacts from libosso-abook
37      */
38     ItemListPtr getAllContacts();
39     /**
40       get all contacts from xml file
41      */
42     void getAllContactsFromXml();
43     void getAllContactsFromXml(const QString &groupname);
44
45     QStringList getAllGroupNames();
46
47     bool createGroup(const QString &groupname);
48     bool removeGroup(const QString &groupname);
49     bool addContactToGroup( ItemListPtr items, const QString &groupname );
50     bool removeContactToGroup( ItemListPtr items, const QString &groupname );
51     bool removeContactToGroup( ItemListPtr items );
52
53 private:
54     static ContactInterface* instance;
55     ContactInterface(QObject *parent = 0);
56
57 private:
58     ItemListPtr all_contacts_items;
59     ItemListPtr all_contacts_items_db;
60     Item current_contact_item;
61     QString current_uid;
62     QString current_fullname;
63     QString current_mobilenumber;
64
65 #ifdef ONLY_FOR_EBOOK    
66     OssoABookRoster *roster;
67 #endif
68
69 Q_SIGNALS:
70
71 public Q_SLOTS:
72
73 };
74
75 #endif // CONTACTINTERFACE_H