|
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 "qtcontactsglobal.h" |
|
23 // USER INCLUDES |
|
24 #include "mcscontactsmanagerobserver.h" |
|
25 |
|
26 QTM_BEGIN_NAMESPACE |
|
27 // FORWARD DECLARATIONS |
|
28 class QContactManager; |
|
29 QTM_END_NAMESPACE |
|
30 |
|
31 QTM_USE_NAMESPACE |
|
32 |
|
33 class CCsContactsResolver; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * QT contact manager interface. Creates an instance of virtual |
|
38 * phonebook contact manager. Using the QT contacts manager |
|
39 * creates resolver objects for use by cache to resolve addresses |
|
40 */ |
|
41 class CCsContactsManager : public QObject |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 */ |
|
50 explicit CCsContactsManager(QObject* parent = 0); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 virtual ~CCsContactsManager(); |
|
56 |
|
57 public: |
|
58 |
|
59 /** |
|
60 * resolver |
|
61 * Provides a reference to the resolver object. |
|
62 * |
|
63 * @return The contact resolver interface. |
|
64 */ |
|
65 CCsContactsResolver* resolver() const; |
|
66 |
|
67 /** |
|
68 * addObserver |
|
69 * add observer into the list |
|
70 * @param aObserver instance of MCsContactsManagerObserver |
|
71 */ |
|
72 void addObserver(MCsContactsManagerObserver* aObserver); |
|
73 |
|
74 /** |
|
75 * removeObserver |
|
76 * delete observer from the observer list |
|
77 * @param aObserver instance of MCsContactsManagerObserver |
|
78 */ |
|
79 void removeObserver(MCsContactsManagerObserver* aObserver); |
|
80 |
|
81 public slots: |
|
82 |
|
83 /** |
|
84 * Handle contactsAdded signal from QContactManager |
|
85 * Emits phonebookNotification signal |
|
86 * @param contactIds unique contact id list |
|
87 */ |
|
88 void handleContactsAdded(const QList<QContactLocalId>& contactIds); |
|
89 |
|
90 /** |
|
91 * Handle contactsChanged signal from QContactManager |
|
92 * Emits phonebookNotification signal |
|
93 * @param contactIds unique contact id list |
|
94 */ |
|
95 void handleContactsChanged(const QList<QContactLocalId>& contactIds); |
|
96 |
|
97 /** |
|
98 * Handle contactsRemoved signal from QContactManager |
|
99 * Emits phonebookNotification signal |
|
100 * @param id deleted contact id list |
|
101 */ |
|
102 void handleContactsRemoved(const QList<QContactLocalId> &contactIds); |
|
103 |
|
104 private: |
|
105 |
|
106 /** |
|
107 * mContactsResolver |
|
108 * An instance of the contacts database resolver |
|
109 * Own. |
|
110 */ |
|
111 CCsContactsResolver* mContactsResolver; |
|
112 |
|
113 /** |
|
114 * mPhonebookManager |
|
115 * An instance of the QContactManager |
|
116 * Own. |
|
117 */ |
|
118 QContactManager* mPhonebookManager; |
|
119 |
|
120 /** |
|
121 * mObserverList |
|
122 * List of Observers |
|
123 * Own. |
|
124 */ |
|
125 QList<MCsContactsManagerObserver*> mObserverList; |
|
126 }; |
|
127 |
|
128 #endif // CONTACTS_MANAGER_H |