|
1 /* |
|
2 * Copyright (c) 2007-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: implementation of presence notification handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPRESENCENOTIFICATIONHANDLER_H__ |
|
20 #define __CPRESENCENOTIFICATIONHANDLER_H__ |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <ximpbase.h> |
|
26 |
|
27 #include <presencecachewriter2.h> |
|
28 #include <mpresencebuddyinfo2.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 class MOSSProtocolConnectionManager; |
|
33 |
|
34 /** |
|
35 * CPresenceNotificationHandler |
|
36 * |
|
37 * Handles presnce notifications recieved from the server |
|
38 * and updates presence cache |
|
39 */ |
|
40 |
|
41 class CPresenceNotificationHandler: public CActive |
|
42 |
|
43 |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 static CPresenceNotificationHandler* NewL ( |
|
49 MOSSProtocolConnectionManager& aConnMan |
|
50 ); |
|
51 |
|
52 static CPresenceNotificationHandler* NewLC ( |
|
53 MOSSProtocolConnectionManager& aConnMan |
|
54 ); |
|
55 |
|
56 virtual ~CPresenceNotificationHandler(); |
|
57 |
|
58 private: |
|
59 |
|
60 CPresenceNotificationHandler ( MOSSProtocolConnectionManager& aConnMan ); |
|
61 void ConstructL(); |
|
62 |
|
63 private: // from CActive |
|
64 |
|
65 void DoCancel(); |
|
66 void RunL(); |
|
67 TInt RunError ( TInt aError ); |
|
68 |
|
69 public: |
|
70 /** |
|
71 * Start listening presence from the server |
|
72 */ |
|
73 void StartListeningL(); |
|
74 /** |
|
75 * Process the recieved presence from the server |
|
76 */ |
|
77 void ProcessIncomingDataL(); |
|
78 |
|
79 private: // data |
|
80 |
|
81 /** |
|
82 * Send data request to pure data handler generates the id |
|
83 */ |
|
84 TInt iSendId; |
|
85 /** |
|
86 * Presence cache writer |
|
87 * Own |
|
88 */ |
|
89 MPresenceCacheWriter2* iPresenceCacheWriter; |
|
90 |
|
91 /** |
|
92 * Oss Protocol Plugin Connection Manager |
|
93 * Not own. *** Write "Not own" if some other class owns this object. |
|
94 */ |
|
95 MOSSProtocolConnectionManager& iConnMan; |
|
96 |
|
97 }; |
|
98 |
|
99 |
|
100 #endif // __CPRESENCENOTIFICATIONHANDLER_H__ |
|
101 |