|
1 /* |
|
2 * Copyright (c) 2005 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: Declares class for frequency band container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef EQUALIZERFREQBANDCONTAINER_H |
|
22 #define EQUALIZERFREQBANDCONTAINER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <AknDialog.h> |
|
26 #include "EqualizerFreqBand.h" |
|
27 #include "EqualizerPrivateConstants.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CAudioEqualizerUtility; |
|
31 class CAudioEqualizer; |
|
32 class CAknsBasicBackgroundControlContext; |
|
33 |
|
34 // CLASS DECLARATIONS |
|
35 |
|
36 ////////////////////////////////////////////////////////////////////////////// |
|
37 // |
|
38 // -----> CEqualizerFreqBandContainer(definition) |
|
39 // |
|
40 ////////////////////////////////////////////////////////////////////////////// |
|
41 NONSHARABLE_CLASS(CEqualizerFreqBandContainer) : public CCoeControl |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * This function is called to create an object of |
|
46 * type CEqualizerFreqBandContainer - First phase Constructor |
|
47 * @since 3.0 |
|
48 * @param aaEqEditingDialog a reference to CEqualizerEditingDialog |
|
49 * @param aAudEqUtility a pointer to CAudioEqualizerUtility |
|
50 * @param aPresetIndex the index of the Preset being edited |
|
51 * @param aIsActivePreset whether the preset is active or not? |
|
52 * @param aRect the CEqualizerFreqBandContainer rectangle |
|
53 */ |
|
54 CEqualizerFreqBandContainer( |
|
55 CEqualizerEditingDialog* aEqEditingDialog, |
|
56 CAudioEqualizerUtility* aAudEqUtility, |
|
57 const TInt aPresetIndex, const TBool aIsActivePreset, TRect& aRect, |
|
58 MEqualizerPresetActivationObserver& aObserver, TInt aPresetKey, |
|
59 TPresetName& aPresetName ); |
|
60 /** |
|
61 * Destructor |
|
62 * @since 3.0 |
|
63 */ |
|
64 virtual ~CEqualizerFreqBandContainer(); |
|
65 |
|
66 public: |
|
67 /** |
|
68 * Handles key events |
|
69 * @param aKeyEvent key event. |
|
70 * @param aType key code |
|
71 * @return TKeyResponse |
|
72 */ |
|
73 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
74 |
|
75 |
|
76 private: //New Functions |
|
77 void ConstructL(TRect& aRect); |
|
78 /** |
|
79 * This function is used to swap the focus from one control to other |
|
80 * @since 3.0 |
|
81 * @param aPrevControl Previous control |
|
82 * @param aNewControl New Control |
|
83 */ |
|
84 void SwapFocus(CCoeControl* aPrevControl, CCoeControl* aNewControl) ; |
|
85 |
|
86 /** |
|
87 * This function is used to construct the frequency value labels |
|
88 * @since 3.2 |
|
89 */ |
|
90 void ConstructLabelsL(); |
|
91 |
|
92 public: // New functions |
|
93 /** |
|
94 * This function is used to set new values for CAudioEqualizerUtility* |
|
95 * @since 3.0 |
|
96 * @param aAudEqUtility New pointer to CAudioEqualizerUtility |
|
97 */ |
|
98 void SetAudioEqualizerL(CAudioEqualizerUtility* aAudEqUtility); |
|
99 |
|
100 private: //Functions from base classes |
|
101 /** |
|
102 * This function is called by the framework whenever a custom control |
|
103 * is constructed inside the Dialog |
|
104 */ |
|
105 void ConstructFromResourceL(TResourceReader& aReader); |
|
106 /** |
|
107 * Virtual, defined by CCoeControl; replaces the default implementation |
|
108 * provided by CCoeControl. |
|
109 */ |
|
110 void Draw(const TRect& /*aRect*/) const; |
|
111 |
|
112 /** |
|
113 * Virtual, defined by CCoeControl; replaces the default implementation |
|
114 * provided by CCoeControl. |
|
115 */ |
|
116 TInt CountComponentControls() const; |
|
117 |
|
118 /** Virtual, defined by CCoeControl; replaces the default implementation |
|
119 * provided by CCoeControl. |
|
120 */ |
|
121 CCoeControl* ComponentControl(TInt aIndex) const; |
|
122 /** |
|
123 *Virtual, defined by CCoeControl; empty implementation provided by |
|
124 * CCoeControl; full implementation provided by this class |
|
125 */ |
|
126 void SizeChanged(); |
|
127 /* |
|
128 * From CCoeControl Called when a control's focus is changed |
|
129 */ |
|
130 void FocusChanged(TDrawNow aDrawNow); |
|
131 |
|
132 /* |
|
133 * From CCoeControl |
|
134 * @see CCoeControl |
|
135 */ |
|
136 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
137 |
|
138 #ifdef RD_SCALABLE_UI_V2 |
|
139 /* |
|
140 * From CCoeControl |
|
141 * @see CCoeControl |
|
142 */ |
|
143 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
144 #endif //RD_SCALABLE_UI_V2 |
|
145 |
|
146 private: |
|
147 // Data members defined and used by this class. |
|
148 //Array of frequency band pointers |
|
149 CArrayPtr<CEqualizerFreqBand>* iFreqBand; |
|
150 // Stores the currently focussed frequency band |
|
151 CCoeControl* iFocussedFreqBand; |
|
152 // Stores the Index of the currently focussed frequency band |
|
153 TUint iIndexOfFocussedFreqBand; |
|
154 // Used to store a pointer to CEqualizerEditingDialog |
|
155 CEqualizerEditingDialog* iEqEditingDialog; |
|
156 // Used to store a pointer to CAudioEqualizerUtility |
|
157 CAudioEqualizerUtility* iAudEqUtility; |
|
158 // Used to store the preset index |
|
159 const TInt iPresetIndex; |
|
160 // Whether the preset displayed is an active preset? |
|
161 const TBool iIsActivePreset; |
|
162 // Rectangle in which to display the control |
|
163 TRect& iRect; |
|
164 // Number of Frequency bands |
|
165 TUint iNumberOfFreqBands; |
|
166 // For skin in the background |
|
167 CAknsBasicBackgroundControlContext* iBackGround; |
|
168 //Array of frequence band labels |
|
169 CArrayPtr<CEikLabel>* iFreqLabels; |
|
170 |
|
171 // Observer for changing equalizer presets |
|
172 MEqualizerPresetActivationObserver& iObserver; |
|
173 TInt iPresetKey; |
|
174 |
|
175 // Used to indicate a band is selected in touch |
|
176 TBool iBandSelected; |
|
177 |
|
178 // Used to store the preset name |
|
179 TPresetName iPresetName; |
|
180 |
|
181 }; |
|
182 |
|
183 #endif //EQUALIZERFREQBANDCONTAINER_H |
|
184 |
|
185 // End of File |