1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef REMCONCOREAPITARGET_H
23 #define REMCONCOREAPITARGET_H
26 #include <remcon/remconinterfacebase.h>
27 #include <remconcoreapi.h>
28 #include <remcon/remconinterfaceif.h>
30 class MRemConCoreApiTargetObserver;
31 class CRemConInterfaceSelector;
34 Client-instantiable type supporting sending Core API responses.
36 NONSHARABLE_CLASS(CRemConCoreApiTarget) : public CRemConInterfaceBase,
37 public MRemConInterfaceIf
42 @param aInterfaceSelector The interface selector. The client must have
43 created one of these first.
44 @param aObserver The observer of this interface.
45 @return A new CRemConCoreApiTarget, owned by the interface selector.
47 IMPORT_C static CRemConCoreApiTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
48 MRemConCoreApiTargetObserver& aObserver);
51 @param aInterfaceSelector The interface selector. The client must have
52 created one of these first.
53 @param aObserver The observer of this interface.
54 @param aFeatureSupported The Array is used to stote features supportd by the client
56 @return A new CRemConCoreApiTarget, owned by the interface selector.
58 IMPORT_C static CRemConCoreApiTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
59 MRemConCoreApiTargetObserver& aObserver,const RArray<TRemConCoreApiOperationId>& aFeatureSupported);
62 IMPORT_C ~CRemConCoreApiTarget();
65 /** Send a 'select' response.
66 Only one response per target session can be outstanding at any one time.
67 @param aStatus Used by RemCon to indicate completion of the send request.
68 @param aError The response error.
70 IMPORT_C void SelectResponse(TRequestStatus& aStatus, TInt aError);
72 /** Send an 'up' response.
73 Only one response per target session can be outstanding at any one time.
74 @param aStatus Used by RemCon to indicate completion of the send request.
75 @param aError The response error.
77 IMPORT_C void UpResponse(TRequestStatus& aStatus, TInt aError);
79 /** Send a 'down' response.
80 Only one response per target session can be outstanding at any one time.
81 @param aStatus Used by RemCon to indicate completion of the send request.
82 @param aError The response error.
84 IMPORT_C void DownResponse(TRequestStatus& aStatus, TInt aError);
86 /** Send a 'left' response.
87 Only one response per target session can be outstanding at any one time.
88 @param aStatus Used by RemCon to indicate completion of the send request.
89 @param aError The response error.
91 IMPORT_C void LeftResponse(TRequestStatus& aStatus, TInt aError);
93 /** Send a 'right' response.
94 Only one response per target session can be outstanding at any one time.
95 @param aStatus Used by RemCon to indicate completion of the send request.
96 @param aError The response error.
98 IMPORT_C void RightResponse(TRequestStatus& aStatus, TInt aError);
100 /** Send a 'right up' response.
101 Only one response per target session can be outstanding at any one time.
102 @param aStatus Used by RemCon to indicate completion of the send request.
103 @param aError The response error.
105 IMPORT_C void RightUpResponse(TRequestStatus& aStatus, TInt aError);
107 /** Send a 'right down' response.
108 Only one response per target session can be outstanding at any one time.
109 @param aStatus Used by RemCon to indicate completion of the send request.
110 @param aError The response error.
112 IMPORT_C void RightDownResponse(TRequestStatus& aStatus, TInt aError);
114 /** Send a 'left up' response.
115 Only one response per target session can be outstanding at any one time.
116 @param aStatus Used by RemCon to indicate completion of the send request.
117 @param aError The response error.
119 IMPORT_C void LeftUpResponse(TRequestStatus& aStatus, TInt aError);
121 /** Send a 'left down' response.
122 Only one response per target session can be outstanding at any one time.
123 @param aStatus Used by RemCon to indicate completion of the send request.
124 @param aError The response error.
126 IMPORT_C void LeftDownResponse(TRequestStatus& aStatus, TInt aError);
128 /** Send a 'root menu' response.
129 Only one response per target session can be outstanding at any one time.
130 @param aStatus Used by RemCon to indicate completion of the send request.
131 @param aError The response error.
133 IMPORT_C void RootMenuResponse(TRequestStatus& aStatus, TInt aError);
135 /** Send a 'setup menu' response.
136 Only one response per target session can be outstanding at any one time.
137 @param aStatus Used by RemCon to indicate completion of the send request.
138 @param aError The response error.
140 IMPORT_C void SetupMenuResponse(TRequestStatus& aStatus, TInt aError);
142 /** Send a 'contents menu' response.
143 Only one response per target session can be outstanding at any one time.
144 @param aStatus Used by RemCon to indicate completion of the send request.
145 @param aError The response error.
147 IMPORT_C void ContentsMenuResponse(TRequestStatus& aStatus, TInt aError);
149 /** Send a 'favorite menu' response.
150 Only one response per target session can be outstanding at any one time.
151 @param aStatus Used by RemCon to indicate completion of the send request.
152 @param aError The response error.
154 IMPORT_C void FavoriteMenuResponse(TRequestStatus& aStatus, TInt aError);
156 /** Send an 'exit' response.
157 Only one response per target session can be outstanding at any one time.
158 @param aStatus Used by RemCon to indicate completion of the send request.
159 @param aError The response error.
161 IMPORT_C void ExitResponse(TRequestStatus& aStatus, TInt aError);
163 /** Send a '0' response.
164 Only one response per target session can be outstanding at any one time.
165 @param aStatus Used by RemCon to indicate completion of the send request.
166 @param aError The response error.
168 IMPORT_C void _0Response(TRequestStatus& aStatus, TInt aError);
170 /** Send a '1' response.
171 Only one response per target session can be outstanding at any one time.
172 @param aStatus Used by RemCon to indicate completion of the send request.
173 @param aError The response error.
175 IMPORT_C void _1Response(TRequestStatus& aStatus, TInt aError);
177 /** Send a '2' response.
178 Only one response per target session can be outstanding at any one time.
179 @param aStatus Used by RemCon to indicate completion of the send request.
180 @param aError The response error.
182 IMPORT_C void _2Response(TRequestStatus& aStatus, TInt aError);
184 /** Send a '3' response.
185 Only one response per target session can be outstanding at any one time.
186 @param aStatus Used by RemCon to indicate completion of the send request.
187 @param aError The response error.
189 IMPORT_C void _3Response(TRequestStatus& aStatus, TInt aError);
191 /** Send a '4'response.
192 Only one response per target session can be outstanding at any one time.
193 @param aStatus Used by RemCon to indicate completion of the send request.
194 @param aError The response error.
196 IMPORT_C void _4Response(TRequestStatus& aStatus, TInt aError);
198 /** Send a '5' response.
199 Only one response per target session can be outstanding at any one time.
200 @param aStatus Used by RemCon to indicate completion of the send request.
201 @param aError The response error.
203 IMPORT_C void _5Response(TRequestStatus& aStatus, TInt aError);
205 /** Send a '6' response.
206 Only one response per target session can be outstanding at any one time.
207 @param aStatus Used by RemCon to indicate completion of the send request.
208 @param aError The response error.
210 IMPORT_C void _6Response(TRequestStatus& aStatus, TInt aError);
212 /** Send a '7' response.
213 Only one response per target session can be outstanding at any one time.
214 @param aStatus Used by RemCon to indicate completion of the send request.
215 @param aError The response error.
217 IMPORT_C void _7Response(TRequestStatus& aStatus, TInt aError);
219 /** Send a '8' response.
220 Only one response per target session can be outstanding at any one time.
221 @param aStatus Used by RemCon to indicate completion of the send request.
222 @param aError The response error.
224 IMPORT_C void _8Response(TRequestStatus& aStatus, TInt aError);
226 /** Send a '9' response.
227 Only one response per target session can be outstanding at any one time.
228 @param aStatus Used by RemCon to indicate completion of the send request.
229 @param aError The response error.
231 IMPORT_C void _9Response(TRequestStatus& aStatus, TInt aError);
233 /** Send a 'dot' response.
234 Only one response per target session can be outstanding at any one time.
235 @param aStatus Used by RemCon to indicate completion of the send request.
236 @param aError The response error.
238 IMPORT_C void DotResponse(TRequestStatus& aStatus, TInt aError);
240 /** Send an 'enter' response.
241 Only one response per target session can be outstanding at any one time.
242 @param aStatus Used by RemCon to indicate completion of the send request.
243 @param aError The response error.
245 IMPORT_C void EnterResponse(TRequestStatus& aStatus, TInt aError);
247 /** Send a 'clear' response.
248 Only one response per target session can be outstanding at any one time.
249 @param aStatus Used by RemCon to indicate completion of the send request.
250 @param aError The response error.
252 IMPORT_C void ClearResponse(TRequestStatus& aStatus, TInt aError);
254 /** Send a 'channel up' response.
255 Only one response per target session can be outstanding at any one time.
256 @param aStatus Used by RemCon to indicate completion of the send request.
257 @param aError The response error.
259 IMPORT_C void ChannelUpResponse(TRequestStatus& aStatus, TInt aError);
261 /** Send a 'channel down' response.
262 Only one response per target session can be outstanding at any one time.
263 @param aStatus Used by RemCon to indicate completion of the send request.
264 @param aError The response error.
266 IMPORT_C void ChannelDownResponse(TRequestStatus& aStatus, TInt aError);
268 /** Send a 'previous channel' response.
269 Only one response per target session can be outstanding at any one time.
270 @param aStatus Used by RemCon to indicate completion of the send request.
271 @param aError The response error.
273 IMPORT_C void PreviousChannelResponse(TRequestStatus& aStatus, TInt aError);
275 /** Send a 'sound select' response.
276 Only one response per target session can be outstanding at any one time.
277 @param aStatus Used by RemCon to indicate completion of the send request.
278 @param aError The response error.
280 IMPORT_C void SoundSelectResponse(TRequestStatus& aStatus, TInt aError);
282 /** Send a 'input select' response.
283 Only one response per target session can be outstanding at any one time.
284 @param aStatus Used by RemCon to indicate completion of the send request.
285 @param aError The response error.
287 IMPORT_C void InputSelectResponse(TRequestStatus& aStatus, TInt aError);
289 /** Send a 'display information' response.
290 Only one response per target session can be outstanding at any one time.
291 @param aStatus Used by RemCon to indicate completion of the send request.
292 @param aError The response error.
294 IMPORT_C void DisplayInformationResponse(TRequestStatus& aStatus, TInt aError);
296 /** Send a 'help' response.
297 Only one response per target session can be outstanding at any one time.
298 @param aStatus Used by RemCon to indicate completion of the send request.
299 @param aError The response error.
301 IMPORT_C void HelpResponse(TRequestStatus& aStatus, TInt aError);
303 /** Send a 'page up' response.
304 Only one response per target session can be outstanding at any one time.
305 @param aStatus Used by RemCon to indicate completion of the send request.
306 @param aError The response error.
308 IMPORT_C void PageUpResponse(TRequestStatus& aStatus, TInt aError);
310 /** Send a 'page down' response.
311 Only one response per target session can be outstanding at any one time.
312 @param aStatus Used by RemCon to indicate completion of the send request.
313 @param aError The response error.
315 IMPORT_C void PageDownResponse(TRequestStatus& aStatus, TInt aError);
317 /** Send a 'power' response.
318 Only one response per target session can be outstanding at any one time.
319 @param aStatus Used by RemCon to indicate completion of the send request.
320 @param aError The response error.
322 IMPORT_C void PowerResponse(TRequestStatus& aStatus, TInt aError);
324 /** Send a 'volume up' response.
325 Only one response per target session can be outstanding at any one time.
326 @param aStatus Used by RemCon to indicate completion of the send request.
327 @param aError The response error.
329 IMPORT_C void VolumeUpResponse(TRequestStatus& aStatus, TInt aError);
331 /** Send a 'volume down' response.
332 Only one response per target session can be outstanding at any one time.
333 @param aStatus Used by RemCon to indicate completion of the send request.
334 @param aError The response error.
336 IMPORT_C void VolumeDownResponse(TRequestStatus& aStatus, TInt aError);
338 /** Send a 'mute' response.
339 Only one response per target session can be outstanding at any one time.
340 @param aStatus Used by RemCon to indicate completion of the send request.
341 @param aError The response error.
343 IMPORT_C void MuteResponse(TRequestStatus& aStatus, TInt aError);
345 /** Send a play response.
346 Only one response per target session can be outstanding at any one time.
347 @param aStatus Used by RemCon to indicate completion of the request.
348 @param aError The response error.
350 IMPORT_C void PlayResponse(TRequestStatus& aStatus, TInt aError);
352 /** Send a stop response.
353 Only one response per target session can be outstanding at any one time.
354 @param aStatus Used by RemCon to indicate completion of the request.
355 @param aError The response error.
357 IMPORT_C void StopResponse(TRequestStatus& aStatus, TInt aError);
359 /** Send a 'pause' response.
360 Only one response per target session can be outstanding at any one time.
361 @param aStatus Used by RemCon to indicate completion of the send request.
362 @param aError The response error.
364 IMPORT_C void PauseResponse(TRequestStatus& aStatus, TInt aError);
366 /** Send a 'record' response.
367 Only one response per target session can be outstanding at any one time.
368 @param aStatus Used by RemCon to indicate completion of the send request.
369 @param aError The response error.
371 IMPORT_C void RecordResponse(TRequestStatus& aStatus, TInt aError);
373 /** Send a 'rewind' response.
374 Only one response per target session can be outstanding at any one time.
375 @param aStatus Used by RemCon to indicate completion of the send request.
376 @param aError The response error.
378 IMPORT_C void RewindResponse(TRequestStatus& aStatus, TInt aError);
380 /** Send a 'fast forward' response.
381 Only one response per target session can be outstanding at any one time.
382 @param aStatus Used by RemCon to indicate completion of the send request.
383 @param aError The response error.
385 IMPORT_C void FastForwardResponse(TRequestStatus& aStatus, TInt aError);
387 /** Send an 'eject' response.
388 Only one response per target session can be outstanding at any one time.
389 @param aStatus Used by RemCon to indicate completion of the send request.
390 @param aError The response error.
392 IMPORT_C void EjectResponse(TRequestStatus& aStatus, TInt aError);
394 /** Send a 'forward' response.
395 Only one response per target session can be outstanding at any one time.
396 @param aStatus Used by RemCon to indicate completion of the send request.
397 @param aError The response error.
399 IMPORT_C void ForwardResponse(TRequestStatus& aStatus, TInt aError);
401 /** Send a 'backward' response.
402 Only one response per target session can be outstanding at any one time.
403 @param aStatus Used by RemCon to indicate completion of the send request.
404 @param aError The response error.
406 IMPORT_C void BackwardResponse(TRequestStatus& aStatus, TInt aError);
408 /** Send an 'angle' response.
409 Only one response per target session can be outstanding at any one time.
410 @param aStatus Used by RemCon to indicate completion of the send request.
411 @param aError The response error.
413 IMPORT_C void AngleResponse(TRequestStatus& aStatus, TInt aError);
415 /** Send a 'subpicture' response.
416 Only one response per target session can be outstanding at any one time.
417 @param aStatus Used by RemCon to indicate completion of the send request.
418 @param aError The response error.
420 IMPORT_C void SubpictureResponse(TRequestStatus& aStatus, TInt aError);
422 /** Send a 'pause play function' response.
423 Only one response per target session can be outstanding at any one time.
424 @param aStatus Used by RemCon to indicate completion of the send request.
425 @param aError The response error.
427 IMPORT_C void PausePlayFunctionResponse(TRequestStatus& aStatus, TInt aError);
429 /** Send a 'restore volume function' response.
430 Only one response per target session can be outstanding at any one time.
431 @param aStatus Used by RemCon to indicate completion of the send request.
432 @param aError The response error.
434 IMPORT_C void RestoreVolumeFunctionResponse(TRequestStatus& aStatus, TInt aError);
436 /** Send a 'tune function' response.
437 Only one response per target session can be outstanding at any one time.
438 @param aStatus Used by RemCon to indicate completion of the send request.
439 @param aError The response error.
441 IMPORT_C void TuneFunctionResponse(TRequestStatus& aStatus, TInt aError);
443 /** Send a 'select disk function' response.
444 Only one response per target session can be outstanding at any one time.
445 @param aStatus Used by RemCon to indicate completion of the send request.
446 @param aError The response error.
448 IMPORT_C void SelectDiskFunctionResponse(TRequestStatus& aStatus, TInt aError);
450 /** Send a 'select AV input function' response.
451 Only one response per target session can be outstanding at any one time.
452 @param aStatus Used by RemCon to indicate completion of the send request.
453 @param aError The response error.
455 IMPORT_C void SelectAvInputFunctionResponse(TRequestStatus& aStatus, TInt aError);
457 /** Send a 'select audio input function' response.
458 Only one response per target session can be outstanding at any one time.
459 @param aStatus Used by RemCon to indicate completion of the send request.
460 @param aError The response error.
462 IMPORT_C void SelectAudioInputFunctionResponse(TRequestStatus& aStatus, TInt aError);
464 /** Send an 'F1' response.
465 Only one response per target session can be outstanding at any one time.
466 @param aStatus Used by RemCon to indicate completion of the send request.
467 @param aError The response error.
469 IMPORT_C void F1Response(TRequestStatus& aStatus, TInt aError);
471 /** Send an 'F2' response.
472 Only one response per target session can be outstanding at any one time.
473 @param aStatus Used by RemCon to indicate completion of the send request.
474 @param aError The response error.
476 IMPORT_C void F2Response(TRequestStatus& aStatus, TInt aError);
478 /** Send an 'F3' response.
479 Only one response per target session can be outstanding at any one time.
480 @param aStatus Used by RemCon to indicate completion of the send request.
481 @param aError The response error.
483 IMPORT_C void F3Response(TRequestStatus& aStatus, TInt aError);
485 /** Send an 'F4' response.
486 Only one response per target session can be outstanding at any one time.
487 @param aStatus Used by RemCon to indicate completion of the send request.
488 @param aError The response error.
490 IMPORT_C void F4Response(TRequestStatus& aStatus, TInt aError);
492 /** Send an 'F5' response.
493 Only one response per target session can be outstanding at any one time.
494 @param aStatus Used by RemCon to indicate completion of the send request.
495 @param aError The response error.
497 IMPORT_C void F5Response(TRequestStatus& aStatus, TInt aError);
500 Only one response per target session can be outstanding at any one time.
501 This function may be used to send a response when it is undesirable to use the
502 'specific' response-sending methods (PlayResponse, StopResponse etc).
503 @param aStatus Used by RemCon to indicate completion of the send request.
504 @param aOperationId The operation ID of the command we are sending a response to.
505 @param aError The response error.
507 IMPORT_C void SendResponse(TRequestStatus& aStatus, TRemConCoreApiOperationId aOperationId, TInt aError);
512 @param aInterfaceSelector The interface selector.
513 @param aObserver The observer of this interface.
515 CRemConCoreApiTarget(CRemConInterfaceSelector& aInterfaceSelector,
516 MRemConCoreApiTargetObserver& aObserver);
517 void ConstructL(const RArray<TRemConCoreApiOperationId>& aFeaturesSupported);
521 Utility to send a response.
522 @param aStatus TRequestStatus for the send operation.
523 @param aOperationId The operation ID.
525 void SendGenericResponse(TRequestStatus& aStatus,
526 TRemConCoreApiOperationId aOperationId,
529 private: // from CRemConInterfaceBase
530 TAny* GetInterfaceIf(TUid aUid);
532 private: // from MRemConInterfaceIf
533 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData);
536 void HandlePlay(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
537 void HandleTuneFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
538 void HandleSelectDiskFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
539 void HandleSelectAvInputFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
540 void HandleSelectAudioInputFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
542 void RemConCoreSetFeatures(TBool* aFeatureSupported);
545 MRemConCoreApiTargetObserver& iObserver;
548 TBuf8<KRemConCoreApiMaxOperationSpecificDataSize> iRspData;
550 TFixedArray<TBool,ELargestOperationId> iOutstandingOperations;
553 #endif // REMCONCOREAPITARGET_H