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: SidePane Control* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMSIDEPANE_H |
|
19 #define CAMSIDEPANE_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include "CamSelfTimerObserver.h" |
|
24 #include "CamBurstModeObserver.h" |
|
25 #include "CamResourceLoader.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CCamIndicator; |
|
29 class CCamIndicatorData; |
|
30 class CCamIndicatorResourceReader; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 enum ECamSidePaneFlashState |
|
35 { // Used to indicate whether to turn flashing indicators on or off |
|
36 ECamSidePaneFlashOff, |
|
37 ECamSidePaneFlashOn |
|
38 }; |
|
39 |
|
40 /** |
|
41 * Side Pane control |
|
42 */ |
|
43 class CCamSidePane : public CBase, |
|
44 public MCamControllerObserver, |
|
45 public MCamResourceLoader |
|
46 #ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
47 ,public MCamBurstModeObserver |
|
48 #endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
49 { |
|
50 // ========================================================================= |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Symbian OS two-phased constructor |
|
55 * @since 2.8 |
|
56 * @param aController reference to CCamAppControllerBase instance |
|
57 * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder |
|
58 * @return created CCamSidePane object |
|
59 */ |
|
60 static CCamSidePane* NewL( CCamAppController& aController, |
|
61 TBool aOverlayViewFinder ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CCamSidePane(); |
|
67 |
|
68 public: // From MCamResourceLoader |
|
69 |
|
70 /** |
|
71 * From MCamResourceLoader |
|
72 * @since 3.0 |
|
73 */ |
|
74 void LoadResourceDataL(); |
|
75 |
|
76 /** |
|
77 * From MCamResourceLoader |
|
78 * @since 3.0 |
|
79 */ |
|
80 void UnloadResourceData(); |
|
81 |
|
82 /** |
|
83 * From MCamResourceLoader |
|
84 * @since 3.0 |
|
85 */ |
|
86 void ReloadResourceDataL(); |
|
87 |
|
88 public: // New functions |
|
89 |
|
90 /** |
|
91 * Is the zoom pane visible? |
|
92 * @since 2.8 |
|
93 * @return ETrue if the zoom pane is visible |
|
94 */ |
|
95 TBool IsVisible(); |
|
96 |
|
97 /** |
|
98 * Tells the zoom pane whether it is on display |
|
99 * @since 2.8 |
|
100 * @param aVisible ETrue to make the zoom pane invisible |
|
101 */ |
|
102 void MakeVisible( TBool aVisible ); |
|
103 |
|
104 /** |
|
105 * Draws all the indicators that are displayed in the side pane |
|
106 * @since 2.8 |
|
107 * @param aGc The graphics context to use for drawing |
|
108 */ |
|
109 void Draw( CBitmapContext& aGc ) const; |
|
110 |
|
111 /** |
|
112 * Set draw rect |
|
113 * @since 2.8 |
|
114 * @param Rect to draw into |
|
115 */ |
|
116 void SetRect( TRect& aRect ); |
|
117 |
|
118 /** |
|
119 * Set current capture mode |
|
120 * @since 2.8 |
|
121 * @param aMode Capture mode |
|
122 */ |
|
123 void SetCaptureMode( TCamCameraMode aMode ); |
|
124 |
|
125 /** |
|
126 * Set up initial state of side pane |
|
127 * @since 2.8 |
|
128 */ |
|
129 void SetInitialState(); |
|
130 |
|
131 /** |
|
132 * Updates the layouts for each indicator in sidepane |
|
133 * @since S60 5.0 |
|
134 */ |
|
135 void UpdateLayout(); |
|
136 |
|
137 /** |
|
138 * Draw's/Clear's mode indicator. Used for blinking mode indicator. |
|
139 * @since S60 5.1 |
|
140 * @param aGc Graphics context to draw the indicator |
|
141 * @param aDrawIcon Whether the indicator should be drawn or cleared |
|
142 */ |
|
143 void DrawModeIndicator( CWindowGc& aGc, TBool aDrawIcon ); |
|
144 |
|
145 /** |
|
146 * Returns mode indicator layout rect. Used for blinking mode indicator. |
|
147 * @since S60 5.1 |
|
148 */ |
|
149 TRect ModeIndicatorLayoutRect(); |
|
150 |
|
151 /** |
|
152 * Updates scene indicator with the provided bitmap. |
|
153 * @since S60 5.1 |
|
154 * @param aBitmapId, aMask Id of the indicator bitmap and mask |
|
155 */ |
|
156 void UpdateSceneIndicatorL( TInt32 aBitmapId, TInt32 aMaskId ); |
|
157 |
|
158 protected: // Functions from base classes |
|
159 |
|
160 /** |
|
161 * From MCamControllerObserver |
|
162 * Handle an event from CCamAppControllerBase. |
|
163 * @since 2.8 |
|
164 * @param aEvent the type of event |
|
165 * @param aError error code |
|
166 */ |
|
167 virtual void HandleControllerEventL( TCamControllerEvent aEvent, |
|
168 TInt aError ); |
|
169 |
|
170 |
|
171 private: |
|
172 |
|
173 /** |
|
174 * Get the icon index of current flash setting in given mode. |
|
175 * @param aMode Capture mode for which the flash icon index is needed. |
|
176 */ |
|
177 TInt GetFlashIconIndex( const TCamCameraMode& aMode ); |
|
178 |
|
179 |
|
180 /** |
|
181 * Register this object with observed classes. |
|
182 * @since 2.8 |
|
183 */ |
|
184 void RegisterObserversL(); |
|
185 |
|
186 /** |
|
187 * Deregister this object from observed classes |
|
188 * @since 2.8 |
|
189 */ |
|
190 void RemoveObservers(); |
|
191 |
|
192 // Generic setup icon is displayed either in the navipane or sidepane |
|
193 #ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR |
|
194 #ifndef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
195 /** |
|
196 * Sets the default setup indicator depending on the |
|
197 * current setup settings. |
|
198 * @since 2.8 |
|
199 */ |
|
200 void SetGenericSetupIndicator(); |
|
201 #endif // !PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR |
|
202 #endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR |
|
203 |
|
204 /** |
|
205 * Sets the image stabilisation indicator |
|
206 * if the current capture mode is video |
|
207 * @since 3.0 |
|
208 */ |
|
209 void SetVideoStabilisationIndicator(); |
|
210 |
|
211 /** |
|
212 * Sets the facetracking indicator |
|
213 * if the current capture mode is still image |
|
214 * @since 3.0 |
|
215 */ |
|
216 void SetFaceTrackingIndicator(); |
|
217 |
|
218 /** |
|
219 * Set the video scene indicator depending on current setting |
|
220 * @since 2.8 |
|
221 */ |
|
222 void SetVideoSceneIndicator(); |
|
223 |
|
224 /** |
|
225 * Set the photo scene indicator depending on current setting |
|
226 * @since 2.8 |
|
227 */ |
|
228 void SetPhotoSceneIndicator(); |
|
229 |
|
230 // Burst mode icon is displayed in either the navipane or sidepane |
|
231 #ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
232 /** |
|
233 * From MCamBurstModeObserver |
|
234 * @since 2.8 |
|
235 * @param aActive whether or not burst mode is active |
|
236 * @param aStillModeActive whether or not still capture is active |
|
237 */ |
|
238 void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); |
|
239 #endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE |
|
240 |
|
241 /** |
|
242 * Checks if the secondary camera is enabled |
|
243 * @since 2.8 |
|
244 * @return ETrue if the second camera is enabled |
|
245 */ |
|
246 TBool IsSecondaryCameraEnabled() const; |
|
247 |
|
248 /** |
|
249 * Read nontouch layout |
|
250 */ |
|
251 void NonTouchLayout() const; |
|
252 |
|
253 /** |
|
254 * Read touch layout |
|
255 */ |
|
256 void TouchLayout() const; |
|
257 |
|
258 private: |
|
259 |
|
260 /** |
|
261 * Symbian OS 2nd phase constructor. |
|
262 * @since 2.8 |
|
263 */ |
|
264 void ConstructL(); |
|
265 |
|
266 /** |
|
267 * C++ constructor |
|
268 * @since 2.8 |
|
269 * @param aController reference to CCamAppControllerBase instance |
|
270 * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder |
|
271 */ |
|
272 CCamSidePane( CCamAppController& aController, |
|
273 TBool aOverlayViewFinder ); |
|
274 |
|
275 // ========================================================================= |
|
276 // Data |
|
277 private: |
|
278 |
|
279 CCamAppController& iController; |
|
280 RPointerArray<CCamIndicator> iIndicators; // contained indicators |
|
281 |
|
282 TCamCameraMode iMode; // capture state used to determine which settings to retrieve |
|
283 |
|
284 TBool iOverlayViewFinder; // whether sidepane is drawn over the viewfinder |
|
285 TRect iRect; // the side pane rect |
|
286 TBool iVisible; // whether the side pane is visible |
|
287 |
|
288 // ========================================================================= |
|
289 }; |
|
290 |
|
291 #endif |
|
292 |
|
293 // End of File |
|