1 /* |
|
2 * Copyright (c) 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: It completes on a change in the volume property. Used for |
|
15 * the new Central Repository Server. Used in EKA2 builds only |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef VOLUMEKEYLISTENER_H |
|
21 #define VOLUMEKEYLISTENER_H |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <e32property.h> |
|
26 |
|
27 #include <centralrepository.h> |
|
28 #include<remconcoreapitargetobserver.h> //for MRemConCoreApiTargetObserver |
|
29 #include<remconinterfaceselector.h> //for CRemConInterfaceSelector |
|
30 #include<remconcoreapitarget.h> //for CRemConCoreApiTarget |
|
31 |
|
32 // |
|
33 // for emulator max volume = 65535 |
|
34 #define WINS_DEFAULT_VOLUME 43690 |
|
35 |
|
36 // |
|
37 // For HW max volume = 9 |
|
38 #define HW_DEFAULT_VOLUME 6 |
|
39 |
|
40 class MRepositoryVolumeObserver; |
|
41 |
|
42 // DATA TYPES |
|
43 // Used for volume up/down events |
|
44 enum TVolumeControlCommands |
|
45 { |
|
46 EVolumeControlCmdVolumeUpByOne, |
|
47 EVolumeControlCmdVolumeDownByOne |
|
48 }; |
|
49 |
|
50 NONSHARABLE_CLASS( CVolumeKeyListener ) : public CBase, |
|
51 public MRemConCoreApiTargetObserver |
|
52 { |
|
53 public: |
|
54 |
|
55 static CVolumeKeyListener* NewL( MRepositoryVolumeObserver* aObserver ); |
|
56 virtual ~CVolumeKeyListener(); |
|
57 TInt GetCurrentVolume(); |
|
58 /** |
|
59 * Function to add an observer |
|
60 */ |
|
61 void SetObserver( MRepositoryVolumeObserver* aObserver ); |
|
62 |
|
63 private: |
|
64 CVolumeKeyListener( MRepositoryVolumeObserver* aObserver ); |
|
65 void ConstructL(); |
|
66 |
|
67 //From MRemConCoreApiTargetObserver (remconcoreapitargetobserver.h) |
|
68 void MrccatoCommand( TRemConCoreApiOperationId aOperationId, |
|
69 TRemConCoreApiButtonAction aButtonAct ); |
|
70 |
|
71 /** |
|
72 * Handle repeat event |
|
73 */ |
|
74 void HandleRepeatEvent(); |
|
75 |
|
76 /** |
|
77 * Send play command to app UI or view. |
|
78 * @since 3.1 |
|
79 */ |
|
80 void FilterAndSendCommand(TInt aCommandId); |
|
81 /** |
|
82 * Callback for timer |
|
83 */ |
|
84 static TInt TimerCallback(TAny* aPtr); |
|
85 |
|
86 private: |
|
87 CRemConCoreApiTarget* iInterfaceSelector; |
|
88 CRemConInterfaceSelector* iSelector; |
|
89 CRepository* iCenRepos; |
|
90 CPeriodic* iTimer; // owned |
|
91 TInt iCommandId; |
|
92 // Stores the observers. |
|
93 MRepositoryVolumeObserver* iObserver; |
|
94 }; |
|
95 |
|
96 #endif //VOLUMEKEYLISTENER_H |
|
97 |
|
98 // End of File |
|