|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Class that observer remote controller framework events |
|
15 * and forwards them as key events to observe |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CVRREMCONOBSERVER_H |
|
21 #define __CVRREMCONOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32def.h> |
|
25 #include <remconcoreapitargetobserver.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MVRVolumeEventObserver; |
|
29 class CRemConInterfaceSelector; |
|
30 class CRemConCoreApiTarget; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Class for monitoring side volume key events. |
|
36 * Is also responsible for creating repeating keypresses if key is held down |
|
37 * |
|
38 */ |
|
39 NONSHARABLE_CLASS( CVRRemConObserver ) |
|
40 : public CBase, public MRemConCoreApiTargetObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CVRRemConObserver* NewL( MVRVolumeEventObserver* aObserver ); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CVRRemConObserver(); |
|
53 |
|
54 protected: // Functions from base classes |
|
55 |
|
56 /** |
|
57 * @see MRemConCoreApiTargetObserver. |
|
58 * |
|
59 * A command has been received. |
|
60 * @param aOperationId The operation ID of the command. |
|
61 * @param aButtonAct The button action associated with the command. |
|
62 */ |
|
63 void MrccatoCommand( TRemConCoreApiOperationId aOperationId, |
|
64 TRemConCoreApiButtonAction aButtonAct); |
|
65 |
|
66 private: |
|
67 |
|
68 /** |
|
69 * C++ default constructor. |
|
70 */ |
|
71 CVRRemConObserver( MVRVolumeEventObserver* aObserver ); |
|
72 |
|
73 /** |
|
74 * By default Symbian 2nd phase constructor is private. |
|
75 */ |
|
76 void ConstructL(); |
|
77 |
|
78 /** |
|
79 * Catch timer event. Volume command is repeated |
|
80 @param aAny |
|
81 */ |
|
82 static TInt DoHandleVolumeRepeatL( TAny* aAny ); |
|
83 |
|
84 private: // Data |
|
85 /** Observer to notify about a event. Not owned. **/ |
|
86 MVRVolumeEventObserver* iObserver; |
|
87 |
|
88 /** Remote Controller. Owned */ |
|
89 CRemConInterfaceSelector* iInterfaceSelector; |
|
90 |
|
91 /** Remote Controller. Not owned. */ |
|
92 CRemConCoreApiTarget* iCoreTarget; |
|
93 |
|
94 /** Timer for counting key press. Owned. */ |
|
95 CPeriodic *iVolumeRepeatTimer; |
|
96 |
|
97 /** Status of volume command */ |
|
98 TBool iRemConVolumeCommandOk; |
|
99 |
|
100 /** Volume change that is repeated */ |
|
101 TKeyEvent iVolumeChange; |
|
102 }; |
|
103 |
|
104 #endif // CVRRemConObserver_H |
|
105 |
|
106 // End of File |