|
1 /* |
|
2 * Copyright (c) 2002-2007 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: An API for SIM stores |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MVPBKSIMCNTSTORE_H |
|
21 #define MVPBKSIMCNTSTORE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include "VPbkSimStoreCommon.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MVPbkSimContactObserver; |
|
29 class MVPbkSimStoreObserver; |
|
30 class RVPbkSimFieldTypeArray; |
|
31 class MVPbkSimCntView; |
|
32 class MVPbkSimFindObserver; |
|
33 class MVPbkSimContact; |
|
34 class CVPbkETelCntConverter; |
|
35 class MVPbkSimStoreOperation; |
|
36 struct TVPbkGsmStoreProperty; |
|
37 struct TVPbkUSimStoreProperty; |
|
38 class CVPbkSimFieldTypeFilter; |
|
39 class RVPbkStreamedIntArray; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * An API for SIM contact stores. |
|
45 * |
|
46 */ |
|
47 class MVPbkSimCntStore |
|
48 { |
|
49 public: // Interface |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~MVPbkSimCntStore() {} |
|
55 |
|
56 /** |
|
57 * Returns the store identifier |
|
58 * |
|
59 * @return The store identifier. |
|
60 */ |
|
61 virtual TVPbkSimStoreIdentifier Identifier() const = 0; |
|
62 |
|
63 /** |
|
64 * Opens the store asynchronously. |
|
65 * Calls back the observers attached to this contact store when the |
|
66 * opening completes. |
|
67 * |
|
68 * @param aObserver Observer. |
|
69 */ |
|
70 virtual void OpenL( |
|
71 MVPbkSimStoreObserver& aObserver ) = 0; |
|
72 |
|
73 /** |
|
74 * Closes this contact store from a single observer. The observer will |
|
75 * no longer receive events from this store. |
|
76 * |
|
77 * @param aObserver Observer. |
|
78 */ |
|
79 virtual void Close( |
|
80 MVPbkSimStoreObserver& aObserver ) = 0; |
|
81 |
|
82 /** |
|
83 * Creates a new contact view that contains the contacts of this |
|
84 * store. |
|
85 * |
|
86 * If the view is a shared view and it has already been created |
|
87 * then aSortOrder and aConstructionPolicy will be ignored. |
|
88 * |
|
89 * @param aSortOrder The sort order for the view. |
|
90 * @param aConstructionPolicy Defines the way the view |
|
91 * is constructed. |
|
92 * @param aFilter Field type filter. The view |
|
93 * will contain only contacts |
|
94 * having the field types of the filter. |
|
95 * Ownership of the filter must be taken. |
|
96 * @return A new contact view. |
|
97 */ |
|
98 virtual MVPbkSimCntView* CreateViewL( |
|
99 const RVPbkSimFieldTypeArray& aSortOrder, |
|
100 TVPbkSimViewConstructionPolicy aConstructionPolicy, |
|
101 const TDesC& aViewName, |
|
102 CVPbkSimFieldTypeFilter* aFilter ) = 0; |
|
103 |
|
104 /** |
|
105 * Returns a reference to the contact in ETel format or NULL. |
|
106 * |
|
107 * Client can not save the reference for later use because |
|
108 * next call to ContactAtL can invalidate the saved reference. |
|
109 * |
|
110 * @param aSimIndex The index of the contact in the store. |
|
111 * @return The ETel contact or NULL if the given index is empty |
|
112 */ |
|
113 virtual const TDesC8* AtL( TInt aSimIndex ) = 0; |
|
114 |
|
115 /** |
|
116 * Returns a reference to the contact or NULL. |
|
117 * |
|
118 * Client can not save the reference for later use because |
|
119 * next call to ContactAtL can invalidate the saved reference. |
|
120 * |
|
121 * @param aSimIndex The index of the contact in the store. |
|
122 * @return The contact or NULL if the given index is empty |
|
123 */ |
|
124 virtual const MVPbkSimContact* ContactAtL( TInt aSimIndex ) = 0; |
|
125 |
|
126 /** |
|
127 * Saves a contact asynchronously into the store. |
|
128 * It's not possible to call this if saving is already in progress. |
|
129 * |
|
130 * @param aData The contact data in the format defined |
|
131 * by the Symbian MM ETel (CPhoneBookBuffer). |
|
132 * @param aSimIndex The index for the contact or |
|
133 * VPbkSimStoreImpl::KFirstFreeSimIndex if |
|
134 * new contact (after saving the index |
|
135 * contains the new index). |
|
136 * @param aObserver The observer that is notified after saving. |
|
137 * @return a handle to an asynchrnous operation. Client |
|
138 * has the ownership and can cancel the operation |
|
139 * by deleting the operation |
|
140 */ |
|
141 virtual MVPbkSimStoreOperation* SaveL( |
|
142 const TDesC8& aData, |
|
143 TInt& aSimIndex, |
|
144 MVPbkSimContactObserver& aObserver ) = 0; |
|
145 |
|
146 /** |
|
147 * Deletes a contacts asynchronously from the store. |
|
148 * It's not possible to call this if deleting is already in progress. |
|
149 * |
|
150 * @param aSimIndexes array of contacts to be delete |
|
151 * @param aObserver the observer that is notified after deleting. |
|
152 * @return a handle to an asynchrnous operation. Client |
|
153 * has the ownership and can cancel the operation |
|
154 * by deleting the operation |
|
155 * @exception operation completes with KErrArgument if aSimIndexes |
|
156 * is empty or contains only invalid SIM indexes. |
|
157 */ |
|
158 virtual MVPbkSimStoreOperation* DeleteL( |
|
159 RVPbkStreamedIntArray& aSimIndexes, |
|
160 MVPbkSimContactObserver& aObserver ) = 0; |
|
161 |
|
162 /** |
|
163 * Fills the GSM store properties |
|
164 * |
|
165 * @param aGsmProperties The GSM store properties. |
|
166 * @return KErrNone if properties were successfully set. General error code. |
|
167 */ |
|
168 virtual TInt GetGsmStoreProperties( |
|
169 TVPbkGsmStoreProperty& aGsmProperties ) const = 0; |
|
170 |
|
171 /** |
|
172 * Fills the USIM store properties. If the store doesn't support |
|
173 * USIM properties then all the values are KVPbkSimStorePropertyUndefined |
|
174 * |
|
175 * @param aUSimProperties The USIM store properties. |
|
176 * @return KErrNone if properties were successfully set. General error code. |
|
177 */ |
|
178 virtual TInt GetUSimStoreProperties( |
|
179 TVPbkUSimStoreProperty& aUSimProperties ) const = 0 ; |
|
180 |
|
181 /** |
|
182 * Returns the contact converter that is used to convert |
|
183 * native contacts to ETel contacts an vice versa. |
|
184 * |
|
185 * @return A contact converter for native contact versus |
|
186 * ETel contact conversion. |
|
187 */ |
|
188 virtual const CVPbkETelCntConverter& ContactConverter() const = 0; |
|
189 |
|
190 /** |
|
191 * Finds a contact match for the phone number. |
|
192 * |
|
193 * @param aPhoneNumber The phone number to look for. |
|
194 * @param aMaxMatchDigits The maximum amount of digits to compare |
|
195 * from the end of the number. |
|
196 * @param aObserver The observer that is notified |
|
197 * with results. |
|
198 * @return Match phone number operation. |
|
199 */ |
|
200 virtual MVPbkSimStoreOperation* CreateMatchPhoneNumberOperationL( |
|
201 const TDesC& aPhoneNumber, |
|
202 TInt aMaxMatchDigits, |
|
203 MVPbkSimFindObserver& aObserver ) = 0; |
|
204 |
|
205 /** |
|
206 * Finds a contact match for a string. |
|
207 * |
|
208 * @param aStringToFind The string to look for. |
|
209 * @param aFieldTypes The types of the fields to find from. |
|
210 * @param aObserver The observer that is notified with results. |
|
211 * @return Find operation. |
|
212 */ |
|
213 virtual MVPbkSimStoreOperation* CreateFindOperationL( |
|
214 const TDesC& aStringToFind, |
|
215 RVPbkSimFieldTypeArray& aFieldTypes, |
|
216 MVPbkSimFindObserver& aObserver ) = 0; |
|
217 |
|
218 /** |
|
219 * Returns the maximum phonenumber length defined in Virtual Phonebook |
|
220 * Central Repository settings |
|
221 * |
|
222 * @return the system maximum length for phonenumber |
|
223 */ |
|
224 virtual TInt SystemPhoneNumberMaxLength() const = 0; |
|
225 }; |
|
226 |
|
227 #endif // MVPBKSIMCNTSTORE_H |
|
228 |
|
229 // End of File |