1 /* |
|
2 * Copyright (c) 2006-2010 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: IETF SIMPLE Protocol implementation for XIMP Framework |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPRESENCEPLUGINGROUP_H |
|
20 #define CPRESENCEPLUGINGROUP_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <ximpbase.h> |
|
24 #include <protocolpresentitygroups.h> |
|
25 |
|
26 #include "presenceplugincommon.h" |
|
27 #include "mpresencepluginconnectionobs.h" |
|
28 #include "presencelogger.h" |
|
29 |
|
30 class TXIMPRequestId; |
|
31 class MXIMPIdentity; |
|
32 class MXIMPProtocolPresentityGroupsDataHost; |
|
33 class MXIMPObjectCollection; |
|
34 class CPresencePluginVirtualGroup; |
|
35 class CPresencePluginData; |
|
36 |
|
37 /** |
|
38 * CPresencePluginGroups |
|
39 * |
|
40 * Simple Engine Connection |
|
41 * |
|
42 * @lib presenceplugin.dll |
|
43 * @since S60 v3.2 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CPresencePluginGroups ) : public CActive, |
|
46 public MProtocolPresentityGroups |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Current operation |
|
52 */ |
|
53 enum TPluginGroupsOperation |
|
54 { |
|
55 ENoOperation, |
|
56 ECreatePresentityGroup, |
|
57 EDeletePresentityGroup, |
|
58 EAddPresentityGroupMember, |
|
59 EGrantPresentityGroupMember, |
|
60 ERemovePresentityGroupMember, |
|
61 EWithdrawGrantFromMember, |
|
62 EGetListOfLists, |
|
63 EGetListContent, |
|
64 EBlockPresentityGroupMember, |
|
65 EUnblockPresentityGroupMember, |
|
66 EUnblockInAddPresentityGroupMember |
|
67 }; |
|
68 |
|
69 /** |
|
70 * Current actibe object state |
|
71 */ |
|
72 enum TPluginGroupsState |
|
73 { |
|
74 EPluginIdle, |
|
75 EPluginInitXdm, |
|
76 EPluginFetchRls, |
|
77 EPluginAddGroupMember, |
|
78 EPluginRemoveGroupMember, |
|
79 EPluginCommitRls, |
|
80 EPluginCommitXdm |
|
81 }; |
|
82 |
|
83 /** |
|
84 * Constructor. |
|
85 * @param aObs callback for complete requests |
|
86 * @param aConn Simple Engine connection |
|
87 */ |
|
88 static CPresencePluginGroups* NewL( |
|
89 MPresencePluginConnectionObs& aObs, |
|
90 CPresencePluginVirtualGroup* aSubscribedBuddies, |
|
91 CPresencePluginData* aPresenceData ); |
|
92 |
|
93 /** |
|
94 * Constructor. |
|
95 * @param aObs callback for complete requests |
|
96 * @param aConn Simple Engine connection |
|
97 */ |
|
98 static CPresencePluginGroups* NewLC( |
|
99 MPresencePluginConnectionObs& aObs, |
|
100 CPresencePluginVirtualGroup* aSubscribedBuddies, |
|
101 CPresencePluginData* aPresenceData ); |
|
102 |
|
103 /** |
|
104 * Standard C++ destructor |
|
105 */ |
|
106 virtual ~CPresencePluginGroups(); |
|
107 |
|
108 private: |
|
109 |
|
110 /** |
|
111 * Standard C++ constructor |
|
112 */ |
|
113 CPresencePluginGroups( |
|
114 MPresencePluginConnectionObs& aObs, |
|
115 CPresencePluginVirtualGroup* aSubscribedBuddies, |
|
116 CPresencePluginData* aPresenceData ); |
|
117 |
|
118 public: // from base class MXIMPBase |
|
119 |
|
120 /** |
|
121 * Defined in a base class |
|
122 */ |
|
123 TAny* GetInterface( |
|
124 TInt32 aInterfaceId, |
|
125 TIfGetOps aOps ); |
|
126 |
|
127 /** |
|
128 * Defined in a base class |
|
129 */ |
|
130 const TAny* GetInterface( |
|
131 TInt32 aInterfaceId, |
|
132 TIfGetOps aOps ) const; |
|
133 |
|
134 /** |
|
135 * Defined in a base class |
|
136 */ |
|
137 TInt32 GetInterfaceId() const; |
|
138 |
|
139 |
|
140 public: // from base class MXIMPProtocolPresentityGroups |
|
141 |
|
142 /** |
|
143 * Defined in a base class |
|
144 */ |
|
145 void DoSubscribePresentityGroupListL( |
|
146 TXIMPRequestId aReqId ); |
|
147 |
|
148 /** |
|
149 * Defined in a base class |
|
150 */ |
|
151 void DoUnsubscribePresentityGroupListL( |
|
152 TXIMPRequestId aReqId ); |
|
153 |
|
154 /** |
|
155 * Defined in a base class |
|
156 */ |
|
157 void DoCreatePresentityGroupL( |
|
158 const MXIMPIdentity& aGroupId, |
|
159 const TDesC16& aDisplayName, |
|
160 TXIMPRequestId aReqId ); |
|
161 |
|
162 /** |
|
163 * Defined in a base class |
|
164 */ |
|
165 void DoDeletePresentityGroupL( |
|
166 const MXIMPIdentity& aGroupId, |
|
167 TXIMPRequestId aReqId ); |
|
168 |
|
169 /** |
|
170 * Defined in a base class |
|
171 */ |
|
172 void DoUpdatePresentityGroupDisplayNameL( |
|
173 const MXIMPIdentity& aGroupId, |
|
174 const TDesC16& aDisplayName, |
|
175 TXIMPRequestId aReqId ); |
|
176 |
|
177 /** |
|
178 * Defined in a base class |
|
179 */ |
|
180 void DoSubscribePresentityGroupContentL( |
|
181 const MXIMPIdentity& aGroupId, |
|
182 TXIMPRequestId aReqId ); |
|
183 |
|
184 /** |
|
185 * Defined in a base class |
|
186 */ |
|
187 void DoUnsubscribePresentityGroupContentL( |
|
188 const MXIMPIdentity& aGroupId, |
|
189 TXIMPRequestId aReqId ); |
|
190 |
|
191 /** |
|
192 * Defined in a base class |
|
193 */ |
|
194 void DoAddPresentityGroupMemberL( |
|
195 const MXIMPIdentity& aGroupId, |
|
196 const MXIMPIdentity& aMemberId, |
|
197 const TDesC16& aMemberDisplayName, |
|
198 TXIMPRequestId aReqId ); |
|
199 |
|
200 /** |
|
201 * Defined in a base class |
|
202 */ |
|
203 void DoRemovePresentityGroupMemberL( |
|
204 const MXIMPIdentity& aGroupId, |
|
205 const MXIMPIdentity& aMemberId, |
|
206 TXIMPRequestId aReqId ); |
|
207 |
|
208 /** |
|
209 * Defined in a base class |
|
210 */ |
|
211 void DoUpdatePresentityGroupMemberDisplayNameL( |
|
212 const MXIMPIdentity& aGroupId, |
|
213 const MXIMPIdentity& aMemberId, |
|
214 const TDesC16& aMemberDisplayName, |
|
215 TXIMPRequestId aReqId ); |
|
216 |
|
217 protected: // from base class CActive |
|
218 |
|
219 /** |
|
220 * Defined in a base class |
|
221 */ |
|
222 void RunL(); |
|
223 |
|
224 /** |
|
225 * Defined in a base class |
|
226 */ |
|
227 TInt RunError( TInt aError ); |
|
228 |
|
229 /** |
|
230 * Defined in a base class |
|
231 */ |
|
232 void DoCancel(); |
|
233 |
|
234 private: |
|
235 |
|
236 /** |
|
237 * Save presentity id |
|
238 * |
|
239 * @since S60 3.2 |
|
240 * @param aPresentityId presentity id |
|
241 * @param aFormatUri, attempt to format uri |
|
242 * @return none |
|
243 */ |
|
244 void SetPresIdentityL( |
|
245 const MXIMPIdentity& aPresentityId, |
|
246 TBool aFormatUri ); |
|
247 |
|
248 /** |
|
249 * Calls MXIMPProtocolConnectionHost callback |
|
250 * |
|
251 * @since S60 3.2 |
|
252 * @param aStatus error status |
|
253 * @return none |
|
254 */ |
|
255 void CompleteXIMPReq( TInt aStatus ); |
|
256 |
|
257 /** |
|
258 * Start XDM operation |
|
259 * |
|
260 * @since S60 3.2 |
|
261 * @param aReqId, request id |
|
262 * @param aOperation, groups operation |
|
263 * @return none |
|
264 */ |
|
265 void StartXdmOperationL( |
|
266 TXIMPRequestId aReqId, |
|
267 TPluginGroupsOperation aOperation ); |
|
268 |
|
269 /** |
|
270 * Start XDM operation |
|
271 * |
|
272 * @since S60 3.2 |
|
273 * @param aReqId, request id |
|
274 * @param aOperation, groups operation |
|
275 * @return none |
|
276 */ |
|
277 void StartXdmOperationL( |
|
278 const MXIMPIdentity& aId, |
|
279 TXIMPRequestId aReqId, |
|
280 TPluginGroupsOperation aOperation ); |
|
281 |
|
282 /** |
|
283 * Start XDM operation |
|
284 * |
|
285 * @since S60 3.2 |
|
286 * @param none |
|
287 * @return none |
|
288 */ |
|
289 void StartXdmOperationL(); |
|
290 |
|
291 /** |
|
292 * Call actual XDM operation |
|
293 * |
|
294 * @since S60 3.2 |
|
295 * @param aCompleteStatus, success or not |
|
296 * @return none |
|
297 */ |
|
298 void CallActualXdmOperationL( TInt aCompleteStatus ); |
|
299 |
|
300 /** |
|
301 * Get List of lists |
|
302 * |
|
303 * @since S60 3.2 |
|
304 * @param none |
|
305 * @return none |
|
306 */ |
|
307 void GetListOfListsL(); |
|
308 |
|
309 /** |
|
310 * Get List content |
|
311 * |
|
312 * @since S60 3.2 |
|
313 * @param none |
|
314 * @return none |
|
315 */ |
|
316 void GetListContentL(); |
|
317 |
|
318 /** |
|
319 * Do Get BuddyList form XDM list |
|
320 * |
|
321 * @since S60 3.2 |
|
322 * @param none |
|
323 * @return none |
|
324 */ |
|
325 void DoGetBuddyListL(); |
|
326 |
|
327 /** |
|
328 * Do Get subscribed BuddyList form virtual list |
|
329 * |
|
330 * @since S60 3.2 |
|
331 * @param none |
|
332 * @return none |
|
333 */ |
|
334 void DoGetSubscribedBuddyListL(); |
|
335 |
|
336 /** |
|
337 * Removes cache entries for certain person. |
|
338 * |
|
339 * @since S60 5.0 |
|
340 * @param none |
|
341 * @return none |
|
342 */ |
|
343 void DeletePersonCacheL(); |
|
344 |
|
345 private: // Data |
|
346 |
|
347 /** |
|
348 * XIMP Plugin connection observer |
|
349 * Own. |
|
350 */ |
|
351 MPresencePluginConnectionObs& iConnObs; |
|
352 |
|
353 /** |
|
354 * XDM Settings id |
|
355 * Own. |
|
356 */ |
|
357 TInt iSettingsId; |
|
358 |
|
359 /** |
|
360 * PrFW request id |
|
361 * Own. |
|
362 */ |
|
363 TXIMPRequestId iXIMPId; |
|
364 |
|
365 /** |
|
366 * PrFW request id for own requests |
|
367 * Own. |
|
368 */ |
|
369 TXIMPRequestId iXIMPIdOwn; |
|
370 |
|
371 /** |
|
372 * Simple Engine request id |
|
373 * Own. |
|
374 */ |
|
375 TInt iSimpleId; |
|
376 |
|
377 /** |
|
378 * Current operation |
|
379 * Own. |
|
380 */ |
|
381 TPluginGroupsOperation iOperation; |
|
382 |
|
383 /** |
|
384 * Current presentity in progress |
|
385 * Own. |
|
386 */ |
|
387 HBufC16* iPresIdentity; |
|
388 |
|
389 /** |
|
390 * XDM Utils |
|
391 * Not own. |
|
392 */ |
|
393 CPresencePluginXdmUtils* iXdmUtils; |
|
394 |
|
395 /** |
|
396 * Display name |
|
397 * Own |
|
398 */ |
|
399 HBufC* iDisplayName; |
|
400 |
|
401 /** |
|
402 * Active object state |
|
403 * Own. |
|
404 */ |
|
405 TPluginGroupsState iState; |
|
406 |
|
407 /** |
|
408 * Group request complete |
|
409 * Own. |
|
410 */ |
|
411 TBool iCompleted; |
|
412 |
|
413 /** |
|
414 * Virtual groups |
|
415 * Not Own |
|
416 */ |
|
417 CPresencePluginVirtualGroup* iSubscribedBuddies; |
|
418 |
|
419 /** |
|
420 * Plugin data. |
|
421 * Not Own |
|
422 */ |
|
423 CPresencePluginData* iPresenceData; |
|
424 |
|
425 SIMPLE_UNIT_TEST( T_CPresencePluginGroups ) |
|
426 }; |
|
427 |
|
428 #endif // CPRESENCEPLUGINGROUP_H |
|