|
1 /* |
|
2 * Copyright (c) 2005-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: |
|
15 * Volume indicator controller class |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef SMILPLAYERVOLUMEINDICATORCONTROLLER_H |
|
22 #define SMILPLAYERVOLUMEINDICATORCONTROLLER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <coecntrl.h> |
|
26 #include <coecobs.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CEikImage; |
|
32 class TAknsItemID; |
|
33 class CRepository; |
|
34 class TAknLayoutRect; |
|
35 class CAknVolumePopup; |
|
36 |
|
37 // DATA TYPES |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * Controller class of volume indicator, |
|
43 * |
|
44 * @lib smilplayer.lib |
|
45 * @since 3.0 |
|
46 */ |
|
47 NONSHARABLE_CLASS(CSmilPlayerVolumeIndicatorController) : public CCoeControl, |
|
48 public MCoeControlObserver |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * |
|
55 * @param aParent A refence to the parent class. |
|
56 * |
|
57 * @return pointer to created CSmilPlayerVolumeIndicatorController |
|
58 */ |
|
59 static CSmilPlayerVolumeIndicatorController* NewL( const CCoeControl* aParent ); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CSmilPlayerVolumeIndicatorController(); |
|
65 |
|
66 public: // new functions |
|
67 |
|
68 /** |
|
69 * Returns current volume value |
|
70 * |
|
71 * @since 3.0 |
|
72 * |
|
73 * @return Current volume level. |
|
74 */ |
|
75 TInt VolumeValue() const; |
|
76 |
|
77 public: // Functions from base classes |
|
78 |
|
79 /** |
|
80 * From CCoeControl |
|
81 * See the documentation from the coecntrl.h |
|
82 */ |
|
83 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
84 TEventCode aType); |
|
85 |
|
86 /** |
|
87 * From MCoeControlObserver |
|
88 * See the documentation from the coecobs.h |
|
89 */ |
|
90 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
91 |
|
92 private: |
|
93 |
|
94 /** |
|
95 * By default Symbian 2nd phase constructor is private. |
|
96 */ |
|
97 void ConstructL( const CCoeControl* aParent ); |
|
98 |
|
99 /** |
|
100 * C++ constructor. |
|
101 */ |
|
102 CSmilPlayerVolumeIndicatorController(); |
|
103 |
|
104 /** |
|
105 * Returns the initial volume level. |
|
106 */ |
|
107 TInt InitialVolumeLevelL() const; |
|
108 |
|
109 /** |
|
110 * Stores volume level to central repository. |
|
111 */ |
|
112 void StoreAudioVolume(); |
|
113 |
|
114 private: // New functions |
|
115 |
|
116 private: |
|
117 |
|
118 // Used for storing volume level |
|
119 CRepository* iRepository; |
|
120 |
|
121 // Stores the initial volume level |
|
122 TInt iInitialVolumeLevel; |
|
123 |
|
124 // Volume popup |
|
125 CAknVolumePopup* iVolumePopup; |
|
126 }; |
|
127 |
|
128 #endif // SMILPLAYERVOLUMEINDICATORCONTROLLER_H |
|
129 |
|
130 // End of File |