|
1 /* |
|
2 * Copyright (c) 2005 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: Contact list transaction manager |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CPENGCONTACTLISTTRANSACTIONMANAGER_H__ |
|
19 #define __CPENGCONTACTLISTTRANSACTIONMANAGER_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include "MPEngTransactionFactory.h" |
|
24 #include "CPEngContactListManagerBase.h" |
|
25 #include "MPEngContactListTransactionManager.h" |
|
26 #include "PEngWVCspVersion.h" |
|
27 #include <e32base.h> |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Contact List transaction manager |
|
33 * This class is used to get transaction handler |
|
34 * to update content of the contact list with WV server |
|
35 * |
|
36 * @lib PEngListLib2 |
|
37 * @since 3.0 |
|
38 */ |
|
39 NONSHARABLE_CLASS( CPEngContactListTransactionManager ) : |
|
40 public CPEngContactListManagerBase, |
|
41 public MPEngTransactionFactory, |
|
42 public MPEngContactListTransactionManager |
|
43 { |
|
44 public: // Two-phased constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 static CPEngContactListTransactionManager* NewLC( |
|
50 MPEngListLibFactory& aFactory, |
|
51 const CPEngSessionSlotId& aSessionSlot, |
|
52 TPEngWVCspVersion& aCSPVersion ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CPEngContactListTransactionManager(); |
|
58 |
|
59 |
|
60 public: // From MPEngTransactionFactory |
|
61 |
|
62 /** |
|
63 * Clean up stack support for the factory |
|
64 * @see <MPEngTransactionFactory.h> |
|
65 */ |
|
66 void Close(); |
|
67 |
|
68 |
|
69 /** |
|
70 * Factory method to create handler for incoming data |
|
71 * @see <MPEngTransactionFactory.h> |
|
72 */ |
|
73 MPEngIncomingTransactionHandler* IncomingTransactionHandlerL( |
|
74 const TDesC8& aIncomingRequest ); |
|
75 |
|
76 /** |
|
77 * Factory method to create outgoing handler(s) |
|
78 * @see <MPEngTransactionFactory.h> |
|
79 */ |
|
80 void OutgoingTransactionHandlerL( |
|
81 TInt aOperation, |
|
82 const TDesC& aData, |
|
83 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers ); |
|
84 |
|
85 |
|
86 |
|
87 public: // From MPEngContactListTransactionManager |
|
88 |
|
89 /** |
|
90 * Complete enviroment sync |
|
91 * @see <MPEngContactListTransactionManager.h> |
|
92 */ |
|
93 void CompleteEnviromentSyncL( CDesCArray& aExistingLists, |
|
94 const TDesC& aDefaultList, |
|
95 TBool aListsUnsubscribed ); |
|
96 |
|
97 |
|
98 /** |
|
99 * Domain of the active session if it available. |
|
100 * @see <MPEngContactListTransactionManager.h> |
|
101 */ |
|
102 const TDesC& UserDomain(); |
|
103 |
|
104 |
|
105 /** |
|
106 * Default contact list settings or NULL if no |
|
107 * default list defined. |
|
108 * @see <MPEngContactListTransactionManager.h> |
|
109 */ |
|
110 CPEngContactListSettings* DefaultCntListSettingsOrNull(); |
|
111 |
|
112 |
|
113 /** |
|
114 * Complete contact list deletion. |
|
115 * @see <MPEngContactListSettingsManager.h> |
|
116 */ |
|
117 void CompleteCntListDeletionL( const TDesC& aContactList ); |
|
118 |
|
119 |
|
120 |
|
121 private: // new functions |
|
122 |
|
123 |
|
124 /** |
|
125 * Get outgoing transaction handlers |
|
126 * @since 3.0 |
|
127 * @param aData packed store Ids |
|
128 * @param aTransactionHandlers array to store those new handlers |
|
129 * @param aOperationId The operation Id |
|
130 */ |
|
131 void GetOutGoingTransactionHandlersL( |
|
132 const TDesC& aData, |
|
133 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
134 TInt aOperationId ); |
|
135 |
|
136 /** |
|
137 * Creates contact list update handlers |
|
138 * @since 3.0 |
|
139 * @param aContactList The contact list which needs to be updated |
|
140 * @param aTransactionHandlers array to store those new handlers |
|
141 * @param aOperationId The operation Id |
|
142 */ |
|
143 void GetContactListsUpdateHandlersL( |
|
144 CPEngContactListModBase& aContactList, |
|
145 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
146 TInt aOperationId ); |
|
147 |
|
148 /** |
|
149 * Creates contact lists sync handlers |
|
150 * |
|
151 * @since 3.0 |
|
152 * @param aContactList The contact list which needs to be synhronized |
|
153 * @param aTransactionHandlers array to store those new handlers |
|
154 * @param aOperationId The operation Id |
|
155 */ |
|
156 void GetContactListsSyncHandlersL( |
|
157 CPEngContactListModBase& aContactList, |
|
158 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
159 TInt aOperationId ); |
|
160 |
|
161 /** |
|
162 * Create contact list delete handlers |
|
163 * |
|
164 * @since 3.0 |
|
165 * @param aContactList The contact list which needs to be deleted |
|
166 * @param aTransactionHandlers array to store those new handlers |
|
167 * @param aOperationId The operation Id |
|
168 */ |
|
169 void GetDeleteCntListHandlerL( |
|
170 CPEngContactListModBase& aModel, |
|
171 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
172 TInt aOperationId ); |
|
173 |
|
174 /** |
|
175 * Get contact list update properties handlers |
|
176 * |
|
177 * @since 3.0 |
|
178 * @param aContactList The contact list which needs to be updated |
|
179 * @param aTransactionHandlers array to store those new handlers |
|
180 * @param aOperationId The operation Id |
|
181 */ |
|
182 void GetUpdateCntListPropertiesHandlerL( |
|
183 CPEngContactListModBase& aModel, |
|
184 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
185 TInt aOperationId ); |
|
186 |
|
187 /** |
|
188 * Get Contact list update handlers for existing contact list |
|
189 * |
|
190 * @since 3.0 |
|
191 * @param aContactList The contact list which needs to be updated |
|
192 * @param aTransactionHandlers array to store those new handlers |
|
193 * @param aOperationId The operation Id |
|
194 */ |
|
195 void GetUpdateHandlersForExistingCntListL( |
|
196 CPEngContactListModBase& aModel, |
|
197 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
198 TInt aOperationId ); |
|
199 |
|
200 /** |
|
201 * Get Contact list update handlers for not existing contact list |
|
202 * |
|
203 * @since 3.0 |
|
204 * @param aContactList The contact list which needs to be updated |
|
205 * @param aTransactionHandlers array to store those new handlers |
|
206 * @param aOperationId The operation Id |
|
207 */ |
|
208 void GetUpdateHandlersForNotExistingCntListL( |
|
209 CPEngContactListModBase& aModel, |
|
210 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
211 TInt aOperationId ); |
|
212 |
|
213 /** |
|
214 * Get Watcher list update handler |
|
215 * |
|
216 * @since 3.0 |
|
217 * @param aContactList The watcher contact list |
|
218 * @param aTransactionHandlers array to store those new handlers |
|
219 * @param aOperationId The operation Id |
|
220 */ |
|
221 void GetWatcherListHandlerL( |
|
222 CPEngContactListModBase& aModel, |
|
223 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
224 TInt aOperationId ); |
|
225 |
|
226 /** |
|
227 * Get One contact list synchronize handler |
|
228 * |
|
229 * @since 3.0 |
|
230 * @param aContactList The contact list which needs to be synhronized |
|
231 * @param aTransactionHandlers array to store those new handlers |
|
232 * @return ETrue if there was hanler/s created, else EFalse. |
|
233 */ |
|
234 void GetSynchronizeOneCntListHandlerL( |
|
235 CPEngContactListModBase& aModel, |
|
236 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
237 TInt aOperationId ); |
|
238 |
|
239 /** |
|
240 * Get transaction handlers to update subscription of the contact list |
|
241 * |
|
242 * @since 3.0 |
|
243 * @param aContactList The contact list which needs to be synhronized |
|
244 * @param aTransactionHandlers array to store those new handlers |
|
245 * @return ETrue if there was hanler/s created, else EFalse. |
|
246 */ |
|
247 void GetSubscriptionUpdateHandlerL( |
|
248 CPEngContactListModBase& aModel, |
|
249 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
250 TInt aOperationId ); |
|
251 |
|
252 |
|
253 /** |
|
254 * Templated function to create hander with one template parameter. |
|
255 */ |
|
256 template < class THandlerClass, |
|
257 class TParam1 > |
|
258 void CreateHandler1ParamL( |
|
259 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
260 TParam1 aParam1, |
|
261 TPEngWVCspVersion& aParam2, |
|
262 TInt aParam3 ); |
|
263 |
|
264 /** |
|
265 * Templated function to create hander with two template parameter. |
|
266 */ |
|
267 template < class THandlerClass, |
|
268 class TParam1, |
|
269 class TParam2 > |
|
270 void CreateHandler2ParamL( |
|
271 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
272 TParam1 aParam1, |
|
273 TParam2 aParam2, |
|
274 TPEngWVCspVersion& aParam3, |
|
275 TInt aParam4 ); |
|
276 |
|
277 /** |
|
278 * Templated function to create hander with three template parameter. |
|
279 */ |
|
280 template < class THandlerClass, |
|
281 class TParam1, |
|
282 class TParam2, |
|
283 class TParam3 > |
|
284 void CreateHandler3ParamL( |
|
285 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers, |
|
286 TParam1 aParam1, |
|
287 TParam2 aParam2, |
|
288 TParam3 aParam3, |
|
289 TPEngWVCspVersion& aParam4, |
|
290 TInt aParam5 ); |
|
291 |
|
292 |
|
293 /** |
|
294 * Initializes plain user id. |
|
295 * @since 3.0 |
|
296 */ |
|
297 void InitializePlainUserId(); |
|
298 |
|
299 |
|
300 /** |
|
301 * Clean contact list settings for creation. |
|
302 * @since 3.0 |
|
303 */ |
|
304 void CleanContactListSettingsForListCreationL( |
|
305 CPEngContactListSettings& aSettings ); |
|
306 |
|
307 |
|
308 private: // constructors |
|
309 |
|
310 /** |
|
311 * C++ constructor. |
|
312 */ |
|
313 CPEngContactListTransactionManager( MPEngListLibFactory& aFactory, |
|
314 TPEngWVCspVersion& aCSPVersion ); |
|
315 |
|
316 /** |
|
317 * Symbian constructor. |
|
318 */ |
|
319 void ConstructL( const CPEngSessionSlotId& aSessionSlot ); |
|
320 |
|
321 private: // Data |
|
322 |
|
323 /// OWN: Plain user name |
|
324 TPtrC iPlainUserName; |
|
325 |
|
326 /// REF: CSP Version |
|
327 TPEngWVCspVersion& iCSPVersion; |
|
328 |
|
329 }; |
|
330 |
|
331 #endif // __CPENGCONTACTLISTTRANSACTIONMANAGER_H__ |
|
332 |
|
333 |
|
334 // End of File |
|
335 |