1 /* |
|
2 * Copyright (c) 2007-2009 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: AppUi base class for Camera AppUi and Dummy AppUi* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMAPPUIBASE_H |
|
19 #define CAMAPPUIBASE_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <aknappui.h> |
|
24 #include <aknViewAppUi.h> |
|
25 #include <activepalette2ui.h> |
|
26 #include "CamSettingsInternal.hrh" |
|
27 |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // DATA TYPES |
|
34 |
|
35 enum TCamAppViewIds |
|
36 { |
|
37 ECamViewIdStillPreCapture, |
|
38 ECamViewIdStillPostCapture, |
|
39 ECamViewIdVideoPreCapture, |
|
40 ECamViewIdVideoPostCapture, |
|
41 ECamViewIdBurstThumbnail, |
|
42 ECamViewIdVideoSettings, |
|
43 ECamViewIdPhotoSettings, |
|
44 ECamViewIdPhotoUserSceneSetup, |
|
45 ECamViewIdViaPlayerPlayBack, |
|
46 ECamViewIdCustomiseToolbar |
|
47 }; |
|
48 |
|
49 enum TCamSelfTimerFunctions |
|
50 { |
|
51 ECamSelfTimerMode1, // Eg ON 10-second timer |
|
52 ECamSelfTimerMode2, // Eg ON 2-second timer |
|
53 ECamSelfTimerMode3, // Eg ON additional possibility |
|
54 ECamSelfTimerDisabled // Eg OFF |
|
55 }; |
|
56 |
|
57 /** |
|
58 * Camera orientations |
|
59 */ |
|
60 enum TCamOrientation |
|
61 { |
|
62 ECamOrientationDefault = 0, |
|
63 ECamOrientationCamcorder = ECamOrientationDefault, |
|
64 ECamOrientationPortrait, |
|
65 ECamOrientationViewMode, |
|
66 ECamOrientationCamcorderLeft, // softkeys left |
|
67 ECamOrientationTotal |
|
68 }; |
|
69 |
|
70 enum TCamPreCaptureMode |
|
71 { |
|
72 ECamPreCapViewfinder, |
|
73 ECamPreCapCaptureSetup, |
|
74 ECamPreCapTimeLapseSlider, |
|
75 ECamPreCapStandby, |
|
76 ECamPreCapSceneSetting, |
|
77 ECamPreCapGenericSetting |
|
78 }; |
|
79 |
|
80 enum TCamAppEvent |
|
81 { |
|
82 ECamAppEventFocusGained, |
|
83 ECamAppEventFocusLost |
|
84 }; |
|
85 |
|
86 // FUNCTION PROTOTYPES |
|
87 |
|
88 // FORWARD DECLARATIONS |
|
89 class CCamSelfTimer; |
|
90 class MCamBurstModeObserver; |
|
91 class CCamSidePane; |
|
92 class CCamZoomPane; |
|
93 class CTextResolver; |
|
94 class CCamActivePaletteHandler; |
|
95 class MCamAppController; |
|
96 class MCamStaticSettings; |
|
97 // CLASS DECLARATION |
|
98 |
|
99 /** |
|
100 * AppUi base class for Camera AppUi and Dummy AppUi |
|
101 * |
|
102 * @since 2.8 |
|
103 */ |
|
104 class CCamAppUiBase : public CAknViewAppUi |
|
105 //, public MCamControllerObserver |
|
106 { |
|
107 public: // Constructors and destructor |
|
108 |
|
109 |
|
110 public: // New functions |
|
111 |
|
112 |
|
113 /** |
|
114 * Determines whether or not all construction has been completed |
|
115 * Used on view activation to determine if the view should |
|
116 * open in standby mode. This will happen if the app is waiting for |
|
117 * an orientation switch to complete or for the initial view to be set |
|
118 * when launched in embedded |
|
119 * @since 3.0 |
|
120 * @return ETrue if all construction has completed, else EFalse |
|
121 */ |
|
122 virtual TBool IsConstructionComplete() const = 0; |
|
123 |
|
124 |
|
125 /** |
|
126 * Set title pane text from a resource. |
|
127 * @since 2.8 |
|
128 * @param aResourceId resource to read from |
|
129 */ |
|
130 virtual void SetTitleL( TInt aResourceId ) = 0; |
|
131 |
|
132 /** |
|
133 * Set title pane text from a descriptor. |
|
134 * @since 2.8 |
|
135 * @param aText title pane text |
|
136 */ |
|
137 virtual void SetTitleL( const TDesC& aText ) = 0; |
|
138 |
|
139 /** |
|
140 * In embedded mode set title to name of embedding application |
|
141 * @since 2.8 |
|
142 */ |
|
143 virtual void SetTitleEmbeddedL() = 0; |
|
144 |
|
145 /** |
|
146 * Draw the counter to the bitmap used in the navi pane |
|
147 * @since 3.0 |
|
148 * @param aBmpGc The graphics context for the bitmap |
|
149 * @param aBmpMaskGc The graphics context for the bitmap mask |
|
150 */ |
|
151 virtual void CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter )= 0; |
|
152 |
|
153 /** |
|
154 * Push navi pane indicators on to navi pane stack. |
|
155 * @since 2.8 |
|
156 */ |
|
157 virtual void PushNaviPaneCounterL() = 0; |
|
158 |
|
159 /** |
|
160 * Push navi pane progress bar on to navi pane stack. |
|
161 * @since 2.8 |
|
162 */ |
|
163 virtual void PushNaviPaneProgressBarL() = 0; |
|
164 |
|
165 /** |
|
166 * Push default navi pane on to navi pane stack. |
|
167 * @since 2.8 |
|
168 */ |
|
169 virtual void PushDefaultNaviPaneL() = 0; |
|
170 |
|
171 /** |
|
172 * Enable or disable SelfTimer functionality |
|
173 * @param aEnable specifies self timer mode or self timer off |
|
174 * @since 2.8 |
|
175 */ |
|
176 virtual void SelfTimerEnableL( TCamSelfTimerFunctions aEnable ) = 0; |
|
177 |
|
178 /** |
|
179 * Returns current self-timer state |
|
180 * @since 2.8 |
|
181 */ |
|
182 virtual TBool SelfTimerEnabled() const = 0; |
|
183 |
|
184 /** |
|
185 * Returns pointer to self-timer object |
|
186 * @since 2.8 |
|
187 */ |
|
188 virtual CCamSelfTimer* SelfTimer() = 0; |
|
189 |
|
190 /** |
|
191 * Registers an observer for changes in burst mode activation |
|
192 * @since 2.8 |
|
193 * @param aBurstModeObserver the object observing burst mode changes |
|
194 */ |
|
195 virtual void AddBurstModeObserverL( |
|
196 MCamBurstModeObserver* aBurstModeObserver ) = 0; |
|
197 |
|
198 /** |
|
199 * Removes an observer for changes in burst mode activation |
|
200 * @since 2.8 |
|
201 * @param aBurstModeObserver the observer to remove |
|
202 */ |
|
203 virtual void RemoveBurstModeObserver( |
|
204 const MCamBurstModeObserver* aBurstModeObserver ) = 0; |
|
205 |
|
206 /** |
|
207 * Returns whether or not burst capture mode is enabled. |
|
208 * Will return ETrue when burst mode is enabled for still capture |
|
209 * even if the application is currently in video capture mode |
|
210 * @since 2.8 |
|
211 * @return ETrue if burst mode is enabled, else returns EFalse |
|
212 */ |
|
213 virtual TBool IsBurstEnabled() const = 0; |
|
214 |
|
215 /** |
|
216 * Returns the currently enabled burst mode. |
|
217 * @since 3.0 |
|
218 * @return the currently enable burst mode or ECamImageCaptureNone if |
|
219 * burst is not enabled |
|
220 */ |
|
221 virtual TCamImageCaptureMode CurrentBurstMode() const = 0; |
|
222 |
|
223 /** |
|
224 * Return whether we are in embedded mode (if we have a pointer to a |
|
225 * MApaEmbeddedDocObserver). |
|
226 * @since 2.8 |
|
227 * @return TBool if tthere is a handle to MApaEmbeddedDocObserver |
|
228 */ |
|
229 virtual TBool IsEmbedded() const = 0; |
|
230 |
|
231 /** |
|
232 * Sets the current capture mode ( and target capture mode ) |
|
233 * @since 2.8 |
|
234 * @param aMode the desired capture mode |
|
235 * @param aImageMode In image capture, the desired mode (single/burst/timelapse) |
|
236 */ |
|
237 virtual void SetCaptureMode( TCamCameraMode aMode, |
|
238 TCamImageCaptureMode aImageMode = ECamImageCaptureNone ) = 0; |
|
239 |
|
240 /** |
|
241 * Shows the mmc removal note if it is required |
|
242 * @since 2.8 |
|
243 */ |
|
244 virtual void ShowMMCRemovalNoteIfRequiredL() = 0; |
|
245 |
|
246 /** |
|
247 * Returns pointer to side-pane |
|
248 * @since 2.8 |
|
249 * @return pointer to CCamSidePane object constructed by appUi |
|
250 */ |
|
251 virtual CCamSidePane* SidePane() = 0; |
|
252 |
|
253 /** |
|
254 * Returns pointer to zoom-pane |
|
255 * @since 2.8 |
|
256 * @return pointer to CCamZoomPane object constructed by appUi |
|
257 */ |
|
258 virtual CCamZoomPane* ZoomPane() = 0; |
|
259 |
|
260 /** |
|
261 * Returns current camera orientation |
|
262 * @since 3.0 |
|
263 * @return current camera orientation |
|
264 */ |
|
265 virtual TCamOrientation CamOrientation() = 0; |
|
266 |
|
267 /** |
|
268 * Returns whether or the secondary camera has been activated |
|
269 * Will return ETrue when when the second camera is active |
|
270 * @since 2.8 |
|
271 * @return ETrue if second camera is active, else returns EFalse |
|
272 */ |
|
273 virtual TBool IsSecondCameraEnabled() const = 0; |
|
274 |
|
275 /** |
|
276 * Secondary camera orientation is constructed according to this flag. |
|
277 * Flag can be forced to portrait/landscape or it can follow qwerty |
|
278 * state. Variation is handled via configuration manager |
|
279 * KCamCrFeature2ndCameraOrientation key. |
|
280 * @param aLock, Lock orientation state flag. |
|
281 * ETrue, ask state and lock it. |
|
282 * EFalse, ask current state. |
|
283 * @return ETrue if secondary camera orientation must be landscape |
|
284 */ |
|
285 virtual TBool IsQwerty2ndCamera( TBool aLock = EFalse ) = 0; |
|
286 |
|
287 /** |
|
288 * Returns the active camera |
|
289 * @since 2.8 |
|
290 * @return either primary, secondary or none ( if in process of switching ) |
|
291 */ |
|
292 virtual TCamActiveCamera ActiveCamera() const = 0; |
|
293 |
|
294 /** |
|
295 * Handles the shutter key press |
|
296 * @param aPressed ETrue if the shutter is pressed, EFalse if released |
|
297 * @since 2.8 |
|
298 */ |
|
299 virtual void HandleShutterKeyL( TBool aPressed ) = 0; |
|
300 |
|
301 /** |
|
302 * Set embedding flag |
|
303 * @param aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), |
|
304 * EFalse if not |
|
305 * @since 2.8 |
|
306 */ |
|
307 virtual void SetEmbedding( TBool aEmbedding ) = 0; |
|
308 |
|
309 /** |
|
310 * Return embedding flag |
|
311 * @return aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), |
|
312 * EFalse if not |
|
313 * @since 2.8 |
|
314 */ |
|
315 virtual TBool Embedding() const = 0; |
|
316 |
|
317 /** |
|
318 * Set SendAs flag |
|
319 * @param aSendAsInProgress ETrue if SendAs in progress, EFalse if not |
|
320 * @since 2.8 |
|
321 */ |
|
322 virtual void SetSendAsInProgressL( TBool aSendAsInProgress ) = 0; |
|
323 |
|
324 /** |
|
325 * Read SendAs flag value |
|
326 * @return ETrue if sending file is in progress, EFalse otherwise |
|
327 * @since 4.0 |
|
328 */ |
|
329 virtual TBool SendAsInProgress() const = 0; |
|
330 |
|
331 /** |
|
332 * Return handle to active palette if supported |
|
333 * @since 3.0 |
|
334 * @return Handle to Active palette |
|
335 */ |
|
336 virtual MActivePalette2UI* ActivePalette() const = 0; |
|
337 |
|
338 /** |
|
339 * |
|
340 * |
|
341 */ |
|
342 virtual CCamActivePaletteHandler* APHandler() const = 0; |
|
343 |
|
344 /** |
|
345 * Indicates whether or not the application is in a simulated exit situation |
|
346 * @return ETrue if the application has pretended to exit, else EFalse |
|
347 */ |
|
348 virtual TBool IsInPretendExit() const = 0; |
|
349 |
|
350 /** |
|
351 * Whether or not the telephone application is in the foreground |
|
352 * @since 3.0 |
|
353 * @return ETrue if the telephone application is in the foreground |
|
354 */ |
|
355 virtual TBool ForegroundAppIsPhoneApp() const = 0; |
|
356 |
|
357 /** |
|
358 * Let the AppUi know what is being shown in pre-capture |
|
359 * @param aMode What's being shown |
|
360 */ |
|
361 virtual void SetPreCaptureMode(TCamPreCaptureMode aMode) = 0; |
|
362 |
|
363 /* |
|
364 * Gets the handle to the controller, which is used inturn by the |
|
365 * plugin to call the interfaces for performing needed actions. |
|
366 */ |
|
367 virtual MCamAppController& AppController() = 0; |
|
368 |
|
369 /* |
|
370 * Gets the handle to the settings model, which is used inturn by the |
|
371 * plugin to call the interfaces for performing needed actions. |
|
372 */ |
|
373 virtual MCamStaticSettings& StaticSettingsModel() = 0; |
|
374 |
|
375 /** |
|
376 * Returns whether an MMC removed note is pending |
|
377 * @since 3.0 |
|
378 * @return TBool ETrue if the UI needs to show an MMC |
|
379 */ |
|
380 virtual TBool IsMMCRemovedNotePending() const = 0; |
|
381 |
|
382 /** |
|
383 * Set the requested resolution for a new file |
|
384 * @since 3.2 |
|
385 * @param aRequestedResolution the requested resolution from the new file request. |
|
386 */ |
|
387 virtual void SetRequestedNewFileResolution( const TSize& aRequestedResolution ) = 0; |
|
388 |
|
389 /** |
|
390 * Get the requested resolution for a new file |
|
391 * @since 3.2 |
|
392 * @return the requested resolution from the new file request. |
|
393 * Default is TSize(0,0) which interpreted as mms quality resolution |
|
394 */ |
|
395 virtual TSize RequestedNewFileResolution() const = 0; |
|
396 |
|
397 /** |
|
398 * Whether or not the application is in the background |
|
399 * @since 2.8 |
|
400 * @param aIncludeNotifier If EFalse then the application is not |
|
401 * classed as being in the background if the foreground application is |
|
402 * a notifier, e.g. charging enabled. |
|
403 * @return ETrue if the application is in the background |
|
404 */ |
|
405 virtual TBool AppInBackground( TBool aIncludeNotifier ) const = 0; |
|
406 |
|
407 protected: |
|
408 |
|
409 /** |
|
410 * Offers a pointer to appui's TextResolver instance |
|
411 * @since 3.0 |
|
412 * @return pointer to appui's TextResolver instance |
|
413 */ |
|
414 virtual CTextResolver* TextResolver() = 0; |
|
415 |
|
416 private: |
|
417 |
|
418 private: // Data |
|
419 |
|
420 }; |
|
421 |
|
422 #ifdef _DEBUG |
|
423 const TUint16* const KCamPreCaptureModeNames[] = |
|
424 { |
|
425 (const TUint16* const)_S16("ECamPreCapViewfinder"), |
|
426 (const TUint16* const)_S16("ECamPreCapCaptureSetup"), |
|
427 (const TUint16* const)_S16("ECamPreCapTimeLapseSlider"), |
|
428 (const TUint16* const)_S16("ECamPreCapStandby"), |
|
429 (const TUint16* const)_S16("ECamPreCapSceneSetting"), |
|
430 (const TUint16* const)_S16("ECamPreCapGenericSetting") |
|
431 }; |
|
432 #endif |
|
433 |
|
434 |
|
435 #endif // CAMAPPUIBASE_H |
|
436 |
|
437 // End of File |
|