1 /* |
|
2 * Copyright (c) 2008 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: Storage view implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVIMPSTSTORAGEVIEWID_H |
|
20 #define CVIMPSTSTORAGEVIEWID_H |
|
21 |
|
22 #include "TVIMPSTEnums.h" |
|
23 #include "s_mvimpststoragecontacts.h" |
|
24 // INCLUDES |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MVIMPSTStorageContactList; |
|
28 class MVPbkContactLink; |
|
29 class CVPbkContactManager; |
|
30 class MVPbkStoreContact; |
|
31 class MVIMPSTStorageVpbkStoreHandler; |
|
32 class MVIMPSTStorageContactManagementObserver; |
|
33 class MVIMPSTStorageContactsObserver; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 class MyMVIMPSTStorageViewIdStub : public MVIMPSTStorageContacts |
|
38 { |
|
39 |
|
40 |
|
41 |
|
42 public: // Functions from base classes |
|
43 |
|
44 void UpdateAvatarDataL( const TDesC& aContactId ,const TDesC8& aData); |
|
45 MyMVIMPSTStorageViewIdStub() |
|
46 { |
|
47 |
|
48 } |
|
49 |
|
50 ~MyMVIMPSTStorageViewIdStub() |
|
51 { |
|
52 |
|
53 } |
|
54 |
|
55 /** |
|
56 * From MVIMPSTStorageContacts |
|
57 */ |
|
58 MVIMPSTStorageVpbkStoreHandler& GetStoreHandler( ); |
|
59 |
|
60 /** |
|
61 * From MVIMPSTStorageContacts |
|
62 */ |
|
63 MVPbkStoreContact* CreateNewContactLC( ); |
|
64 |
|
65 /** |
|
66 * From MVIMPSTStorageContacts |
|
67 */ |
|
68 void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ); |
|
69 |
|
70 |
|
71 /** |
|
72 * From MVIMPSTStorageContacts |
|
73 */ |
|
74 void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ); |
|
75 |
|
76 |
|
77 /** |
|
78 * From MVIMPSTStorageContacts |
|
79 */ |
|
80 MVIMPSTStorageContactList* AddContactListIdL( const TDesC& aContactListId, |
|
81 const TDesC& aDisplayName, |
|
82 TBool aNotify = ETrue ); |
|
83 |
|
84 /** |
|
85 * From MVIMPSTStorageContacts |
|
86 */ |
|
87 void RemoveContactList( const TDesC& aContactListId ); |
|
88 |
|
89 /** |
|
90 * From MVIMPSTStorageContacts |
|
91 */ |
|
92 void RemoveContact( const TDesC& aListId, const TDesC& aContactId ); |
|
93 |
|
94 /** |
|
95 * From MVIMPSTStorageContacts |
|
96 */ |
|
97 |
|
98 void SetOwnDataL( const TDesC& aOwnId ); |
|
99 |
|
100 |
|
101 MVIMPSTStorageContact* FindContact( const TDesC& aContactListId, |
|
102 const TDesC& aId ); |
|
103 |
|
104 MVIMPSTStorageContact* FindContact( const TDesC& aContactListId, |
|
105 const TDesC& aId, |
|
106 MVIMPSTStorageContactList*& aContactList ); |
|
107 /** |
|
108 * From MVIMPSTStorageContacts |
|
109 */ |
|
110 MVIMPSTStorageContact* FindAnyContact( const TDesC& aContactId ); |
|
111 |
|
112 /** |
|
113 * Find a contact from the store by using Service ID |
|
114 * @param aServiceId the Service ID of the contact to find |
|
115 * @return The contact |
|
116 */ |
|
117 MVIMPSTStorageContact* FindContactByServiceField( const TDesC& aServiceId ); |
|
118 |
|
119 /** |
|
120 * Find any contact which id is aContactId |
|
121 * @param aContactId Contactid to recognize contact. |
|
122 * @return First one which matches contactId. If not found return NULL |
|
123 */ |
|
124 MVIMPSTStorageContact* FindAnyContactByName( const TDesC& aContactId ); |
|
125 |
|
126 /** |
|
127 * Find any contact which has contact link same as aContactLink |
|
128 * @param aContactId Contactid to recognize contact. |
|
129 * @return First one which matches contactId. If not found return NULL |
|
130 */ |
|
131 MVIMPSTStorageContact* FindContact( const MVPbkContactLink& aContactLink, |
|
132 MVIMPSTStorageContactList*& aContactList ) ; |
|
133 |
|
134 |
|
135 /** |
|
136 * Find a contact from the store by Name |
|
137 * @param aContactListId List which contains contact. |
|
138 * @param aId the User ID of the contact to find |
|
139 * @return The contact |
|
140 */ |
|
141 MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, |
|
142 const TDesC& aId ) ; |
|
143 |
|
144 MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, |
|
145 const TDesC& aId, |
|
146 MVIMPSTStorageContactList*& aContactList ) ; |
|
147 |
|
148 /** |
|
149 * add contact ot the virtual phonebook. |
|
150 * @param aContact contact id to be added. |
|
151 */ |
|
152 MVIMPSTStorageContact* AddContactL( const TDesC& aFirstName = KNullDesC, |
|
153 const TDesC& aServiceField = KNullDesC ); |
|
154 |
|
155 /** |
|
156 * From MVIMPSTStorageContacts |
|
157 */ |
|
158 TInt FindContact( const MVIMPSTStorageContact& aContact ) const; |
|
159 |
|
160 /** |
|
161 * From MVIMPSTStorageContacts |
|
162 */ |
|
163 TBool ContactInAllLists( const TDesC& aContactId ) const; |
|
164 |
|
165 /** |
|
166 * From MVIMPSTStorageContacts |
|
167 */ |
|
168 TInt ListCount() const; |
|
169 |
|
170 /** |
|
171 * From MVIMPSTStorageContacts |
|
172 */ |
|
173 MVIMPSTStorageContactList& ListAt( TInt aIndex ) const; |
|
174 |
|
175 /** |
|
176 * From MVIMPSTStorageContacts |
|
177 */ |
|
178 void FindContacts( RPointerArray< MVIMPSTStorageContact >& aArray, |
|
179 const TDesC& aContactId ) const; |
|
180 |
|
181 /** |
|
182 * From MVIMPSTStorageContacts |
|
183 */ |
|
184 TInt ContactCount( TBool aSkipOfflineContacts = EFalse ) const; |
|
185 |
|
186 |
|
187 /** |
|
188 * From MVIMPSTStorageContacts |
|
189 */ |
|
190 void Sort( const TDesC& aContactListId = KNullDesC ); |
|
191 |
|
192 /** |
|
193 * Resort one contact, what ever contact list it is in |
|
194 */ |
|
195 void ResortContactInAll( MVIMPSTStorageContact* aContact ); |
|
196 |
|
197 /** |
|
198 * From MVIMPSTStorageContacts |
|
199 */ |
|
200 void SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ); |
|
201 |
|
202 /** |
|
203 * From MVIMPSTStorageContacts |
|
204 */ |
|
205 TVIMPSTEnums::TOnlineStatus OnlineStatus( |
|
206 const TDesC& aContactId ); |
|
207 |
|
208 /** |
|
209 * From MVIMPSTStorageContacts |
|
210 */ |
|
211 MVIMPSTStorageContact* UpdatePresenceL( const TDesC& aContactId, |
|
212 TVIMPSTEnums::TOnlineStatus aStatus, |
|
213 const TDesC& aAlias, |
|
214 const TDesC& aStatusText); |
|
215 /** |
|
216 * From MVIMPSTStorageContacts |
|
217 */ |
|
218 MVIMPSTStorageContact& OwnStatus(); |
|
219 |
|
220 /** |
|
221 * From MVIMPSTStorageContacts |
|
222 */ |
|
223 void SetNotifyOnSave( TBool aStatus ); |
|
224 |
|
225 |
|
226 /** |
|
227 * MVIMPSTStorageContacts |
|
228 */ |
|
229 MVIMPSTStorageContact* CreateContactL( |
|
230 const TDesC& aContactList, |
|
231 const TDesC& aWVID, |
|
232 MVPbkContactLink* aContactLink, |
|
233 CVPbkContactManager& aContactManager, |
|
234 MVIMPSTStorageContactManagementObserver& aContactManagementObserver); |
|
235 |
|
236 /** |
|
237 * MVIMPSTStorageContacts |
|
238 */ |
|
239 MVIMPSTStorageContact* CreateContactL( |
|
240 MVIMPSTStorageContactList& aContactList, |
|
241 const TDesC& aWVID, |
|
242 TVIMPSTEnums::TOnlineStatus aStatus, |
|
243 const TDesC& aStatusText, |
|
244 MVPbkContactLink* aContactLink, |
|
245 CVPbkContactManager& aContactManager , |
|
246 MVIMPSTStorageContactManagementObserver& aContactManagementObserver); |
|
247 |
|
248 /** |
|
249 * MVIMPSTStorageContacts |
|
250 */ |
|
251 void SendContactListUpdatedEvent( MVIMPSTStorageContactList& aList ); |
|
252 |
|
253 |
|
254 /** |
|
255 * From MVIMPSTStorageContacts |
|
256 */ |
|
257 void RemoveAllContactsL(); |
|
258 |
|
259 |
|
260 /** |
|
261 * From MVIMPSTStorageContacts |
|
262 */ |
|
263 TBool IsContactValid( const MVIMPSTStorageContact* aContact ) const; |
|
264 |
|
265 /** |
|
266 * From MVIMPSTStorageContacts |
|
267 */ |
|
268 void SortContactLists(); |
|
269 |
|
270 |
|
271 |
|
272 /** |
|
273 * add contact to the virtual phonebook. |
|
274 */ |
|
275 void AddServerContactL( const TDesC& aContact); |
|
276 |
|
277 |
|
278 /** |
|
279 * add selected pbk2 contact to the service store. |
|
280 * @param aContact contact selected from phone book. |
|
281 */ |
|
282 void AddPhoneBookContactL( const MVPbkStoreContact& aContact ); |
|
283 |
|
284 /** |
|
285 * add selected contact to the phone book. |
|
286 * @param aContact selected contact. |
|
287 */ |
|
288 void AddContactToPhoneBookL( const MVIMPSTStorageContact& aContact ); |
|
289 |
|
290 /** |
|
291 * removes contact from the virtual phonebook. |
|
292 */ |
|
293 void RemoveServerContactL( const TDesC& aContact); |
|
294 |
|
295 /** |
|
296 * Find contact list by id |
|
297 * @param aListId. Id to find. |
|
298 * @return Contactlist. If not found return NULL |
|
299 */ |
|
300 MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) ; |
|
301 /** |
|
302 * removes contact from the virtual phonebook. |
|
303 * @param aContact contact id to be removed. |
|
304 */ |
|
305 void RemoveContactL( const MVPbkContactLink& aContactLink); |
|
306 |
|
307 /** |
|
308 * removes contact from the virtual phonebook. |
|
309 * @param aContact contact id to be removed. |
|
310 */ |
|
311 void RemoveContactL( const TDesC& aServiceContactId); |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 TVIMPSTEnums::TOnlineStatus iStatus; |
|
318 |
|
319 HBufC* iOwnId; |
|
320 |
|
321 |
|
322 |
|
323 }; |
|
324 |
|
325 #endif // CVIMPSTVIEWID_H |
|
326 |
|
327 // End of File |
|