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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 #ifndef REMCONCOREAPITARGET_H
25 #define REMCONCOREAPITARGET_H
28 #include <remcon/remconinterfacebase.h>
29 #include <remconcoreapi.h>
30 #include <remcon/remconinterfaceif.h>
32 class MRemConCoreApiTargetObserver;
33 class CRemConInterfaceSelector;
36 Client-instantiable type supporting sending Core API responses.
38 NONSHARABLE_CLASS(CRemConCoreApiTarget) : public CRemConInterfaceBase,
39 public MRemConInterfaceIf
44 @param aInterfaceSelector The interface selector. The client must have
45 created one of these first.
46 @param aObserver The observer of this interface.
47 @return A new CRemConCoreApiTarget, owned by the interface selector.
49 IMPORT_C static CRemConCoreApiTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
50 MRemConCoreApiTargetObserver& aObserver);
53 IMPORT_C ~CRemConCoreApiTarget();
56 /** Send a 'select' response.
57 Only one response per target session can be outstanding at any one time.
58 @param aStatus Used by RemCon to indicate completion of the send request.
59 @param aError The response error.
61 IMPORT_C void SelectResponse(TRequestStatus& aStatus, TInt aError);
63 /** Send an 'up' response.
64 Only one response per target session can be outstanding at any one time.
65 @param aStatus Used by RemCon to indicate completion of the send request.
66 @param aError The response error.
68 IMPORT_C void UpResponse(TRequestStatus& aStatus, TInt aError);
70 /** Send a 'down' response.
71 Only one response per target session can be outstanding at any one time.
72 @param aStatus Used by RemCon to indicate completion of the send request.
73 @param aError The response error.
75 IMPORT_C void DownResponse(TRequestStatus& aStatus, TInt aError);
77 /** Send a 'left' response.
78 Only one response per target session can be outstanding at any one time.
79 @param aStatus Used by RemCon to indicate completion of the send request.
80 @param aError The response error.
82 IMPORT_C void LeftResponse(TRequestStatus& aStatus, TInt aError);
84 /** Send a 'right' response.
85 Only one response per target session can be outstanding at any one time.
86 @param aStatus Used by RemCon to indicate completion of the send request.
87 @param aError The response error.
89 IMPORT_C void RightResponse(TRequestStatus& aStatus, TInt aError);
91 /** Send a 'right up' response.
92 Only one response per target session can be outstanding at any one time.
93 @param aStatus Used by RemCon to indicate completion of the send request.
94 @param aError The response error.
96 IMPORT_C void RightUpResponse(TRequestStatus& aStatus, TInt aError);
98 /** Send a 'right down' response.
99 Only one response per target session can be outstanding at any one time.
100 @param aStatus Used by RemCon to indicate completion of the send request.
101 @param aError The response error.
103 IMPORT_C void RightDownResponse(TRequestStatus& aStatus, TInt aError);
105 /** Send a 'left up' response.
106 Only one response per target session can be outstanding at any one time.
107 @param aStatus Used by RemCon to indicate completion of the send request.
108 @param aError The response error.
110 IMPORT_C void LeftUpResponse(TRequestStatus& aStatus, TInt aError);
112 /** Send a 'left down' response.
113 Only one response per target session can be outstanding at any one time.
114 @param aStatus Used by RemCon to indicate completion of the send request.
115 @param aError The response error.
117 IMPORT_C void LeftDownResponse(TRequestStatus& aStatus, TInt aError);
119 /** Send a 'root menu' response.
120 Only one response per target session can be outstanding at any one time.
121 @param aStatus Used by RemCon to indicate completion of the send request.
122 @param aError The response error.
124 IMPORT_C void RootMenuResponse(TRequestStatus& aStatus, TInt aError);
126 /** Send a 'setup menu' response.
127 Only one response per target session can be outstanding at any one time.
128 @param aStatus Used by RemCon to indicate completion of the send request.
129 @param aError The response error.
131 IMPORT_C void SetupMenuResponse(TRequestStatus& aStatus, TInt aError);
133 /** Send a 'contents menu' response.
134 Only one response per target session can be outstanding at any one time.
135 @param aStatus Used by RemCon to indicate completion of the send request.
136 @param aError The response error.
138 IMPORT_C void ContentsMenuResponse(TRequestStatus& aStatus, TInt aError);
140 /** Send a 'favorite menu' response.
141 Only one response per target session can be outstanding at any one time.
142 @param aStatus Used by RemCon to indicate completion of the send request.
143 @param aError The response error.
145 IMPORT_C void FavoriteMenuResponse(TRequestStatus& aStatus, TInt aError);
147 /** Send an 'exit' response.
148 Only one response per target session can be outstanding at any one time.
149 @param aStatus Used by RemCon to indicate completion of the send request.
150 @param aError The response error.
152 IMPORT_C void ExitResponse(TRequestStatus& aStatus, TInt aError);
154 /** Send a '0' response.
155 Only one response per target session can be outstanding at any one time.
156 @param aStatus Used by RemCon to indicate completion of the send request.
157 @param aError The response error.
159 IMPORT_C void _0Response(TRequestStatus& aStatus, TInt aError);
161 /** Send a '1' response.
162 Only one response per target session can be outstanding at any one time.
163 @param aStatus Used by RemCon to indicate completion of the send request.
164 @param aError The response error.
166 IMPORT_C void _1Response(TRequestStatus& aStatus, TInt aError);
168 /** Send a '2' response.
169 Only one response per target session can be outstanding at any one time.
170 @param aStatus Used by RemCon to indicate completion of the send request.
171 @param aError The response error.
173 IMPORT_C void _2Response(TRequestStatus& aStatus, TInt aError);
175 /** Send a '3' response.
176 Only one response per target session can be outstanding at any one time.
177 @param aStatus Used by RemCon to indicate completion of the send request.
178 @param aError The response error.
180 IMPORT_C void _3Response(TRequestStatus& aStatus, TInt aError);
182 /** Send a '4'response.
183 Only one response per target session can be outstanding at any one time.
184 @param aStatus Used by RemCon to indicate completion of the send request.
185 @param aError The response error.
187 IMPORT_C void _4Response(TRequestStatus& aStatus, TInt aError);
189 /** Send a '5' response.
190 Only one response per target session can be outstanding at any one time.
191 @param aStatus Used by RemCon to indicate completion of the send request.
192 @param aError The response error.
194 IMPORT_C void _5Response(TRequestStatus& aStatus, TInt aError);
196 /** Send a '6' response.
197 Only one response per target session can be outstanding at any one time.
198 @param aStatus Used by RemCon to indicate completion of the send request.
199 @param aError The response error.
201 IMPORT_C void _6Response(TRequestStatus& aStatus, TInt aError);
203 /** Send a '7' response.
204 Only one response per target session can be outstanding at any one time.
205 @param aStatus Used by RemCon to indicate completion of the send request.
206 @param aError The response error.
208 IMPORT_C void _7Response(TRequestStatus& aStatus, TInt aError);
210 /** Send a '8' response.
211 Only one response per target session can be outstanding at any one time.
212 @param aStatus Used by RemCon to indicate completion of the send request.
213 @param aError The response error.
215 IMPORT_C void _8Response(TRequestStatus& aStatus, TInt aError);
217 /** Send a '9' response.
218 Only one response per target session can be outstanding at any one time.
219 @param aStatus Used by RemCon to indicate completion of the send request.
220 @param aError The response error.
222 IMPORT_C void _9Response(TRequestStatus& aStatus, TInt aError);
224 /** Send a 'dot' response.
225 Only one response per target session can be outstanding at any one time.
226 @param aStatus Used by RemCon to indicate completion of the send request.
227 @param aError The response error.
229 IMPORT_C void DotResponse(TRequestStatus& aStatus, TInt aError);
231 /** Send an 'enter' response.
232 Only one response per target session can be outstanding at any one time.
233 @param aStatus Used by RemCon to indicate completion of the send request.
234 @param aError The response error.
236 IMPORT_C void EnterResponse(TRequestStatus& aStatus, TInt aError);
238 /** Send a 'clear' response.
239 Only one response per target session can be outstanding at any one time.
240 @param aStatus Used by RemCon to indicate completion of the send request.
241 @param aError The response error.
243 IMPORT_C void ClearResponse(TRequestStatus& aStatus, TInt aError);
245 /** Send a 'channel up' response.
246 Only one response per target session can be outstanding at any one time.
247 @param aStatus Used by RemCon to indicate completion of the send request.
248 @param aError The response error.
250 IMPORT_C void ChannelUpResponse(TRequestStatus& aStatus, TInt aError);
252 /** Send a 'channel down' response.
253 Only one response per target session can be outstanding at any one time.
254 @param aStatus Used by RemCon to indicate completion of the send request.
255 @param aError The response error.
257 IMPORT_C void ChannelDownResponse(TRequestStatus& aStatus, TInt aError);
259 /** Send a 'previous channel' response.
260 Only one response per target session can be outstanding at any one time.
261 @param aStatus Used by RemCon to indicate completion of the send request.
262 @param aError The response error.
264 IMPORT_C void PreviousChannelResponse(TRequestStatus& aStatus, TInt aError);
266 /** Send a 'sound select' response.
267 Only one response per target session can be outstanding at any one time.
268 @param aStatus Used by RemCon to indicate completion of the send request.
269 @param aError The response error.
271 IMPORT_C void SoundSelectResponse(TRequestStatus& aStatus, TInt aError);
273 /** Send a 'input select' response.
274 Only one response per target session can be outstanding at any one time.
275 @param aStatus Used by RemCon to indicate completion of the send request.
276 @param aError The response error.
278 IMPORT_C void InputSelectResponse(TRequestStatus& aStatus, TInt aError);
280 /** Send a 'display information' response.
281 Only one response per target session can be outstanding at any one time.
282 @param aStatus Used by RemCon to indicate completion of the send request.
283 @param aError The response error.
285 IMPORT_C void DisplayInformationResponse(TRequestStatus& aStatus, TInt aError);
287 /** Send a 'help' response.
288 Only one response per target session can be outstanding at any one time.
289 @param aStatus Used by RemCon to indicate completion of the send request.
290 @param aError The response error.
292 IMPORT_C void HelpResponse(TRequestStatus& aStatus, TInt aError);
294 /** Send a 'page up' response.
295 Only one response per target session can be outstanding at any one time.
296 @param aStatus Used by RemCon to indicate completion of the send request.
297 @param aError The response error.
299 IMPORT_C void PageUpResponse(TRequestStatus& aStatus, TInt aError);
301 /** Send a 'page down' response.
302 Only one response per target session can be outstanding at any one time.
303 @param aStatus Used by RemCon to indicate completion of the send request.
304 @param aError The response error.
306 IMPORT_C void PageDownResponse(TRequestStatus& aStatus, TInt aError);
308 /** Send a 'power' response.
309 Only one response per target session can be outstanding at any one time.
310 @param aStatus Used by RemCon to indicate completion of the send request.
311 @param aError The response error.
313 IMPORT_C void PowerResponse(TRequestStatus& aStatus, TInt aError);
315 /** Send a 'volume up' response.
316 Only one response per target session can be outstanding at any one time.
317 @param aStatus Used by RemCon to indicate completion of the send request.
318 @param aError The response error.
320 IMPORT_C void VolumeUpResponse(TRequestStatus& aStatus, TInt aError);
322 /** Send a 'volume down' response.
323 Only one response per target session can be outstanding at any one time.
324 @param aStatus Used by RemCon to indicate completion of the send request.
325 @param aError The response error.
327 IMPORT_C void VolumeDownResponse(TRequestStatus& aStatus, TInt aError);
329 /** Send a 'mute' response.
330 Only one response per target session can be outstanding at any one time.
331 @param aStatus Used by RemCon to indicate completion of the send request.
332 @param aError The response error.
334 IMPORT_C void MuteResponse(TRequestStatus& aStatus, TInt aError);
336 /** Send a play response.
337 Only one response per target session can be outstanding at any one time.
338 @param aStatus Used by RemCon to indicate completion of the request.
339 @param aError The response error.
341 IMPORT_C void PlayResponse(TRequestStatus& aStatus, TInt aError);
343 /** Send a stop response.
344 Only one response per target session can be outstanding at any one time.
345 @param aStatus Used by RemCon to indicate completion of the request.
346 @param aError The response error.
348 IMPORT_C void StopResponse(TRequestStatus& aStatus, TInt aError);
350 /** Send a 'pause' response.
351 Only one response per target session can be outstanding at any one time.
352 @param aStatus Used by RemCon to indicate completion of the send request.
353 @param aError The response error.
355 IMPORT_C void PauseResponse(TRequestStatus& aStatus, TInt aError);
357 /** Send a 'record' response.
358 Only one response per target session can be outstanding at any one time.
359 @param aStatus Used by RemCon to indicate completion of the send request.
360 @param aError The response error.
362 IMPORT_C void RecordResponse(TRequestStatus& aStatus, TInt aError);
364 /** Send a 'rewind' response.
365 Only one response per target session can be outstanding at any one time.
366 @param aStatus Used by RemCon to indicate completion of the send request.
367 @param aError The response error.
369 IMPORT_C void RewindResponse(TRequestStatus& aStatus, TInt aError);
371 /** Send a 'fast forward' response.
372 Only one response per target session can be outstanding at any one time.
373 @param aStatus Used by RemCon to indicate completion of the send request.
374 @param aError The response error.
376 IMPORT_C void FastForwardResponse(TRequestStatus& aStatus, TInt aError);
378 /** Send an 'eject' response.
379 Only one response per target session can be outstanding at any one time.
380 @param aStatus Used by RemCon to indicate completion of the send request.
381 @param aError The response error.
383 IMPORT_C void EjectResponse(TRequestStatus& aStatus, TInt aError);
385 /** Send a 'forward' response.
386 Only one response per target session can be outstanding at any one time.
387 @param aStatus Used by RemCon to indicate completion of the send request.
388 @param aError The response error.
390 IMPORT_C void ForwardResponse(TRequestStatus& aStatus, TInt aError);
392 /** Send a 'backward' response.
393 Only one response per target session can be outstanding at any one time.
394 @param aStatus Used by RemCon to indicate completion of the send request.
395 @param aError The response error.
397 IMPORT_C void BackwardResponse(TRequestStatus& aStatus, TInt aError);
399 /** Send an 'angle' response.
400 Only one response per target session can be outstanding at any one time.
401 @param aStatus Used by RemCon to indicate completion of the send request.
402 @param aError The response error.
404 IMPORT_C void AngleResponse(TRequestStatus& aStatus, TInt aError);
406 /** Send a 'subpicture' response.
407 Only one response per target session can be outstanding at any one time.
408 @param aStatus Used by RemCon to indicate completion of the send request.
409 @param aError The response error.
411 IMPORT_C void SubpictureResponse(TRequestStatus& aStatus, TInt aError);
413 /** Send a 'pause play function' response.
414 Only one response per target session can be outstanding at any one time.
415 @param aStatus Used by RemCon to indicate completion of the send request.
416 @param aError The response error.
418 IMPORT_C void PausePlayFunctionResponse(TRequestStatus& aStatus, TInt aError);
420 /** Send a 'restore volume function' response.
421 Only one response per target session can be outstanding at any one time.
422 @param aStatus Used by RemCon to indicate completion of the send request.
423 @param aError The response error.
425 IMPORT_C void RestoreVolumeFunctionResponse(TRequestStatus& aStatus, TInt aError);
427 /** Send a 'tune function' response.
428 Only one response per target session can be outstanding at any one time.
429 @param aStatus Used by RemCon to indicate completion of the send request.
430 @param aError The response error.
432 IMPORT_C void TuneFunctionResponse(TRequestStatus& aStatus, TInt aError);
434 /** Send a 'select disk function' response.
435 Only one response per target session can be outstanding at any one time.
436 @param aStatus Used by RemCon to indicate completion of the send request.
437 @param aError The response error.
439 IMPORT_C void SelectDiskFunctionResponse(TRequestStatus& aStatus, TInt aError);
441 /** Send a 'select AV input function' response.
442 Only one response per target session can be outstanding at any one time.
443 @param aStatus Used by RemCon to indicate completion of the send request.
444 @param aError The response error.
446 IMPORT_C void SelectAvInputFunctionResponse(TRequestStatus& aStatus, TInt aError);
448 /** Send a 'select audio input function' response.
449 Only one response per target session can be outstanding at any one time.
450 @param aStatus Used by RemCon to indicate completion of the send request.
451 @param aError The response error.
453 IMPORT_C void SelectAudioInputFunctionResponse(TRequestStatus& aStatus, TInt aError);
455 /** Send an 'F1' response.
456 Only one response per target session can be outstanding at any one time.
457 @param aStatus Used by RemCon to indicate completion of the send request.
458 @param aError The response error.
460 IMPORT_C void F1Response(TRequestStatus& aStatus, TInt aError);
462 /** Send an 'F2' response.
463 Only one response per target session can be outstanding at any one time.
464 @param aStatus Used by RemCon to indicate completion of the send request.
465 @param aError The response error.
467 IMPORT_C void F2Response(TRequestStatus& aStatus, TInt aError);
469 /** Send an 'F3' response.
470 Only one response per target session can be outstanding at any one time.
471 @param aStatus Used by RemCon to indicate completion of the send request.
472 @param aError The response error.
474 IMPORT_C void F3Response(TRequestStatus& aStatus, TInt aError);
476 /** Send an 'F4' response.
477 Only one response per target session can be outstanding at any one time.
478 @param aStatus Used by RemCon to indicate completion of the send request.
479 @param aError The response error.
481 IMPORT_C void F4Response(TRequestStatus& aStatus, TInt aError);
483 /** Send an 'F5' response.
484 Only one response per target session can be outstanding at any one time.
485 @param aStatus Used by RemCon to indicate completion of the send request.
486 @param aError The response error.
488 IMPORT_C void F5Response(TRequestStatus& aStatus, TInt aError);
491 Only one response per target session can be outstanding at any one time.
492 This function may be used to send a response when it is undesirable to use the
493 'specific' response-sending methods (PlayResponse, StopResponse etc).
494 @param aStatus Used by RemCon to indicate completion of the send request.
495 @param aOperationId The operation ID of the command we are sending a response to.
496 @param aError The response error.
498 IMPORT_C void SendResponse(TRequestStatus& aStatus, TRemConCoreApiOperationId aOperationId, TInt aError);
503 @param aInterfaceSelector The interface selector.
504 @param aObserver The observer of this interface.
506 CRemConCoreApiTarget(CRemConInterfaceSelector& aInterfaceSelector,
507 MRemConCoreApiTargetObserver& aObserver);
511 Utility to send a response.
512 @param aStatus TRequestStatus for the send operation.
513 @param aOperationId The operation ID.
515 void SendGenericResponse(TRequestStatus& aStatus,
516 TRemConCoreApiOperationId aOperationId,
519 private: // from CRemConInterfaceBase
520 TAny* GetInterfaceIf(TUid aUid);
522 private: // from MRemConInterfaceIf
523 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData);
526 void HandlePlay(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
527 void HandleTuneFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
528 void HandleSelectDiskFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
529 void HandleSelectAvInputFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
530 void HandleSelectAudioInputFunction(const TDesC8& aData, TRemConCoreApiButtonAction aButton);
533 MRemConCoreApiTargetObserver& iObserver;
536 TBuf8<KRemConCoreApiMaxOperationSpecificDataSize> iRspData;
538 TFixedArray<TBool,ELargestOperationId> iOutstandingOperations;
541 #endif // REMCONCOREAPITARGET_H