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 XIMP context.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef MXIMPFWPRESENCECONTEXT_H
|
|
19 |
#define MXIMPFWPRESENCECONTEXT_H
|
|
20 |
|
|
21 |
#include <e32std.h>
|
|
22 |
#include <ximpbase.h>
|
|
23 |
#include <ximpmanagementifids.hrh>
|
|
24 |
|
|
25 |
|
|
26 |
class MXIMPClient;
|
|
27 |
class MXIMPContextObserver;
|
|
28 |
class MXIMPFeatureInfo;
|
|
29 |
class MXIMPObjectFactory;
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Interface for XIMP context.
|
|
35 |
* This interface is implemented by the XIMP Framework.
|
|
36 |
*
|
|
37 |
* MXIMPContext is root interface for accessing
|
|
38 |
* and updating XIMP data to remote XIMP service.
|
|
39 |
* MXIMPContext client binds MXIMPContext
|
|
40 |
* interface to desired remote XIMP service and uses
|
|
41 |
* other MXIMPContext sub interfaces to publish
|
|
42 |
* and access XIMP data.
|
|
43 |
*
|
|
44 |
* Following sub interfaces can be accessed from
|
|
45 |
* from MXIMPContext:
|
|
46 |
* - MXIMPObjectFactory
|
|
47 |
*
|
|
48 |
* All Presence events (context state, XIMP data,
|
|
49 |
* request completion etc. ones) are delivered through
|
|
50 |
* MXIMPContextObserver interface.
|
|
51 |
*
|
|
52 |
* @ingroup ximpfwmanagementapi
|
|
53 |
* @since S60 v3.2
|
|
54 |
*/
|
|
55 |
class MXIMPContext : public MXIMPBase
|
|
56 |
{
|
|
57 |
public:
|
|
58 |
|
|
59 |
/** Interface ID for the MXIMPContext. */
|
|
60 |
enum { KInterfaceId = XIMP_IF_ID_CONTEXT };
|
|
61 |
|
|
62 |
|
|
63 |
public:
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Public destructor.
|
|
67 |
* Objects can be deleted through this interface.
|
|
68 |
*/
|
|
69 |
virtual ~MXIMPContext() {}
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
public:
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Reqisters XIMP context event observer.
|
|
77 |
*
|
|
78 |
* Reqisters observer is notified from XIMP context events.
|
|
79 |
* XIMP Framework client side events are listed in
|
|
80 |
* MXIMPContextObserver header.
|
|
81 |
*
|
|
82 |
* Event delivery uses client side active object to callback
|
|
83 |
* the reqistered observer. If client thread is blocked with
|
|
84 |
* User::WaitFor...() or other high priority active objects,
|
|
85 |
* event notification is delayed until XIMP Framework
|
|
86 |
* client side active objects get their execution turn.
|
|
87 |
* When client is blocked, XIMP Framework queues events,
|
|
88 |
* and delivers those later in FIFO order to observer. However,
|
|
89 |
* the XIMP Framework limits the que size and thus
|
|
90 |
* events might get dropped if the the client is blocked
|
|
91 |
* too long.
|
|
92 |
*
|
|
93 |
* Even though client shouldn't perform any heavy
|
|
94 |
* processing in the event callback, XIMP Framework
|
|
95 |
* allows the client client to issue following kind of
|
|
96 |
* requests to XIMP Framework, from event callback:
|
|
97 |
* - Data management relatred asynchronous & synchronous requests
|
|
98 |
* - Observer registeration and unregisteration
|
|
99 |
* - Presence context undbind
|
|
100 |
* - Presence contex destroy
|
|
101 |
*
|
|
102 |
* @param [in] aObserver
|
|
103 |
* The observer to be notified from context events.
|
|
104 |
* If the observer is already registered, event filter
|
|
105 |
* associated to it is updated.
|
|
106 |
*
|
|
107 |
* @param [in] aEventFilter
|
|
108 |
* List of event types that the observer accepts.
|
|
109 |
* Event types are identified with their event interface IDs.
|
|
110 |
* If NULL, all event types are delivered to observer.
|
|
111 |
*/
|
|
112 |
virtual void RegisterObserverL(
|
|
113 |
MXIMPContextObserver& aObserver,
|
|
114 |
const TArray<TInt32>* aEventFilter = NULL ) = 0;
|
|
115 |
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Unregisters context event observer.
|
|
119 |
*
|
|
120 |
* @param [in] aObserver
|
|
121 |
* The observer to unregister.
|
|
122 |
*/
|
|
123 |
virtual void UnregisterObserver(
|
|
124 |
MXIMPContextObserver& aObserver ) = 0;
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Binds the XIMP context to remote XIMP service.
|
|
130 |
*
|
|
131 |
* Binds the XIMP context to given XIMP service,
|
|
132 |
* with given credentials and by using defined protocol plug-in.
|
|
133 |
* Binding is asynchronous operation and evolves network interaction.
|
|
134 |
* Used protocol plug-in is identified explicitly with its
|
|
135 |
* implementation UID.
|
|
136 |
*
|
|
137 |
* @param [in] aProtocolImpUid
|
|
138 |
* Protocol implementation UID identifying which
|
|
139 |
* PSC protocol implementation to use.
|
|
140 |
*
|
|
141 |
* @param [in] aServiceAddress
|
|
142 |
* Service address string identifying the remote
|
|
143 |
* XIMP service.
|
|
144 |
*
|
|
145 |
* @param [in] aIapId
|
|
146 |
* Internet Accesspoint for accessing the remote
|
|
147 |
* XIMP service connection.
|
|
148 |
*
|
|
149 |
* @param [in] aUsername
|
|
150 |
* Username (credential) for accessing the remote
|
|
151 |
* XIMP service.
|
|
152 |
*
|
|
153 |
* @param [in] aPassword
|
|
154 |
* Password (credential) for accessing the remote
|
|
155 |
* XIMP service.
|
|
156 |
*
|
|
157 |
* @return The request ID identifying the started binding request.
|
|
158 |
* Client can use request ID to find out correct
|
|
159 |
* completion event from the MXIMPContextObserver
|
|
160 |
* event stream.
|
|
161 |
*/
|
|
162 |
virtual TXIMPRequestId BindToL(
|
|
163 |
TUid aProtocolImpUid,
|
|
164 |
const TDesC16& aServiceAddress,
|
|
165 |
const TDesC16& aUsername,
|
|
166 |
const TDesC16& aPassword,
|
|
167 |
TInt32 aIapId ) = 0;
|
|
168 |
|
|
169 |
|
|
170 |
virtual TXIMPRequestId BindToL(
|
|
171 |
TUid aProtocolImpUid,
|
|
172 |
const TDesC16& aServiceAddress,
|
|
173 |
const TDesC16& aUsername,
|
|
174 |
const TDesC16& aPassword,
|
|
175 |
const TDesC16& aClientId,
|
|
176 |
TInt32 aIapId ) = 0;
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Binds the XIMP context to remote XIMP service.
|
|
180 |
*
|
|
181 |
* Binds the XIMP context to given XIMP service,
|
|
182 |
* with given credentials and by using defined protocol plug-in.
|
|
183 |
* Binding is asynchronous operation and evolves network interaction.
|
|
184 |
* Used protocol plug-in is identified explicitly with its
|
|
185 |
* implementation UID.
|
|
186 |
*
|
|
187 |
* @param [in] aProtocolImpUid
|
|
188 |
* Protocol implementation UID identifying which
|
|
189 |
* PSC protocol implementation to use.
|
|
190 |
*
|
|
191 |
* @param [in] aServiceAddress
|
|
192 |
* Service address string identifying the remote
|
|
193 |
* XIMP service.
|
|
194 |
*
|
|
195 |
* @param [in] aUsername
|
|
196 |
* Username (credential) for accessing the remote
|
|
197 |
* XIMP service.
|
|
198 |
*
|
|
199 |
* @param [in] aPassword
|
|
200 |
* Password (credential) for accessing the remote
|
|
201 |
* XIMP service.
|
|
202 |
* @param [in] aServiceId - Service Id
|
|
203 |
*
|
|
204 |
* @return The request ID identifying the started binding request.
|
|
205 |
* Client can use request ID to find out correct
|
|
206 |
* completion event from the MXIMPContextObserver
|
|
207 |
* event stream.
|
|
208 |
*/
|
|
209 |
virtual TXIMPRequestId BindToL( TUid aProtocolImpUid,
|
|
210 |
TInt aServiceId ) = 0;
|
|
211 |
|
|
212 |
virtual TXIMPRequestId BindToL(
|
|
213 |
TUid aProtocolImpUid,
|
|
214 |
const TDesC16& aUsername,
|
|
215 |
const TDesC16& aPassword,
|
|
216 |
TInt aServiceId ) = 0;
|
|
217 |
/**
|
|
218 |
* Unbinds the XIMP context from the to currently binded
|
|
219 |
* XIMP service. Unbinding is asynchronous operation and
|
|
220 |
* might evolve network operations. Unbinding or waiting
|
|
221 |
* unbinding completion isn't mandatory for the client.
|
|
222 |
* XIMPFw performs unbinding implicitly when the bound
|
|
223 |
* MXIMPContext object is destroyed.
|
|
224 |
*
|
|
225 |
* @return The request ID identifying the started unbinding
|
|
226 |
* request. Client can use request ID to find out correct
|
|
227 |
* completion event from the MXIMPContextObserver
|
|
228 |
* event stream.
|
|
229 |
*/
|
|
230 |
virtual TXIMPRequestId UnbindL() = 0;
|
|
231 |
|
|
232 |
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Retrieves Presence Contex features.
|
|
236 |
*
|
|
237 |
* Retrieves features supported by the Presence Contex.
|
|
238 |
* Features returned here may be "less" than what the
|
|
239 |
* protocol indicated, since connected remote service
|
|
240 |
* may limit available features.
|
|
241 |
*
|
|
242 |
* @return Features supported in Presence Contex.
|
|
243 |
* Exact feature IDs are defined in NXIMPFeature
|
|
244 |
* namespace. Object ownership is returned
|
|
245 |
* to caller.
|
|
246 |
*/
|
|
247 |
virtual MXIMPFeatureInfo* GetContextFeaturesLC() const = 0;
|
|
248 |
|
|
249 |
|
|
250 |
|
|
251 |
public: //Sub interfaces for XIMP context
|
|
252 |
|
|
253 |
|
|
254 |
/**
|
|
255 |
* Gets reference to object factory interface.
|
|
256 |
*
|
|
257 |
* Returned object factory interface is used
|
|
258 |
* to instantiate XIMP objects.
|
|
259 |
*
|
|
260 |
* @return Object factory interface.
|
|
261 |
* No ownership is returned caller.
|
|
262 |
*/
|
|
263 |
virtual MXIMPObjectFactory& ObjectFactory() const = 0;
|
|
264 |
|
|
265 |
};
|
|
266 |
|
|
267 |
|
|
268 |
#endif // MXIMPFWPRESENCECONTEXT_H
|
|
269 |
|
|
270 |
|
|
271 |
|