Debian Codegraph @

storagechangenotifierplugins/hcontacts/ContactsChangeNotifier.h

raw
1 #ifndef CONTACTSCHANGENOTIFIER_H
2 #define CONTACTSCHANGENOTIFIER_H
3
4 #include <QObject>
5 #include <QContactManager>
6 #include <QList>
7 #include <QLoggingCategory>
8
9 #include <QContactId>
10
11 using namespace QtContacts;
12
13 class ContactsChangeNotifier : public QObject
14 {
15 Q_OBJECT
16
17 public:
18 /*! \brief constructor
19 */
20 ContactsChangeNotifier();
21
22 /*! \brief constructor
23 */
24 ~ContactsChangeNotifier();
25
26 /*! \brief start listening to changes from QContactManager
27 */
28 void enable();
29
30 /*! \brief stop listening to changes from QContactManager
31 */
32 void disable();
33
34 Q_SIGNALS:
35 /*! emit this signal to notify a change in contacts backend
36 */
37 void change();
38
39 private Q_SLOTS:
40 void onContactsAdded(const QList<QContactId>& ids);
41 void onContactsRemoved(const QList<QContactId>& ids);
42 void onContactsChanged(const QList<QContactId>& ids);
43
44 private:
45 QContactManager* iManager;
46 bool iDisabled;
47 };
48
49
50 Q_DECLARE_LOGGING_CATEGORY(lcSyncMLContactChange)
51 Q_DECLARE_LOGGING_CATEGORY(lcSyncMLContactChangeTrace)
52
53 #endif