51
|
1 |
/*
|
|
2 |
* Copyright (c) 2006, 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: Interface for presence protocol connection object.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef MXIMPFWPROTOCOLCONNECTION_H
|
|
19 |
#define MXIMPFWPROTOCOLCONNECTION_H
|
|
20 |
|
|
21 |
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <badesca.h>
|
|
24 |
#include <ximpprotocolpluginifids.hrh>
|
|
25 |
#include <ximpbase.h>
|
|
26 |
|
|
27 |
|
|
28 |
class MXIMPContextClientInfo;
|
|
29 |
class MXIMPProtocolConnectionHost;
|
|
30 |
class MProtocolPresenceFeatures;
|
|
31 |
class MProtocolImFeatures;
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Interface for presence protocol connection object.
|
|
37 |
* Interface must be implemented by a XIMP Framework protocol
|
|
38 |
* plug-ins.
|
|
39 |
*
|
|
40 |
* This interface models a connection from XIMP Framework to
|
|
41 |
* single remote presence service, over certain presence protocol
|
|
42 |
* implementation. XIMP Framework calls methods on this interface
|
|
43 |
* based on XIMP Framework client requests.
|
|
44 |
*
|
|
45 |
* XIMP Framework retrieves MXIMPProtocolConnection
|
|
46 |
* instances through MXIMPProtocolPlugin::AcquireConnectionL().
|
|
47 |
* Same MXIMPProtocolConnection instance may be returned by multiple
|
|
48 |
* MXIMPProtocolPlugin::AcquireConnectionL() calls. In this case
|
|
49 |
* XIMP Framework shares MXIMPProtocolConnection instance
|
|
50 |
* by multiple clients, and MXIMPProtocolConnection lifetime is
|
|
51 |
* extended over utilizing client sessions. When last utilizing
|
|
52 |
* client session is succesfully closed with
|
|
53 |
* MXIMPProtocolConnection::CloseSession(), XIMP Framework
|
|
54 |
* disposes the MXIMPProtocolConnection instance with
|
|
55 |
* MXIMPProtocolPlugin::ReleaseConnection().
|
|
56 |
*
|
|
57 |
*
|
|
58 |
* MXIMPProtocolConnection implementation must provide
|
|
59 |
* access following feature specific sub-interfaces:
|
|
60 |
* - MProtocolPresenceWatching
|
|
61 |
* - MProtocolPresencePublishing
|
|
62 |
* - MProtocolPresentityGroups
|
|
63 |
* - MProtocolPresenceAuthorization
|
|
64 |
*
|
|
65 |
* Each provided sub-interface defines a set of its own
|
|
66 |
* presence managements requests, relating to presence watching
|
|
67 |
* and subscribing, presence publication, presentity groups and
|
|
68 |
* presentity group member management and to presence authorizations.
|
|
69 |
* XIMP Framework calls these sub-interfaces to request on
|
|
70 |
* spesific presence requests from protocol connection.
|
|
71 |
*
|
|
72 |
* @see MXIMPProtocolConnectionHost
|
|
73 |
* @ingroup ximpprotocolpluginapi
|
|
74 |
* @since S60 v3.2
|
|
75 |
*/
|
|
76 |
class MXIMPProtocolConnection : public MXIMPBase
|
|
77 |
{
|
|
78 |
public:
|
|
79 |
|
|
80 |
/** Interface ID for the MXIMPProtocolConnection. */
|
|
81 |
enum { KInterfaceId = XIMP_IF_ID_PROTOCOL_CONNECTION };
|
|
82 |
|
|
83 |
|
|
84 |
protected:
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Protected destructor. MXIMPProtocolConnection
|
|
88 |
* objects can't be deleted through this interface.
|
|
89 |
*
|
|
90 |
* XIMP Framework disposes MXIMPProtocolConnection
|
|
91 |
* instances through MXIMPProtocolPlugin::ReleaseConnection().
|
|
92 |
*/
|
|
93 |
virtual inline ~MXIMPProtocolConnection() {};
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
public: // Common
|
|
98 |
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Primes protocol connection with its callback interface.
|
|
102 |
*
|
|
103 |
* Primes the presence protocol connection instance with
|
|
104 |
* its XIMP Framework side callback interface.
|
|
105 |
* Here given MXIMPProtocolConnectionHost interface is
|
|
106 |
* implemented and owned by the XIMP Framework, and
|
|
107 |
* presence protocol connection must use it to communicate back to
|
|
108 |
* XIMP Framework direction.
|
|
109 |
*
|
|
110 |
* Call and interface lifetime convention:
|
|
111 |
* - This method is called by XIMP Framework before
|
|
112 |
* requesting any other requests from protocol connection
|
|
113 |
* instance.
|
|
114 |
*
|
|
115 |
* - This method is called just once for each MXIMPProtocolConnection,
|
|
116 |
* even the same MXIMPProtocolConnection instance is returned
|
|
117 |
* multiple times from MXIMPProtocolPlugin::AcquireConnectionL().
|
|
118 |
*
|
|
119 |
* - Each presence protocol connection instance must use here
|
|
120 |
* given specific host interface instance to communicate back
|
|
121 |
* to XIMP Framework direction
|
|
122 |
*
|
|
123 |
* - The presence protocol connection implementation must
|
|
124 |
* store the here given host reference internally, so
|
|
125 |
* protocol connection implementation can access the host
|
|
126 |
* when needed.
|
|
127 |
*
|
|
128 |
* - Here given MXIMPProtocolConnectionHost instance, is guaranteed
|
|
129 |
* to remain valid (usable), untill the presence protocol connection
|
|
130 |
* has completed the last MXIMPProtocolConnection::CloseSession()
|
|
131 |
* request.
|
|
132 |
*
|
|
133 |
*
|
|
134 |
* @param [in] aHost
|
|
135 |
* Reference to host interface, what this MXIMPProtocolConnection
|
|
136 |
* instance must use to communicate back to XIMP Framework
|
|
137 |
* direction. Object ownership is not trasfered.
|
|
138 |
*/
|
|
139 |
virtual void PrimeHost(
|
|
140 |
MXIMPProtocolConnectionHost& aHost ) = 0;
|
|
141 |
|
|
142 |
|
|
143 |
|
|
144 |
public: // Connection handling
|
|
145 |
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Opens a session for the identified client through
|
|
149 |
* the presence protocol connection.
|
|
150 |
*
|
|
151 |
* XIMP Framework calls this method to open a session to
|
|
152 |
* remote presence service, for here specified client.
|
|
153 |
* Remote presence service was identified when the
|
|
154 |
* MXIMPProtocolConnection instance was retrieved through
|
|
155 |
* MXIMPProtocolPlugin::AcquireConnectionL().
|
|
156 |
*
|
|
157 |
* @param [in] aContextClient
|
|
158 |
* Object describing the presence connection client.
|
|
159 |
*
|
|
160 |
* @param [in] aReqId
|
|
161 |
* Request ID identifying the request. Presence protocol
|
|
162 |
* connection implementation must cache here given ID and
|
|
163 |
* use it when completing the request later through the
|
|
164 |
* MXIMPProtocolConnectionHost::HandleRequestCompleted().
|
|
165 |
*/
|
|
166 |
virtual void OpenSessionL(
|
|
167 |
const MXIMPContextClientInfo& aContextClient,
|
|
168 |
TXIMPRequestId aReqId ) = 0;
|
|
169 |
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Opens a session for the identified client through
|
|
173 |
* the presence protocol connection.
|
|
174 |
*
|
|
175 |
* XIMP Framework calls this method to open a session to
|
|
176 |
* remote presence service, for here specified client.
|
|
177 |
* Remote presence service was identified when the
|
|
178 |
* MXIMPProtocolConnection instance was retrieved through
|
|
179 |
* MXIMPProtocolPlugin::AcquireConnectionL().
|
|
180 |
*
|
|
181 |
* @param [in] aSettingsId
|
|
182 |
* SettingsId for the presence connection client.
|
|
183 |
*
|
|
184 |
* @param [in] aReqId
|
|
185 |
* Request ID identifying the request. Presence protocol
|
|
186 |
* connection implementation must cache here given ID and
|
|
187 |
* use it when completing the request later through the
|
|
188 |
* MXIMPProtocolConnectionHost::HandleRequestCompleted().
|
|
189 |
*/
|
|
190 |
virtual void OpenSessionL(
|
|
191 |
const TInt& aSettingsId,
|
|
192 |
TXIMPRequestId aReqId ) = 0;
|
|
193 |
|
|
194 |
|
|
195 |
/**
|
|
196 |
* Closes the identified client session from the
|
|
197 |
* presence connection.
|
|
198 |
*
|
|
199 |
* XIMP Framework calls this method to close
|
|
200 |
* the remote presence service session, for here specified
|
|
201 |
* client. When last using client session is closed,
|
|
202 |
* XIMP Framework consideres the remote presence connection
|
|
203 |
* as disconnect, and disposes MXIMPProtocolConnection instance
|
|
204 |
* with MXIMPProtocolPlugin::ReleaseConnection().
|
|
205 |
*
|
|
206 |
* @param [in] aContextClient
|
|
207 |
* Client which session to close.
|
|
208 |
*
|
|
209 |
* @param [in] aReqId
|
|
210 |
* Request ID identifying the request. Presence protocol
|
|
211 |
* connection implementation must cache here given ID and
|
|
212 |
* use it when completing the request later through the
|
|
213 |
* MXIMPProtocolConnectionHost::HandleRequestCompleted().
|
|
214 |
*/
|
|
215 |
virtual void CloseSession(
|
|
216 |
const MXIMPContextClientInfo& aContextClient,
|
|
217 |
TXIMPRequestId aReqId ) = 0;
|
|
218 |
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Gets features that presence protocol connection supports.
|
|
222 |
*
|
|
223 |
* Presence protocol connection should negotiate
|
|
224 |
* available features during the connection establish
|
|
225 |
* and this method should return the supported features
|
|
226 |
* from presence protocol connection internal cache.
|
|
227 |
*
|
|
228 |
* @param [out] aFeatures
|
|
229 |
* Return parameter where to append supported
|
|
230 |
* presence protocol connection features.
|
|
231 |
* Feature IDs are defined in NXIMPFeature namespace.
|
|
232 |
*/
|
|
233 |
virtual void GetSupportedFeaturesL(
|
|
234 |
CDesC8Array& aFeatures ) const = 0;
|
|
235 |
|
|
236 |
|
|
237 |
|
|
238 |
public: // Access to sub-interfaces
|
|
239 |
|
|
240 |
|
|
241 |
/**
|
|
242 |
* Gets reference to presence watching interface.
|
|
243 |
*
|
|
244 |
* XIMP Framework calls this method to retrieve a reference
|
|
245 |
* to protocols MProtocolPresenceWatching interface
|
|
246 |
* implementation.
|
|
247 |
*
|
|
248 |
* Call and interface lifetime convention:
|
|
249 |
* - This method isn't called before protocol has signalled
|
|
250 |
* MXIMPProtocolConnection::OpenSessionL() succesfully completed.
|
|
251 |
*
|
|
252 |
* - XIMP Framework may call this method multiple times for
|
|
253 |
* for one MXIMPProtocolConnection instance.
|
|
254 |
*
|
|
255 |
* - Each call per one MXIMPProtocolConnection instance,
|
|
256 |
* must return reference to same interface instance.
|
|
257 |
*
|
|
258 |
* - Returned interface instance must remain valid (usable)
|
|
259 |
* untill last client session, using originating presence protocol
|
|
260 |
* connection is successfully closed with
|
|
261 |
* MXIMPProtocolConnection::CloseSession().
|
|
262 |
*
|
|
263 |
* @return Requested interface.
|
|
264 |
* interface ownership is not returned caller.
|
|
265 |
*/
|
|
266 |
virtual MProtocolPresenceFeatures& ProtocolPresenceFeatures() = 0;
|
|
267 |
|
|
268 |
|
|
269 |
/**
|
|
270 |
* Gets reference to protocol specific interface.
|
|
271 |
*
|
|
272 |
* XIMP Framework calls this method to retrieve a reference
|
|
273 |
* to protocol interface implementation.
|
|
274 |
*
|
|
275 |
* Call and interface lifetime convention:
|
|
276 |
* - This method isn't called before protocol has signalled
|
|
277 |
* MXIMPProtocolConnection::OpenSessionL() succesfully completed.
|
|
278 |
*
|
|
279 |
* - XIMP Framework may call this method multiple times for
|
|
280 |
* for one MXIMPProtocolConnection instance.
|
|
281 |
*
|
|
282 |
* - Each call per one MXIMPProtocolConnection instance,
|
|
283 |
* must return reference to same interface instance.
|
|
284 |
*
|
|
285 |
* - Returned interface instance must remain valid (usable)
|
|
286 |
* untill last client session, using originating presence protocol
|
|
287 |
* connection is successfully closed with
|
|
288 |
* MXIMPProtocolConnection::CloseSession().
|
|
289 |
*
|
|
290 |
* @return Requested interface.
|
|
291 |
* interface ownership is not returned caller.
|
|
292 |
*/
|
|
293 |
virtual TAny* GetProtocolInterface(TInt aInterfaceId) = 0;
|
|
294 |
|
|
295 |
};
|
|
296 |
|
|
297 |
|
|
298 |
|
|
299 |
#endif // MXIMPFWPROTOCOLCONNECTION_H
|