9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef C_HNMDSERVICEHANDLER_H |
19 #ifndef C_HNMDSERVICEHANDLER_H |
20 #define C_HNMDSERVICEHANDLER_H |
20 #define C_HNMDSERVICEHANDLER_H |
21 |
21 |
22 //#include <mnaiwservices.h> |
22 //#include <mnaiwservices.h> |
23 #include <liwcommon.h> |
23 #include <liwcommon.h> |
24 #include <e32base.h> |
24 #include <e32base.h> |
25 #include <xmlengelement.h> |
25 #include <xmlengelement.h> |
26 |
26 |
27 #include "hnglobals.h" |
27 #include "hnglobals.h" |
28 |
28 |
29 class CLiwServiceHandler; |
29 class CLiwServiceHandler; |
30 class CHnMdQuery; |
30 class CHnMdQuery; |
57 * @param aConstructor Parameters used during Service construction. |
57 * @param aConstructor Parameters used during Service construction. |
58 * @param aServiceCommand Additional Parameters for the Request. |
58 * @param aServiceCommand Additional Parameters for the Request. |
59 * @return Fully cosntructed object. |
59 * @return Fully cosntructed object. |
60 */ |
60 */ |
61 IMPORT_C static CHnServiceHandler* NewL( |
61 IMPORT_C static CHnServiceHandler* NewL( |
62 const TDesC8& aService, const TDesC8& aInterface, |
62 const TDesC8& aService, const TDesC8& aInterface, |
63 const TDesC8& aCommand, TServiceMode aMode, |
63 const TDesC8& aCommand, TServiceMode aMode, |
64 CLiwGenericParamList* aConstructor, |
64 CLiwGenericParamList* aConstructor, |
65 CLiwGenericParamList* aServiceCommand ); |
65 CLiwGenericParamList* aServiceCommand ); |
66 |
66 |
67 /** |
67 /** |
108 * @param aCmdOptions Additional options for the Request. |
108 * @param aCmdOptions Additional options for the Request. |
109 * @return Error code. |
109 * @return Error code. |
110 */ |
110 */ |
111 IMPORT_C TInt ExecuteL( MLiwNotifyCallback* aCallback, |
111 IMPORT_C TInt ExecuteL( MLiwNotifyCallback* aCallback, |
112 TInt aCmdOptions = 0 ); |
112 TInt aCmdOptions = 0 ); |
113 |
113 |
114 |
114 |
115 /** |
115 /** |
116 * Executes the query on the service. |
116 * Executes the query on the service. |
117 * Deprecated - Do not Use this method!!!! Will be removed asap. |
117 * Deprecated - Do not Use this method!!!! Will be removed asap. |
|
118 * |
|
119 * since S60 v5.0 |
|
120 * @return Error code. |
|
121 */ |
|
122 IMPORT_C TInt ExecuteL(); |
|
123 |
|
124 /** |
|
125 * Checks if an action model matches an existing service. |
|
126 * |
|
127 * since S60 v5.0 |
|
128 * @param aService service. |
|
129 * @param aInterface interface. |
|
130 * @param aConstructor constructor. |
|
131 * @return true if an action model matches the service. |
|
132 */ |
|
133 IMPORT_C TBool ServiceHandlerMatchesModel( |
|
134 const TDesC8& aService, |
|
135 const TDesC8& aInterface, |
|
136 const CLiwGenericParamList* aConstructor ) const; |
|
137 |
|
138 /** |
|
139 * Allows for reusing the object when a request needs to be invoked on |
|
140 * the same interface of the same service. |
118 * |
141 * |
119 * since S60 v5.0 |
142 * @param aCommand Request to the Service. |
120 * @return Error code. |
143 * @param aMode Asynchronous or Synchronous Request. |
121 */ |
144 * @param aServiceCommand Additional Parameters for the Request. |
122 IMPORT_C TInt ExecuteL(); |
145 */ |
123 |
146 IMPORT_C void PrepareForNextExecutionL( const TDesC8& aCommand, |
|
147 TServiceMode aMode, CLiwGenericParamList* aServiceCommand ); |
|
148 |
124 private: |
149 private: |
125 |
150 |
126 /** |
151 /** |
127 * Standard C++ constructor. |
152 * Standard C++ constructor. |
128 * |
153 * |
129 * @since S60 5.0 |
154 * @since S60 5.0 |
130 * @param aMode Synchronous or asynchronous. |
155 * @param aMode Synchronous or asynchronous. |
131 */ |
156 */ |
132 CHnServiceHandler( TServiceMode aMode ); |
157 CHnServiceHandler( TServiceMode aMode ); |
133 |
158 |
134 |
159 |
135 /** |
160 /** |
136 * Standard symbian 2nd phase contructor. |
161 * Standard symbian 2nd phase contructor. |
137 * |
162 * |
138 * @since S60 5.0 |
163 * @since S60 5.0 |
139 * @param aService Service name. |
164 * @param aService Service name. |
140 * @param aInterface Interface name. |
165 * @param aInterface Interface name. |
141 * @param aCommandName Request to the Service. |
166 * @param aCommandName Request to the Service. |
142 * @param aConstructor Parameters used during Service construction. |
167 * @param aConstructor Parameters used during Service construction. |
143 * @param aServiceCommand Additional Parameters for the Request. |
168 * @param aServiceCommand Additional Parameters for the Request. |
144 */ |
169 */ |
145 void ConstructL( |
170 void ConstructL( |
146 const TDesC8& aService, const TDesC8& aInterface, |
171 const TDesC8& aService, const TDesC8& aInterface, |
147 const TDesC8& aCommandName, |
172 const TDesC8& aCommandName, |
148 CLiwGenericParamList* aConstructor, |
173 CLiwGenericParamList* aConstructor, |
149 CLiwGenericParamList* aServiceCommand ); |
174 CLiwGenericParamList* aServiceCommand ); |
150 |
175 |
151 |
176 |
152 /** |
177 /** |
153 * Handles notifications caused by an asynchronous Request. |
178 * Handles notifications caused by an asynchronous Request. |
154 * |
179 * |
155 * @param aCmdId The service command associated to the event. |
180 * @param aCmdId The service command associated to the event. |
156 * @param aEventId Occured event, see LiwCommon.hrh. |
181 * @param aEventId Occured event, see LiwCommon.hrh. |
185 /** |
210 /** |
186 * Interface name. |
211 * Interface name. |
187 * Own. |
212 * Own. |
188 */ |
213 */ |
189 RBuf8 iInterfaceName; |
214 RBuf8 iInterfaceName; |
190 |
215 |
191 /** |
216 /** |
192 * Command (Request) name. |
217 * Command (Request) name. |
193 * Own. |
218 * Own. |
194 */ |
219 */ |
195 RBuf8 iCommandName; |
220 RBuf8 iCommandName; |
196 |
221 |
197 /** |
222 /** |
198 * Service mode. |
223 * Service mode. |
199 */ |
224 */ |
200 TServiceMode iMode; |
225 TServiceMode iMode; |
201 |
226 |
202 /** |
227 /** |
203 * Stores input parameters (not data) of the service search method\ |
228 * Stores input parameters (not data) of the service search method\ |
204 * (ExecuteServiceCmdL). |
229 * (ExecuteServiceCmdL). |
205 * Own. |
230 * Own. |
206 */ |
231 */ |
207 CLiwGenericParamList* iConstructor; |
232 CLiwGenericParamList* iConstructor; |
208 |
233 |
209 /** |
234 /** |
210 * |
235 * |
211 * Own. |
236 * Own. |
212 */ |
237 */ |
213 CLiwGenericParamList* iCommand; |
238 CLiwGenericParamList* iCommand; |
214 |
239 |
215 /** |
240 /** |
216 * Parameters for the Request. |
241 * Parameters for the Request. |
217 * Own. |
242 * Own. |
218 */ |
243 */ |
219 CLiwGenericParamList* iInput; |
244 CLiwGenericParamList* iInput; |
220 |
245 |
221 /** |
246 /** |
222 * Request results from ExecuteL(); |
247 * Request results from ExecuteL(); |
223 * Own. |
248 * Own. |
224 */ |
249 */ |
225 CLiwGenericParamList* iOutputForAS; |
250 CLiwGenericParamList* iOutputForAS; |
226 |
251 |
227 /** |
252 /** |
228 * Request results from |
253 * Request results from |
229 * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ). |
254 * ExecuteL( CLiwGenericParamList& aOutParamList, TRequestStatus& aStatus ). |
230 * Own. |
255 * Own. |
231 */ |
256 */ |
232 CLiwGenericParamList* iOutputForAO; |
257 CLiwGenericParamList* iOutputForAO; |
233 |
258 |
234 /** |
259 /** |
235 * Service interface. |
260 * Service interface. |
236 */ |
261 */ |
237 MLiwInterface* iServiceInterface; |
262 MLiwInterface* iServiceInterface; |
238 |
263 |
239 /** |
264 /** |
240 * Service Handler. |
265 * Service Handler. |
241 * Own. |
266 * Own. |
242 */ |
267 */ |
243 CLiwServiceHandler* iServiceHandler; |
268 CLiwServiceHandler* iServiceHandler; |
244 |
269 |
245 /** |
270 /** |
246 * Client status. |
271 * Client status. |
247 * Not Own. |
272 * Not Own. |
248 */ |
273 */ |
249 TRequestStatus* iClientStatus; |
274 TRequestStatus* iClientStatus; |
250 |
275 |
251 /** |
276 /** |
252 * Waits for asynchronous queries. |
277 * Waits for asynchronous queries. |
253 * Own. |
278 * Own. |
254 */ |
279 */ |
255 CActiveSchedulerWait* iWait; |
280 CActiveSchedulerWait* iWait; |
256 |
281 |
257 }; |
282 }; |
258 |
283 |
259 #endif // C_HNMDSERVICEHANDLER_H |
284 #endif // C_HNMDSERVICEHANDLER_H |