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 the License "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: AO that completes on a change in the volume property. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BAVPVOLUMEHANDLER_H |
|
20 #define BAVPVOLUMEHANDLER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <CenRepNotifyHandler.h> |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KGeneralProfile = 0; |
|
27 const TInt KSilentProfile = 1; |
|
28 const TInt KMeetingProfile = 2; |
|
29 |
|
30 // The Central Depository volume values: |
|
31 // 0(mute), 2, 5, 8, 10(maximum) |
|
32 // Used to populate the initial volume and the volume dialog |
|
33 const TInt KCRVolume0 = 0; |
|
34 const TInt KCRVolume2 = 2; |
|
35 const TInt KCRVolume5 = 5; |
|
36 const TInt KCRVolume8 = 8; |
|
37 const TInt KCRVolume10 = 10; |
|
38 const TInt KCRVolumeMute = KCRVolume0; |
|
39 const TInt KCRVolumeMax = KCRVolume10; |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class MBavpVolumeObserver; |
|
43 class CCenRepNotifyHandler; |
|
44 class CRepository; |
|
45 |
|
46 /** |
|
47 * CBavpVolumeHandler class for soft volume handling |
|
48 * @lib npBrowserVideoPlugin.lib |
|
49 * @since 3.2 |
|
50 */ |
|
51 class CBavpVolumeHandler : public CBase, |
|
52 public MCenRepNotifyHandlerCallback |
|
53 { |
|
54 public: |
|
55 // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CBavpVolumeHandler* NewL( MBavpVolumeObserver* aObserver ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 ~CBavpVolumeHandler(); |
|
66 |
|
67 /** |
|
68 * function impl for MCenRepNotifyHandlerCallback interface |
|
69 * @since 3.1 |
|
70 * @param TInt aVolume - volume value to be set to |
|
71 * @return void |
|
72 */ |
|
73 void HandleNotifyInt( const TUint32 aKeyId, TInt aNewValue ); |
|
74 |
|
75 private: |
|
76 /** |
|
77 * C++ default constructor. |
|
78 */ |
|
79 CBavpVolumeHandler( MBavpVolumeObserver* aObserver ); |
|
80 |
|
81 /** |
|
82 * By default Symbian 2nd phase constructor is private. |
|
83 */ |
|
84 void ConstructL(); |
|
85 |
|
86 private: |
|
87 |
|
88 MBavpVolumeObserver* iObserver; |
|
89 |
|
90 // Central repository for Volume settings |
|
91 CRepository* iVolumeRepository; |
|
92 |
|
93 // Handler to notify volume changes in central repository |
|
94 CCenRepNotifyHandler* iVolumeCRHandler; |
|
95 |
|
96 // Current volume settings |
|
97 TInt iCurrentVolume; |
|
98 |
|
99 // Previous volume settings, save for mute/unmute |
|
100 TInt iPreviousVolume; |
|
101 |
|
102 // Central repository for Profiles |
|
103 CRepository* iProfileRepository; |
|
104 |
|
105 // Handler to notify Profile changes in central repository |
|
106 CCenRepNotifyHandler* iProfileCRHandler; |
|
107 |
|
108 // Current profile settings |
|
109 TInt iCurrentProfile; |
|
110 }; |
|
111 |
|
112 #endif //BAVPVOLUMEHANDLER_H |
|