|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description:QT contact manager interface |
|
15 * |
|
16 */ |
|
17 #ifndef CONTACTS_MANAGER_H |
|
18 #define CONTACTS_MANAGER_H |
|
19 |
|
20 // SYSTEM INCLUDES |
|
21 #include <QObject> |
|
22 #include <qtcontacts.h> |
|
23 #include "qtcontactsglobal.h" |
|
24 // USER INCLUDES |
|
25 #include "mcscontactsmanagerobserver.h" |
|
26 |
|
27 QTM_BEGIN_NAMESPACE |
|
28 // FORWARD DECLARATIONS |
|
29 class QContactManager; |
|
30 QTM_END_NAMESPACE |
|
31 |
|
32 QTM_USE_NAMESPACE |
|
33 |
|
34 class CCsContactsResolver; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * QT contact manager interface. Creates an instance of virtual |
|
39 * phonebook contact manager. Using the QT contacts manager |
|
40 * creates resolver objects for use by cache to resolve addresses |
|
41 */ |
|
42 class CCsContactsManager : public QObject |
|
43 { |
|
44 Q_OBJECT |
|
45 |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Constructor |
|
50 */ |
|
51 explicit CCsContactsManager(QObject* parent = 0); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~CCsContactsManager(); |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * resolver |
|
62 * Provides a reference to the resolver object. |
|
63 * |
|
64 * @return The contact resolver interface. |
|
65 */ |
|
66 CCsContactsResolver* resolver() const; |
|
67 |
|
68 /** |
|
69 * addObserver |
|
70 * add observer into the list |
|
71 * @param aObserver instance of MCsContactsManagerObserver |
|
72 */ |
|
73 void addObserver(MCsContactsManagerObserver* aObserver); |
|
74 |
|
75 /** |
|
76 * removeObserver |
|
77 * delete observer from the observer list |
|
78 * @param aObserver instance of MCsContactsManagerObserver |
|
79 */ |
|
80 void removeObserver(MCsContactsManagerObserver* aObserver); |
|
81 |
|
82 public slots: |
|
83 |
|
84 /** |
|
85 * Handle contactsAdded signal from QContactManager |
|
86 * Emits phonebookNotification signal |
|
87 * @param contactIds unique contact id list |
|
88 */ |
|
89 void handleContactsAdded(const QList<QContactLocalId>& contactIds); |
|
90 |
|
91 /** |
|
92 * Handle contactsChanged signal from QContactManager |
|
93 * Emits phonebookNotification signal |
|
94 * @param contactIds unique contact id list |
|
95 */ |
|
96 void handleContactsChanged(const QList<QContactLocalId>& contactIds); |
|
97 |
|
98 /** |
|
99 * Handle contactsRemoved signal from QContactManager |
|
100 * Emits phonebookNotification signal |
|
101 * @param id deleted contact id list |
|
102 */ |
|
103 void handleContactsRemoved(const QList<QContactLocalId> &contactIds); |
|
104 |
|
105 private: |
|
106 |
|
107 /** |
|
108 * mContactsResolver |
|
109 * An instance of the contacts database resolver |
|
110 * Own. |
|
111 */ |
|
112 CCsContactsResolver* mContactsResolver; |
|
113 |
|
114 /** |
|
115 * mPhonebookManager |
|
116 * An instance of the QContactManager |
|
117 * Own. |
|
118 */ |
|
119 QContactManager* mPhonebookManager; |
|
120 |
|
121 /** |
|
122 * mObserverList |
|
123 * List of Observers |
|
124 * Own. |
|
125 */ |
|
126 QList<MCsContactsManagerObserver*> mObserverList; |
|
127 }; |
|
128 |
|
129 #endif // CONTACTS_MANAGER_H |