14 Q_OBJECT |
14 Q_OBJECT |
15 public: |
15 public: |
16 explicit ContactsEngine(QObject *parent = 0); |
16 explicit ContactsEngine(QObject *parent = 0); |
17 ~ContactsEngine(); |
17 ~ContactsEngine(); |
18 |
18 |
|
19 // index() and parent() are defined by QAbstractListModel. So we do not |
|
20 // need to define the QModelIndex |
19 // required by list model interface. |
21 // required by list model interface. |
20 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
22 int rowCount(const QModelIndex &parent = QModelIndex()) const; |
21 QVariant data(const QModelIndex &index, int role) const; |
23 QVariant data(const QModelIndex &index, int role) const; |
22 |
24 |
23 QStringList dataSources(); |
25 QStringList dataSources(); |
24 void setManager(QString aMgr); |
|
25 |
26 |
26 public: |
27 public: |
27 void populateAddresses(); |
28 void populateAddresses(); |
|
29 void dumpContactMgr(); // use for debugging. Hard to inspect it via Qt Creator. |
|
30 void enumerateMgrs(); |
28 |
31 |
29 signals: |
32 signals: |
30 void managerChanged(QStringList containNames); |
33 void managerChanged(QStringList containNames); |
31 |
34 |
32 public slots: |
35 public slots: |
|
36 void setManager(const QString &aMgr); |
33 |
37 |
34 private: |
38 private: |
35 QContactManager *m_manager; |
39 QContactManager *m_manager; |
36 QMap<QString, QString> m_availableManagers; |
40 QMap<QString, QString> m_availableManagers; |
37 QMap<QString, QContactManager*> m_initialisedManagers; |
41 QMap<QString, QContactManager*> m_initialisedManagers; |
|
42 |
38 }; |
43 }; |
39 |
44 |
40 #endif // CONTACTSENGINE_H |
45 #endif // CONTACTSENGINE_H |