|
1 /* |
|
2 * Copyright (c) 2007 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: Base class for video preference setting list. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_VTUIPEFSETTINGLISTBASE_H |
|
20 #define C_VTUIPEFSETTINGLISTBASE_H |
|
21 |
|
22 #include <AknTransparentCameraSettingPage.h> |
|
23 #include "mvtuicommandui.h" |
|
24 #include "cvtuifeaturebase.h" |
|
25 #include "mvtuicomponent.h" |
|
26 #include "tvtuicomponentstate.h" |
|
27 #include "tvtuifeatureids.h" |
|
28 #include "mvtuisettingpageobserver.h" |
|
29 |
|
30 class CVtUiAppUi; |
|
31 class CVtUiTransparentSettingPage; |
|
32 class MVtEngCameraPreferences; |
|
33 |
|
34 /** |
|
35 * CVtUiPrefSettingListBase |
|
36 * |
|
37 * Base class for color tone and white balance |
|
38 * |
|
39 * @since S60 v3.2 |
|
40 */ |
|
41 class CVtUiPrefSettingListBase : public CVtUiFeatureBase, |
|
42 public MAknSettingPageObserver, MVtUiSettingPageObserver |
|
43 { |
|
44 |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 ~CVtUiPrefSettingListBase(); |
|
51 |
|
52 /** |
|
53 * has pending settingpange changed cmd cause camera cover switched. |
|
54 */ |
|
55 TBool IsPendingCmd(); |
|
56 |
|
57 /** |
|
58 * handle pending settingpange command |
|
59 */ |
|
60 void HandlePendingCmdL(); |
|
61 |
|
62 public: // from MVtUiFeature |
|
63 |
|
64 /** |
|
65 * @see MVtUiFeature::Stop |
|
66 */ |
|
67 virtual void Stop() = 0; |
|
68 |
|
69 /** |
|
70 * @see MVtUiFeature::InitFeatureL |
|
71 */ |
|
72 virtual void InitFeatureL(); |
|
73 |
|
74 protected: // from MAknSettingPageObserver |
|
75 |
|
76 /** |
|
77 * @see MAknSettingPageObserver::HandleSettingPageEventL |
|
78 */ |
|
79 void HandleSettingPageEventL( |
|
80 CAknSettingPage* aSettingPage, |
|
81 TAknSettingPageEvent aEventType ); |
|
82 |
|
83 protected: // from MVtUiSettingPageObserver |
|
84 |
|
85 /** |
|
86 * @see MVtUiSettingPageObserver::ListStateChangedL |
|
87 */ |
|
88 void ListStateChangedL(); |
|
89 |
|
90 protected: |
|
91 |
|
92 // Gets currently selected list item |
|
93 virtual TInt CurrentSelection() = 0; |
|
94 |
|
95 // Set items to setting page |
|
96 virtual void SetItemsL( CDesCArray& aArray ) = 0; |
|
97 |
|
98 // Gets resource id for selection list |
|
99 virtual TInt SettingPageResId() const = 0; |
|
100 |
|
101 // This function gets called when focus is moved |
|
102 // to new item in the settin page list |
|
103 virtual void SettingPageItemChangedL( TInt aIndex ) = 0; |
|
104 |
|
105 // Start function calls this |
|
106 void StartSettingPageL(); |
|
107 |
|
108 // Stop function calls this |
|
109 void StopSettingPageL(); |
|
110 |
|
111 public: // from CCoeControl |
|
112 |
|
113 /* |
|
114 * @see CCoeControl::SizeChanged |
|
115 */ |
|
116 void SizeChanged(); |
|
117 |
|
118 public: |
|
119 |
|
120 /** |
|
121 * Updates setting pages background bitmap |
|
122 * @param aFrame Bitmap for setting page's backgound. |
|
123 */ |
|
124 void UpdateBackground( CFbsBitmap* aFrame ); |
|
125 |
|
126 /** |
|
127 * Updates setting value |
|
128 * E.g disabling video will reset camera settings. and |
|
129 * after enabling video camera setting value needs to be restored. |
|
130 */ |
|
131 void UpdateSettingL(); |
|
132 |
|
133 protected: |
|
134 |
|
135 /** |
|
136 * Constructor |
|
137 */ |
|
138 CVtUiPrefSettingListBase( CVtUiFeatureManager& aFeatureManager, |
|
139 TVtUiFeatureId aFeatureId ); |
|
140 |
|
141 /** |
|
142 * 2nd constructor |
|
143 */ |
|
144 void ConstructL(); |
|
145 |
|
146 // Reads item from resource and appends it to the array |
|
147 void ReadAndAppendItemL( CDesCArray& aItems, TInt aResId ); |
|
148 |
|
149 private: |
|
150 |
|
151 // Does the initialisation of the setting page |
|
152 void CreateSettingPageL(); |
|
153 |
|
154 // Resizes backround bitmap |
|
155 void ResizeBackroundBitmapRect( ); |
|
156 |
|
157 // Sort controls window position |
|
158 void SortControlsWindowPoistion(); |
|
159 |
|
160 protected: |
|
161 |
|
162 // Pointer to camera preferences |
|
163 MVtEngCameraPreferences* iCameraPref; |
|
164 |
|
165 // The original value (which was active when the |
|
166 // setting page was launched) |
|
167 TInt iOriginalSelection; |
|
168 |
|
169 // Supported color tone or white balance modes |
|
170 TUint32 iSupportedModes; |
|
171 |
|
172 // Contains currenltly supported items in setting page |
|
173 RArray< TInt> iActiveItems; |
|
174 |
|
175 // whether or not has a pending command |
|
176 TBool iPendingSettingChangeCmd; |
|
177 |
|
178 private: |
|
179 |
|
180 // Owned setting page instance |
|
181 CVtUiTransparentSettingPage* iSettingPage; |
|
182 |
|
183 // Background bitmap for setting page |
|
184 CFbsBitmap* iViewfinderBitmap; |
|
185 |
|
186 // Currently focused value |
|
187 TInt iCurrentSelection; |
|
188 |
|
189 // Position of bitmap's top left corner |
|
190 TPoint iBitmapTopLeftCorner; |
|
191 |
|
192 // Background bitmap's clip rect |
|
193 TRect iBitmapClippingRect; |
|
194 |
|
195 // Reference to appui |
|
196 CVtUiAppUi& iAppUi; |
|
197 }; |
|
198 |
|
199 #endif // CVTUIPEFSETTINGLISTBASE_H |