|
1 /* |
|
2 * Copyright (c) 2006 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 CPRESENCEPLUGINWINFO_H |
|
20 #define CPRESENCEPLUGINWINFO_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <ximpbase.h> |
|
24 #include <msimplewinfoobserver.h> |
|
25 |
|
26 #include "mpresencepluginconnectionobs.h" |
|
27 #include "presencelogger.h" |
|
28 |
|
29 class MSimpleWinfo; |
|
30 class TximpRequestId; |
|
31 class MSimpleWinfoWatcher; |
|
32 class MSimpleConnection; |
|
33 class MximpProtocolConnectionHost; |
|
34 class MPresencePluginConnectionObs; |
|
35 |
|
36 /** |
|
37 * CPresencePluginWinfo |
|
38 * |
|
39 * Simple Engine Connection |
|
40 * |
|
41 * @lib presenceplugin.dll |
|
42 * @since S60 v3.2 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CPresencePluginWinfo ): public CBase, |
|
45 public MSimpleWinfoObserver |
|
46 { |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Constructor. |
|
51 * @param aObs callback for complete requests |
|
52 * @param aConn Simple Engine connection |
|
53 */ |
|
54 static CPresencePluginWinfo* NewL( |
|
55 MPresencePluginConnectionObs& aObs, |
|
56 MSimpleConnection& aConn ); |
|
57 |
|
58 /** |
|
59 * Standard C++ destructor |
|
60 */ |
|
61 virtual ~CPresencePluginWinfo(); |
|
62 |
|
63 /** |
|
64 * SetHost |
|
65 * Set ximp Host |
|
66 * |
|
67 * @since S60 3.2 |
|
68 * @param aHost ximp Host |
|
69 */ |
|
70 void SetHost( MXIMPProtocolConnectionHost* aHost ); |
|
71 |
|
72 /** |
|
73 * SubscribeWinfoListL |
|
74 * |
|
75 * @since S60 3.2 |
|
76 * @param aReqId ximp req id |
|
77 */ |
|
78 void SubscribeWinfoListL( TXIMPRequestId aReqId ); |
|
79 |
|
80 /** |
|
81 * UnsubscribeWinfoListL |
|
82 * |
|
83 * @since S60 3.2 |
|
84 * @param aReqId ximp req id |
|
85 */ |
|
86 void UnsubscribeWinfoListL( TXIMPRequestId aReqId ); |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * Standard C++ constructor |
|
92 * |
|
93 * @param aObs, plugin connection observer |
|
94 * @param aConn, SIMPLE connection |
|
95 */ |
|
96 CPresencePluginWinfo( |
|
97 MPresencePluginConnectionObs& aObs, |
|
98 MSimpleConnection& aConn ); |
|
99 |
|
100 /** |
|
101 * Performs the 2nd phase of construction. |
|
102 */ |
|
103 void ConstructL( ); |
|
104 |
|
105 public: // from base class MSimpleWinfoObserver |
|
106 |
|
107 // Subscribe presence grant request list |
|
108 |
|
109 /** |
|
110 * Defined in a base class |
|
111 */ |
|
112 void WinfoReqCompleteL( TInt aOpid, TInt aStatus ); |
|
113 |
|
114 /** |
|
115 * Defined in a base class |
|
116 */ |
|
117 void WinfoTerminatedL( |
|
118 TInt aOpid, TInt aReason ); |
|
119 |
|
120 /** |
|
121 * Defined in a base class |
|
122 */ |
|
123 void WinfoNotificationL( MSimpleWinfo& aWinfo ); |
|
124 |
|
125 private: // Data |
|
126 |
|
127 /** |
|
128 * ximp Plugin connection observer |
|
129 * Own. |
|
130 */ |
|
131 MPresencePluginConnectionObs& iConnObs; |
|
132 |
|
133 /** |
|
134 * ximp Host. |
|
135 * Not Own. |
|
136 */ |
|
137 MXIMPProtocolConnectionHost* iHost; |
|
138 |
|
139 /** |
|
140 * SIMPLE engine connection |
|
141 */ |
|
142 MSimpleConnection& iConnection; |
|
143 |
|
144 /** |
|
145 * SIMPLE engine winfo watcher. |
|
146 * Own. |
|
147 */ |
|
148 MSimpleWinfoWatcher* iWinfoWatcher; |
|
149 |
|
150 /** |
|
151 * ximp request id |
|
152 * Own. |
|
153 */ |
|
154 TXIMPRequestId iXIMPId; |
|
155 |
|
156 /** |
|
157 * Simple Engine request id |
|
158 * Own. |
|
159 */ |
|
160 TInt iSimpleId; |
|
161 |
|
162 /** |
|
163 * Subscribed |
|
164 * Own. |
|
165 */ |
|
166 TBool iSubscribed; |
|
167 |
|
168 /** |
|
169 * Winfo subscribe completed |
|
170 * Own. |
|
171 */ |
|
172 TBool iWinfoCompleted; |
|
173 |
|
174 SIMPLE_UNIT_TEST( T_CPresencePluginAuthorization ) |
|
175 SIMPLE_UNIT_TEST( T_CPresencePluginWinfo ) |
|
176 SIMPLE_UNIT_TEST( CSimpleDataModelAdapterTestObserver ) |
|
177 }; |
|
178 |
|
179 #endif // CPRESENCEPLUGINWINFO_H |