|
1 // Copyright (c) 2010 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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedAll |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef REMCONSIDEKEYTARGET_H |
|
23 #define REMCONSIDEKEYTARGET_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <remcon/remconinterfacebase.h> |
|
27 #include <remcon/remconinterfaceif.h> |
|
28 |
|
29 class MRemConSideKeyTargetObserver; |
|
30 class CRemConInterfaceSelector; |
|
31 |
|
32 /** |
|
33 Client-instantiable type supporting sending SideKey API responses. |
|
34 */ |
|
35 NONSHARABLE_CLASS(CRemConSideKeyTarget) : public CRemConInterfaceBase, |
|
36 public MRemConInterfaceIf |
|
37 { |
|
38 public: |
|
39 /** |
|
40 Factory function. |
|
41 @param aInterfaceSelector The interface selector. The client must have |
|
42 created one of these first. |
|
43 @param aObserver The observer of this interface. |
|
44 @return A new CRemConSideKeyTarget, owned by the interface selector. |
|
45 */ |
|
46 IMPORT_C static CRemConSideKeyTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
47 MRemConSideKeyTargetObserver& aObserver); |
|
48 |
|
49 IMPORT_C ~CRemConSideKeyTarget(); |
|
50 |
|
51 public: |
|
52 /** |
|
53 Sends a response to a 'side key up' command. |
|
54 @param aError The response error. |
|
55 */ |
|
56 IMPORT_C void SideKeyUpResponse(TInt aError); |
|
57 |
|
58 /** |
|
59 Sends a response to a 'side key down' command. |
|
60 @param aError The response error. |
|
61 */ |
|
62 IMPORT_C void SideKeyDownResponse(TInt aError); |
|
63 |
|
64 |
|
65 private: |
|
66 /** |
|
67 Constructor. |
|
68 @param aInterfaceSelector The interface selector. |
|
69 @param aObserver The observer of this interface. |
|
70 */ |
|
71 CRemConSideKeyTarget(CRemConInterfaceSelector& aInterfaceSelector, |
|
72 MRemConSideKeyTargetObserver& aObserver); |
|
73 |
|
74 private: // from CRemConInterfaceBase |
|
75 TAny* GetInterfaceIf(TUid aUid); |
|
76 |
|
77 private: // from MRemConInterfaceIf |
|
78 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
79 |
|
80 private: // unowned |
|
81 MRemConSideKeyTargetObserver& iObserver; |
|
82 |
|
83 private: // owned |
|
84 // For operation-specific data. |
|
85 static const TUint KMaxOperationDataSize = 0x04; |
|
86 TBuf8<KMaxOperationDataSize> iOutData; |
|
87 }; |
|
88 |
|
89 #endif // REMCONSIDEKEYTARGET_H |