|
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: Stored contact data container interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MVIMPSTSTORAGECONTACTS_H |
|
21 #define MVIMPSTSTORAGECONTACTS_H |
|
22 |
|
23 |
|
24 #include "TVIMPSTEnums.h" |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <badesca.h> |
|
28 #include "mvimpststoragecontact.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MVIMPSTStorageContactsObserver; |
|
32 class MVIMPSTStorageContactList; |
|
33 class MVIMPSTStorageContact; |
|
34 class MVPbkContactLink; |
|
35 class CVPbkContactManager; |
|
36 class MVPbkStoreContact; |
|
37 class MVIMPSTStorageVpbkStoreHandler; |
|
38 class MVIMPSTStorageContactManagementObserver; |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Interface for stored contacts container |
|
47 * |
|
48 * @lib VIMPSTStorage.dll |
|
49 * @since 5.0 |
|
50 */ |
|
51 class MVIMPSTStorageContacts |
|
52 { |
|
53 public : |
|
54 virtual void UpdateAvatarDataL( const TDesC& aContactId ,const TDesC8& aData) = 0; |
|
55 public: // Definitions |
|
56 /** |
|
57 * An Enum |
|
58 * To define contact list preperty. |
|
59 * not used. |
|
60 */ |
|
61 |
|
62 enum TContactListProperty |
|
63 { |
|
64 EPrimaryCollapseInUse, /*primary collapse. */ |
|
65 ESecondaryCollapseInUse /* secondary collapse. */ |
|
66 }; |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Add an observer. |
|
72 * @param aObserver The observer |
|
73 */ |
|
74 virtual void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) = 0; |
|
75 |
|
76 /** |
|
77 * Remove an observer. |
|
78 * @param aObserver The observer |
|
79 */ |
|
80 virtual void RemoveObserver( |
|
81 MVIMPSTStorageContactsObserver* aObserver ) = 0; |
|
82 |
|
83 |
|
84 /** |
|
85 * Find a contact from the store by Name |
|
86 * @param aContactListId List which contains contact. |
|
87 * @param aId the User ID of the contact to find |
|
88 * @return The contact |
|
89 */ |
|
90 virtual MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, |
|
91 const TDesC& aId ) = 0; |
|
92 |
|
93 virtual MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, |
|
94 const TDesC& aId, |
|
95 MVIMPSTStorageContactList*& aContactList ) = 0; |
|
96 |
|
97 /** |
|
98 * Find any contact which id is aContactId |
|
99 * @param aContactId Contactid to recognize contact. |
|
100 * @return First one which matches contactId. If not found return NULL |
|
101 */ |
|
102 virtual MVIMPSTStorageContact* FindAnyContactByName( const TDesC& aContactId ) = 0; |
|
103 |
|
104 /** |
|
105 * Find any contact which has contact link same as aContactLink |
|
106 * @param aContactId Contactid to recognize contact. |
|
107 * @return First one which matches contactId. If not found return NULL |
|
108 */ |
|
109 virtual MVIMPSTStorageContact* FindContact( const MVPbkContactLink& aContactLink, |
|
110 MVIMPSTStorageContactList*& aContactList ) = 0; |
|
111 |
|
112 |
|
113 /** |
|
114 * Find a contact from the store by using Service ID |
|
115 * @param aServiceId the Service ID of the contact to find |
|
116 * @return The contact |
|
117 */ |
|
118 virtual MVIMPSTStorageContact* FindContactByServiceField( const TDesC& aServiceId ) = 0; |
|
119 |
|
120 /** |
|
121 * Count of lists. |
|
122 * @return Count of lists. |
|
123 */ |
|
124 virtual TInt ListCount() const = 0; |
|
125 |
|
126 /** |
|
127 * List in index. |
|
128 * @param aIndex. Index of list. |
|
129 * return Contact list. |
|
130 */ |
|
131 virtual MVIMPSTStorageContactList& ListAt( TInt aIndex ) const = 0; |
|
132 |
|
133 /** |
|
134 * Find contact list by id |
|
135 * @param aListId. Id to find. |
|
136 * @return Contactlist. If not found return NULL |
|
137 */ |
|
138 virtual MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) = 0; |
|
139 |
|
140 /** |
|
141 * Find out if contact exists in all list. |
|
142 * @param aContactId. Id to check. |
|
143 * @return ETrue if contact is in all lists. EFalse if not. |
|
144 */ |
|
145 virtual TBool ContactInAllLists( const TDesC& aContactId ) const = 0; |
|
146 |
|
147 /** |
|
148 * Add new contact list. |
|
149 * @param aContactListId Id for new contact list. |
|
150 * @param aDisplayName Display name of new contact list. |
|
151 */ |
|
152 virtual MVIMPSTStorageContactList* AddContactListIdL( const TDesC& aContactListId, |
|
153 const TDesC& aDisplayName, |
|
154 TBool aNotify = ETrue ) = 0; |
|
155 |
|
156 /** |
|
157 * Remove contact list from store. |
|
158 * @param aContactListId. Id of contact list to be removed. |
|
159 */ |
|
160 virtual void RemoveContactList( const TDesC& aContactListId ) = 0; |
|
161 |
|
162 |
|
163 /** |
|
164 * Removes all contacts. |
|
165 */ |
|
166 virtual void RemoveAllContactsL() = 0; |
|
167 |
|
168 /** |
|
169 * Count of stored contacts |
|
170 * @param aSkipOfflineContacts ETrue skip offline contacts. |
|
171 * EFalse Do not skip. |
|
172 * @return TInt Count of contacts |
|
173 */ |
|
174 virtual TInt ContactCount( |
|
175 TBool aSkipOfflineContacts = EFalse ) const = 0; |
|
176 |
|
177 /** |
|
178 * Online status of user. |
|
179 * @param aContactId Id which status is wanted. |
|
180 * @return Onlinestatus of user. |
|
181 */ |
|
182 virtual TVIMPSTEnums::TOnlineStatus OnlineStatus( |
|
183 const TDesC& aContactId ) = 0; |
|
184 |
|
185 /** |
|
186 * Update presence information of contact. |
|
187 * @param aContactId Id of contact which presence is updated. |
|
188 * @param aStatus. New presence status |
|
189 * @param aAlias. New alias. |
|
190 * @param aStatusText New status message text. |
|
191 * @return MVIMPSTStorageContact* pointer of the contact |
|
192 */ |
|
193 virtual MVIMPSTStorageContact* UpdatePresenceL( const TDesC& aContactId, |
|
194 TVIMPSTEnums::TOnlineStatus aStatus, |
|
195 const TDesC& aAlias, |
|
196 const TDesC& aStatusText) = 0; |
|
197 |
|
198 |
|
199 /** |
|
200 * Check if contact is found in storage. |
|
201 * @param aContact contact to find. |
|
202 * @return TBool ETrue if contact is found from storage |
|
203 */ |
|
204 virtual TBool IsContactValid( const MVIMPSTStorageContact* aContact ) const = 0; |
|
205 |
|
206 /** |
|
207 * Sorts contact lists alphabetically. |
|
208 * @since S60 v5.0 |
|
209 */ |
|
210 virtual void SortContactLists() = 0; |
|
211 |
|
212 |
|
213 /** |
|
214 * From MVIMPSTStorageContacts |
|
215 */ |
|
216 virtual void Sort( const TDesC& aContactListId = KNullDesC ) = 0; |
|
217 |
|
218 /** |
|
219 * Resort one contact, what ever contact list it is in |
|
220 */ |
|
221 virtual void ResortContactInAll( MVIMPSTStorageContact* aContact ) = 0; |
|
222 |
|
223 /** |
|
224 * From MVIMPSTStorageContacts |
|
225 */ |
|
226 virtual void SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ) = 0; |
|
227 |
|
228 /** |
|
229 * add contact ot the virtual phonebook. |
|
230 * @param aContact contact id to be added. |
|
231 */ |
|
232 virtual MVIMPSTStorageContact* AddContactL( const TDesC& aFirstName = KNullDesC, |
|
233 const TDesC& aServiceField = KNullDesC ) = 0; |
|
234 |
|
235 |
|
236 /** |
|
237 * removes contact from the virtual phonebook. |
|
238 * @param aContact contact id to be removed. |
|
239 */ |
|
240 virtual void RemoveContactL( const MVPbkContactLink& aContactLink) = 0; |
|
241 |
|
242 /** |
|
243 * removes contact from the virtual phonebook. |
|
244 * @param aContact contact id to be removed. |
|
245 */ |
|
246 virtual void RemoveContactL( const TDesC& aServiceContactId) = 0; |
|
247 |
|
248 virtual void SetOwnDataL( const TDesC& aOwnId ) = 0; |
|
249 |
|
250 protected: |
|
251 /** |
|
252 * virtual destructor. |
|
253 */ |
|
254 virtual ~MVIMPSTStorageContacts(){}; |
|
255 }; |
|
256 |
|
257 #endif // MVIMPSTSTORAGECONTACTS_H |
|
258 |
|
259 // End of File |