1 /* |
|
2 * Copyright (c) 2007-2010 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: Still image pre-capture view class for Camera application* |
|
15 */ |
|
16 |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "CamAppUi.h" |
|
20 #include "CamAppController.h" |
|
21 #include "CamStillPreCaptureView.h" |
|
22 #include "CamLogger.h" |
|
23 #include "CamUtility.h" |
|
24 #include "CamContainerBase.h" |
|
25 #include "CamAppUiBase.h" |
|
26 #include <eikmenub.h> |
|
27 #include <eikapp.h> |
|
28 #include <avkon.rsg> |
|
29 #include "CamCaptureSetupMenu.h" |
|
30 #include "CamPanic.h" |
|
31 #include "Cam.hrh" |
|
32 #include "CamAppUid.h" |
|
33 #include <csxhelp/lcam.hlp.hrh> |
|
34 #include "CamShootingModeContainer.h" |
|
35 #include "CamInfoListBoxContainer.h" |
|
36 #include "CamStillPreCaptureContainer.h" |
|
37 #include "CamSelfTimer.h" |
|
38 #include "CamTimeLapseUtility.h" |
|
39 #include <CaeEngine.h> |
|
40 #include <cameraapp.rsg> |
|
41 #include <vgacamsettings.rsg> |
|
42 #include <akntoolbar.h> |
|
43 #include <akntoolbarextension.h> |
|
44 #include <aknbutton.h> |
|
45 #include <AknsUtils.h> |
|
46 #include <cameraapp.mbg> |
|
47 #include <AknIconUtils.h> |
|
48 #include <gulicon.h> |
|
49 |
|
50 |
|
51 #include "StringLoader.h" |
|
52 #include "camactivepalettehandler.h" |
|
53 #include "CameraUiConfigManager.h" |
|
54 #include "CamSidePane.h" |
|
55 |
|
56 #include "CamLocalViewIds.h" |
|
57 #include "OstTraceDefinitions.h" |
|
58 #ifdef OST_TRACE_COMPILER_IN_USE |
|
59 #include "CamStillPreCaptureViewTraces.h" |
|
60 #endif |
|
61 |
|
62 |
|
63 // ========================= MEMBER FUNCTIONS ================================ |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // CCamStillPreCaptureView::NewLC |
|
67 // Symbian OS two-phased constructor |
|
68 // --------------------------------------------------------------------------- |
|
69 // |
|
70 CCamStillPreCaptureView* CCamStillPreCaptureView::NewLC( CCamAppController& aController ) |
|
71 { |
|
72 CCamStillPreCaptureView* self = |
|
73 new( ELeave ) CCamStillPreCaptureView( aController ); |
|
74 |
|
75 CleanupStack::PushL( self ); |
|
76 self->ConstructL(); |
|
77 |
|
78 return self; |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CCamStillPreCaptureView destructor |
|
83 // |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 CCamStillPreCaptureView::~CCamStillPreCaptureView() |
|
87 { |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // CCamStillPreCaptureView::Id |
|
92 // Returns UID of view |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 TUid CCamStillPreCaptureView::Id() const |
|
96 { |
|
97 return TUid::Uid( ECamViewIdStillPreCapture ); |
|
98 } |
|
99 |
|
100 // --------------------------------------------------------------------------- |
|
101 // CCamStillPreCaptureView::DoDeactivate |
|
102 // Deactivate this view |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 void CCamStillPreCaptureView::DoDeactivate() |
|
106 { |
|
107 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 1" ); |
|
108 PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewDeactivation ); |
|
109 PRINT( _L("Camera => CCamStillPreCaptureView::DoDeactivate" ) ) |
|
110 |
|
111 CCamPreCaptureViewBase::DoDeactivate(); |
|
112 PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewDeactivation ); |
|
113 PRINT( _L("Camera <= CCamStillPreCaptureView::DoDeactivate" ) ) |
|
114 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 0" ); |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CCamStillPreCaptureView::HandleCommandL |
|
119 // Handle commands |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 void CCamStillPreCaptureView::HandleCommandL( TInt aCommand ) |
|
123 { |
|
124 PRINT( _L("Camera => CCamStillPreCaptureView::HandleCommandL") ); |
|
125 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
126 TCamOrientation orientation = appUi->CamOrientation(); |
|
127 switch ( aCommand ) |
|
128 { |
|
129 case ECamMSKCmdSelect: |
|
130 case ECamMSKCmdAppCapture: |
|
131 { |
|
132 if( orientation == ECamOrientationCamcorder || |
|
133 orientation == ECamOrientationCamcorderLeft || |
|
134 orientation == ECamOrientationPortrait ) |
|
135 { |
|
136 if ( !StartMskCaptureL() ) |
|
137 { |
|
138 // If in the Landscape mode, MSK event is mapped |
|
139 // like a normal selection key so that AP items |
|
140 // are selected and respective setting pages are launched |
|
141 TKeyEvent aKeyEvent; |
|
142 aKeyEvent.iCode = aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0; |
|
143 aKeyEvent.iScanCode = EStdKeyDevice3; |
|
144 static_cast<CCamStillPreCaptureContainer*> |
|
145 ( Container() )->OfferKeyEventL( aKeyEvent, EEventKey ); |
|
146 } |
|
147 } |
|
148 else if ( aCommand == ECamMSKCmdAppCapture ) |
|
149 // if the Camera in the Portrait mode |
|
150 // MSK event is handled like a capture key |
|
151 { |
|
152 OstTrace0( CAMERAAPP_PERFORMANCE, DUP8_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHUTTER_RELEASE_LAG 1" ); |
|
153 if ( iController.IsViewFinding() && appUi->CheckMemoryL() ) |
|
154 { |
|
155 OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); |
|
156 OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); |
|
157 OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SAVE 1" ); |
|
158 OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SHOT 1" ); |
|
159 OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_STILL 1" ); |
|
160 OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_CAPTURE_START 1" ); |
|
161 OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SERIAL_SHOOTING 1" ); |
|
162 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
163 iController.Capture(); |
|
164 } |
|
165 } |
|
166 break; |
|
167 } |
|
168 case ECamCmdCaptureImage: |
|
169 { |
|
170 OstTrace0( CAMERAAPP_PERFORMANCE, DUP10_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHUTTER_RELEASE_LAG 1" ); |
|
171 if ( iController.IsViewFinding() && appUi->CheckMemoryL() && |
|
172 !iController.CaptureModeTransitionInProgress() && |
|
173 !iController.IsProcessingCapture() ) |
|
174 { |
|
175 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
176 |
|
177 // fixed toolbar is used only with touch devices |
|
178 if ( iController.IsTouchScreenSupported() ) |
|
179 { |
|
180 CAknToolbar* fixedToolbar = Toolbar(); |
|
181 if ( fixedToolbar ) |
|
182 { |
|
183 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
184 } |
|
185 } |
|
186 |
|
187 // Start the autofocus operation now, the capture will be queued |
|
188 // after focus completes |
|
189 if ( !appUi->SelfTimerEnabled() |
|
190 && iController.ActiveCamera() != ECamActiveCameraSecondary |
|
191 && iController.UiConfigManagerPtr() |
|
192 && iController.UiConfigManagerPtr()->IsAutoFocusSupported() |
|
193 && !iController.CurrentSceneHasForcedFocus() ) |
|
194 { |
|
195 // Next trace should be just before "e_CAM_PRI_SHUTTER_RELEASE_LAG 1", but only when AF is supported |
|
196 OstTrace0( CAMERAAPP_PERFORMANCE, DUP9_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_AF_LOCK 1" ); |
|
197 if( iController.CurrentOperation() == ECamNoOperation ) |
|
198 { |
|
199 iController.SetAfNeeded( ETrue ); |
|
200 } |
|
201 OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_AF 1" ); |
|
202 iController.StartAutoFocus(); |
|
203 } |
|
204 else // AF not needed, capture will start next |
|
205 { |
|
206 OstTrace0( CAMERAAPP_PERFORMANCE, DUP11_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); |
|
207 OstTrace0( CAMERAAPP_PERFORMANCE, DUP12_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); |
|
208 OstTrace0( CAMERAAPP_PERFORMANCE, DUP13_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SAVE 1" ); |
|
209 OstTrace0( CAMERAAPP_PERFORMANCE, DUP14_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SHOT 1" ); |
|
210 OstTrace0( CAMERAAPP_PERFORMANCE, DUP15_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_STILL 1" ); |
|
211 OstTrace0( CAMERAAPP_PERFORMANCE, DUP16_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_CAPTURE_START 1" ); |
|
212 OstTrace0( CAMERAAPP_PERFORMANCE, DUP17_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SERIAL_SHOOTING 1" ); |
|
213 } |
|
214 TKeyEvent keyEvent; |
|
215 appUi->StartCaptureL( keyEvent ); |
|
216 |
|
217 } |
|
218 break; |
|
219 } |
|
220 case ECamCmdTimeLapseSlider: |
|
221 { |
|
222 TCamTimeLapse settingValue = ECamTimeLapseOff; |
|
223 |
|
224 if ( appUi && !appUi->IsBurstEnabled() ) |
|
225 { |
|
226 settingValue = ECamTimeLapseMin; |
|
227 } |
|
228 |
|
229 TInt command = CamTimeLapseUtility::EnumToCommand( settingValue ); |
|
230 TTimeIntervalMicroSeconds interval = CamTimeLapseUtility::EnumToInterval( settingValue ); |
|
231 |
|
232 // Update the current mode (single/burst/timelapse) |
|
233 if( appUi ) |
|
234 { |
|
235 TRAP_IGNORE( appUi->HandleCommandL( command ) ); |
|
236 } |
|
237 |
|
238 // Update timelapse interval |
|
239 iController.SetTimeLapseInterval( interval ); |
|
240 |
|
241 // stop and start the viewfinder in order to update the settings |
|
242 StopViewFinder(); |
|
243 StartViewFinder(); |
|
244 |
|
245 // fixed toolbar is used only with touch devices |
|
246 if ( iController.IsTouchScreenSupported() ) |
|
247 { |
|
248 UpdateToolbarIconsL(); |
|
249 } |
|
250 |
|
251 } |
|
252 break; |
|
253 |
|
254 case ECamCmdCaptureSetupLightSensitivityStill: |
|
255 // case ECamCmdCaptureSetupLightSensitivityVideo: |
|
256 { |
|
257 SwitchToInfoListBoxL( EInfoListBoxModeISO ); |
|
258 } |
|
259 break; |
|
260 |
|
261 case ECamCmdGoToStandby: |
|
262 { |
|
263 // SwitchToStandbyModeL( ECamViewIdStillPreCapture, iStandbyError ); |
|
264 SwitchToStandbyModeL( ECamViewIdStillPreCapture, appUi->StandbyStatus() ); |
|
265 } |
|
266 break; |
|
267 case ECamCmdExitStandby: |
|
268 { |
|
269 ExitStandbyModeL(); |
|
270 } |
|
271 break; |
|
272 case ECamCmdViewfinderGrid: |
|
273 { |
|
274 // Switch grid setting |
|
275 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
276 UpdateToolbarIconsL(); |
|
277 } |
|
278 break; |
|
279 case ECamCmdToggleFacetracking: |
|
280 { |
|
281 // Switch facetracking setting |
|
282 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
283 UpdateToolbarIconsL(); |
|
284 |
|
285 break; |
|
286 } |
|
287 default: |
|
288 { |
|
289 CCamPreCaptureViewBase::HandleCommandL( aCommand ); |
|
290 } |
|
291 } |
|
292 PRINT( _L("Camera <= CCamStillPreCaptureView::HandleCommandL") ); |
|
293 } |
|
294 |
|
295 // ----------------------------------------------------------------------------- |
|
296 // CCamStillPreCaptureView::HandleForegroundEventL |
|
297 // Handle foreground event |
|
298 // ----------------------------------------------------------------------------- |
|
299 // |
|
300 void |
|
301 CCamStillPreCaptureView::HandleForegroundEventL( TBool aForeground ) |
|
302 { |
|
303 PRINT( _L("Camera => CCamStillPreCaptureView::HandleForegroundEventL") ); |
|
304 |
|
305 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
306 |
|
307 // ------------------------------------------------------- |
|
308 // Foreground |
|
309 // |
|
310 // reset menu and cba as appropriate |
|
311 if( aForeground ) |
|
312 { |
|
313 PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to foreground") ); |
|
314 PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller operation [%s]"), KCamCaptureOperationNames[iController.CurrentOperation()] ); |
|
315 PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller mode [%s]"), KCamModeNames[iController.CurrentMode()] ); |
|
316 if( ECamViewStateStandby == appUi->CurrentViewState() ) |
|
317 { |
|
318 CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); |
|
319 if( fixedToolbar ) |
|
320 { |
|
321 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
322 } |
|
323 } |
|
324 |
|
325 |
|
326 if( iController.SequenceCaptureInProgress() ) |
|
327 { |
|
328 PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: sequence capture ongoing") ); |
|
329 return; |
|
330 } |
|
331 |
|
332 if ( appUi->IsInPretendExit() ) |
|
333 { |
|
334 PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: app in pretend exit so not grabbing resources") ) |
|
335 // The view can get a foreground event while the application is |
|
336 // actually in a pretend exit situation. This occurs when the view switch |
|
337 // was called before the exit event, but didn't complete until after the |
|
338 // exit event. In this case the view should not register an interest in |
|
339 // the engine as the application is really in the background and the resources |
|
340 // need to be released |
|
341 return; |
|
342 } |
|
343 // if foreground event is received while in videocall, go to standby with error |
|
344 if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) |
|
345 { |
|
346 ExitAllModesL(); |
|
347 appUi->SetStandbyStatus( KErrInUse ); |
|
348 appUi->HandleCommandL( ECamCmdGoToStandby ); |
|
349 SetTitlePaneTextL(); |
|
350 return; |
|
351 } |
|
352 |
|
353 // check for silent profile whenever we come to foreground, we dont need it here, |
|
354 // but we keep track of this in appcontroller. |
|
355 iController.IsProfileSilent(); |
|
356 |
|
357 // set embedded flag here |
|
358 iEmbedded = appUi->IsEmbedded(); |
|
359 // make sure CBA is correct |
|
360 UpdateCbaL(); |
|
361 |
|
362 SetMenuBar(); |
|
363 |
|
364 if ( iContinueInBackground && !iStandbyModeActive ) |
|
365 { |
|
366 // make sure that CCamAppController is in view finder mode |
|
367 if ( iController.CurrentImageMode() == ECamImageCaptureNone ) |
|
368 { |
|
369 StartViewFinder(); |
|
370 } |
|
371 } |
|
372 } |
|
373 // ------------------------------------------------------- |
|
374 // Background |
|
375 // |
|
376 // If going to the background, cancel any current autofocus. |
|
377 // This makes sure that the focus indicator is removed from the side pane |
|
378 // if the key release event is lost. |
|
379 // Cancelling focus does nothing if a capture has already been requested |
|
380 else |
|
381 { |
|
382 PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to background") ); |
|
383 // Cancel any outstanding capture |
|
384 iController.CancelFocusAndCapture(); |
|
385 |
|
386 // stop any current sequence capture unless it is only a notification |
|
387 if( iController.SequenceCaptureInProgress() |
|
388 && ( appUi->AppInBackground( EFalse ) |
|
389 || appUi->ForegroundAppIsPhoneApp() |
|
390 ) |
|
391 ) |
|
392 { |
|
393 iController.StopSequenceCaptureL(); |
|
394 } |
|
395 /* |
|
396 // stop any current sequence capture unless it is only an eikon server or AknCapServer window |
|
397 if ( iCoeEnv->WsSession().GetFocusWindowGroup() != iEikonServerWindowGroupId |
|
398 && iController.SequenceCaptureInProgress() ) |
|
399 { |
|
400 TInt groupId = iCoeEnv->WsSession().GetFocusWindowGroup(); |
|
401 if ( !CamUtility::IdMatchesName( groupId, KAknCapServer ) ) |
|
402 { |
|
403 // If AknCapServer has NOT got foreground, (which would possibly |
|
404 // indicate a "charging" note) stop sequence capture |
|
405 iController.StopSequenceCaptureL(); |
|
406 } |
|
407 } |
|
408 */ |
|
409 } |
|
410 |
|
411 CCamPreCaptureViewBase::HandleForegroundEventL( aForeground ); |
|
412 |
|
413 PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL") ); |
|
414 } |
|
415 |
|
416 // ----------------------------------------------------------------------------- |
|
417 // CCamStillPreCaptureView::HandleFocusLossL |
|
418 // Handle change of focus |
|
419 // ----------------------------------------------------------------------------- |
|
420 // |
|
421 void CCamStillPreCaptureView::HandleFocusLossL() |
|
422 { |
|
423 PRINT( _L( "Camera => CCamStillPreCaptureView::HandleFocusLossL" ) ); |
|
424 // if the application was already in the background, but behind an |
|
425 // eikon server window, then handle backgrounding properly now. |
|
426 // Otherwise the backgrounding will be handled in the normal |
|
427 // HandleForeground() method. |
|
428 if ( iContinueInBackground ) |
|
429 { |
|
430 if ( iController.SequenceCaptureInProgress() ) |
|
431 { |
|
432 iController.StopSequenceCaptureL(); |
|
433 } |
|
434 } |
|
435 CCamPreCaptureViewBase::HandleFocusLossL(); |
|
436 PRINT( _L( "Camera <= CCamStillPreCaptureView::HandleFocusLossL" ) ); |
|
437 } |
|
438 |
|
439 // ----------------------------------------------------------------------------- |
|
440 // CCamStillPreCaptureView::HandleControllerEventL |
|
441 // Handle controller events |
|
442 // ----------------------------------------------------------------------------- |
|
443 // |
|
444 void CCamStillPreCaptureView::HandleControllerEventL( TCamControllerEvent aEvent, |
|
445 TInt aError ) |
|
446 { |
|
447 PRINT( _L("Camera => CCamStillPreCaptureView::HandleControllerEventL") ); |
|
448 |
|
449 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
450 if ( ECamEventControllerReady == aEvent ) |
|
451 { |
|
452 iSoftkeyBlankIsNeeded = EFalse; |
|
453 UpdateCbaL(); |
|
454 } |
|
455 else if ( aEvent == ECamEventOperationStateChanged ) |
|
456 { |
|
457 PRINT( _L("Camera <> CCamStillPreCaptureView: ECamEventOperationStateChanged") ); |
|
458 TCamCaptureOperation operation = iController.CurrentOperation(); |
|
459 switch ( operation ) |
|
460 { |
|
461 case ECamCompleting: |
|
462 { |
|
463 iController.SetTouchCapture( EFalse ); |
|
464 UpdateCbaL(); |
|
465 break; |
|
466 } |
|
467 |
|
468 case ECamFocusing: |
|
469 { |
|
470 // Hide the AP during focussing |
|
471 if ( appUi->AlwaysDrawPreCaptureCourtesyUI() |
|
472 && !iController.CurrentSceneHasForcedFocus() ) |
|
473 { |
|
474 appUi->SetActivePaletteVisibility( EFalse ); |
|
475 } |
|
476 break; |
|
477 } |
|
478 |
|
479 case ECamFocused: |
|
480 { |
|
481 // Hide the AP during focussing |
|
482 if ( appUi->AlwaysDrawPreCaptureCourtesyUI() |
|
483 && !iController.CurrentSceneHasForcedFocus() ) |
|
484 { |
|
485 appUi->SetActivePaletteVisibility( EFalse ); |
|
486 } |
|
487 UpdateCbaL(); |
|
488 break; |
|
489 } |
|
490 |
|
491 case ECamNoOperation: |
|
492 { |
|
493 if( iController.IsAppUiAvailable() ) |
|
494 { |
|
495 //Update softkey state. |
|
496 UpdateCbaL(); |
|
497 |
|
498 // Hide the AP if we already have an autofocus request but operation doesn't |
|
499 // have it (likely shutter was half-pressed before precap view opened) |
|
500 if ( iController.PendingAFRequest() != 0 && |
|
501 appUi->AlwaysDrawPreCaptureCourtesyUI() && |
|
502 !iController.CurrentSceneHasForcedFocus() ) |
|
503 { |
|
504 appUi->SetActivePaletteVisibility( EFalse ); |
|
505 UpdateCbaL(); |
|
506 } |
|
507 |
|
508 // Show the AP again if the shutter key is released |
|
509 // without taking a picture, don't show if uiorientationoverride |
|
510 // feature is on and VF not running (prevents AP flashing in startup) |
|
511 if ( iPreviousControllerOperation !=ECamStandby && |
|
512 appUi->CurrentViewState() == ECamViewStatePreCapture && |
|
513 appUi->AlwaysDrawPreCaptureCourtesyUI() && |
|
514 !iSceneSettingModeActive && |
|
515 !( iController.UiConfigManagerPtr() && |
|
516 iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && |
|
517 !iController.IsViewFinding() ) ) |
|
518 { |
|
519 appUi->SetActivePaletteVisibility( ETrue ); |
|
520 } |
|
521 } |
|
522 |
|
523 break; |
|
524 } |
|
525 |
|
526 case ECamCapturing: |
|
527 { |
|
528 // If in burst, make sure the correct CBA is shown |
|
529 if( appUi->IsBurstEnabled() ) |
|
530 { |
|
531 UpdateCbaL(); |
|
532 // show image counter |
|
533 iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); |
|
534 } |
|
535 break; |
|
536 } |
|
537 default: |
|
538 { |
|
539 // Hide the AP if we already have an autofocus request but operation doesn't |
|
540 // have it (likely shutter was half-pressed before precap view opened) |
|
541 if ( iController.PendingAFRequest() != 0 && |
|
542 appUi->AlwaysDrawPreCaptureCourtesyUI() && |
|
543 !iController.CurrentSceneHasForcedFocus() ) |
|
544 { |
|
545 appUi->SetActivePaletteVisibility( EFalse ); |
|
546 UpdateCbaL(); |
|
547 } |
|
548 break; |
|
549 } |
|
550 } |
|
551 |
|
552 iPreviousControllerOperation = operation; |
|
553 |
|
554 } |
|
555 else |
|
556 { |
|
557 PRINT( _L("Camera <> CCamStillPreCaptureView: call CCamPreCaptureViewBase::HandleControllerEventL") ); |
|
558 CCamPreCaptureViewBase::HandleControllerEventL( aEvent, aError ); |
|
559 } |
|
560 PRINT( _L("Camera <= CCamStillPreCaptureView::HandleControllerEventL") ); |
|
561 } |
|
562 |
|
563 |
|
564 // --------------------------------------------------------------------------- |
|
565 // CCamStillPreCaptureView::CreateCaptureSetupMenuL |
|
566 // Creates a photo capture setup menu |
|
567 // --------------------------------------------------------------------------- |
|
568 // |
|
569 void CCamStillPreCaptureView::CreateCaptureSetupMenuL( ) |
|
570 { |
|
571 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 1" ); |
|
572 TInt resource; |
|
573 // check if we are Western or Arabic/Hebrew layout |
|
574 if ( !AknLayoutUtils::LayoutMirrored() ) |
|
575 { |
|
576 // Do we need APAC layout |
|
577 if( AknLayoutUtils::Variant() == EApacVariant ) |
|
578 { |
|
579 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC_ID); |
|
580 } |
|
581 else |
|
582 { |
|
583 // use Western resource |
|
584 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID); |
|
585 } |
|
586 } |
|
587 else |
|
588 { |
|
589 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH_ID); |
|
590 } |
|
591 |
|
592 // Use capture setup menu for second camera |
|
593 if ( static_cast<CCamAppUiBase*>( AppUi() )->IsSecondCameraEnabled() ) |
|
594 { |
|
595 resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID); |
|
596 } |
|
597 |
|
598 iCaptureSetupMenuContainer = |
|
599 CCamCaptureSetupMenu::NewL( iController, *this, AppUi()->ClientRect(), |
|
600 resource, iCaptureSetupMenuLastItemIndex ); |
|
601 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 0" ); |
|
602 } |
|
603 |
|
604 // --------------------------------------------------------------------------- |
|
605 // CCamStillPreCaptureView::SetMenuBar() |
|
606 // Sets the menu bar according to camera state |
|
607 // --------------------------------------------------------------------------- |
|
608 // |
|
609 void |
|
610 CCamStillPreCaptureView::SetMenuBar() |
|
611 { |
|
612 PRINT( _L("Camera => CCamStillPreCaptureView::SetMenuBar") ); |
|
613 |
|
614 // update menu bar as required |
|
615 CEikMenuBar* menuBar = MenuBar(); |
|
616 |
|
617 // if menuBar exists |
|
618 if ( menuBar ) |
|
619 { |
|
620 if ( iStandbyModeActive ) //&& iActivateToStandby ) |
|
621 { |
|
622 PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting standby menubar..") ); |
|
623 menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR ); |
|
624 } |
|
625 else if ( iEmbedded && !iSceneSettingModeActive ) |
|
626 { |
|
627 PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting embedded menubar..") ); |
|
628 menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID)); |
|
629 } |
|
630 else |
|
631 { |
|
632 if ( iSceneSettingModeActive ) |
|
633 { |
|
634 PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting scene setting menubar..") ); |
|
635 menuBar->SetMenuTitleResourceId( ROID(R_CAM_SCENE_SETTING_MENUBAR_ID)); |
|
636 } |
|
637 else |
|
638 { |
|
639 PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting normal menubar..") ); |
|
640 menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID)); |
|
641 } |
|
642 } |
|
643 } |
|
644 PRINT( _L("Camera <= CCamStillPreCaptureView::SetMenuBar") ); |
|
645 } |
|
646 |
|
647 |
|
648 // --------------------------------------------------------------------------- |
|
649 // CCamStillPreCaptureView::CCamStillPreCaptureView |
|
650 // C++ constructor |
|
651 // --------------------------------------------------------------------------- |
|
652 // |
|
653 CCamStillPreCaptureView::CCamStillPreCaptureView( CCamAppController& aController ) |
|
654 : CCamPreCaptureViewBase( aController ),iSoftkeyBlankIsNeeded( EFalse ) |
|
655 { |
|
656 } |
|
657 |
|
658 // --------------------------------------------------------------------------- |
|
659 // CCamStillPreCaptureView::ConstructL |
|
660 // Symbian OS 2nd phase constructor |
|
661 // --------------------------------------------------------------------------- |
|
662 // |
|
663 void CCamStillPreCaptureView::ConstructL() |
|
664 { |
|
665 BaseConstructL( ROID(R_CAM_STILL_PRE_CAPTURE_VIEW_ID)); |
|
666 |
|
667 iPreviousControllerOperation = ECamNoOperation; |
|
668 |
|
669 CAknToolbar* toolbar = Toolbar(); |
|
670 if ( toolbar ) |
|
671 { |
|
672 //Hide toolbar for first camera startup. |
|
673 toolbar->SetToolbarVisibility(EFalse); |
|
674 } |
|
675 |
|
676 CCamPreCaptureViewBase::ConstructL(); |
|
677 } |
|
678 |
|
679 |
|
680 // --------------------------------------------------------------------------- |
|
681 // CCamStillPreCaptureView::UpdateCbaL |
|
682 // Update softkeys to reflect current state |
|
683 // --------------------------------------------------------------------------- |
|
684 // |
|
685 void CCamStillPreCaptureView::UpdateCbaL() |
|
686 { |
|
687 PRINT( _L("Camera => CCamStillPreCaptureView::UpdateCbaL") ); |
|
688 |
|
689 CCamAppUi* appui = static_cast<CCamAppUi*>( AppUi() ); |
|
690 TBool burstEnabled = appui->IsBurstEnabled(); |
|
691 |
|
692 TCamCaptureOperation operation = iController.CurrentOperation(); |
|
693 TBool isSecondaryPortrait = appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera(); |
|
694 if ( iSoftkeyBlankIsNeeded ) |
|
695 { |
|
696 isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT ); |
|
697 } |
|
698 // if video call is active |
|
699 else if ( iController.InVideocallOrRinging() ) |
|
700 { |
|
701 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); |
|
702 } |
|
703 // if the view is in capture setup menu mode |
|
704 else if ( iCaptureSetupMenuModeActive && |
|
705 !iCaptureSetupModeActive && |
|
706 !iSceneSettingModeActive ) |
|
707 { |
|
708 SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_BACK ); |
|
709 } |
|
710 // if the view is in capture setup mode |
|
711 else if ( iCaptureSetupModeActive ) |
|
712 { |
|
713 SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT ); |
|
714 } |
|
715 // if the view is in scene settings mode |
|
716 else if ( iSceneSettingModeActive ) |
|
717 { |
|
718 SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_CANCEL ); |
|
719 } |
|
720 else if ( iStandbyModeActive ) |
|
721 { |
|
722 PRINT( _L("Camera <> CCamStillPreCaptureView::UpdateCbaL: Setting standby softkeys..") ); |
|
723 if( KErrNone == appui->StandbyStatus() ) |
|
724 { |
|
725 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE ); |
|
726 } |
|
727 else if( appui->IsRecoverableStatus() ) |
|
728 { |
|
729 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); |
|
730 } |
|
731 } |
|
732 else if( iInfoListBoxActive ) |
|
733 { |
|
734 if( !iForceAvkonCBA ) |
|
735 { |
|
736 SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT ); |
|
737 } |
|
738 else |
|
739 { |
|
740 SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); |
|
741 } |
|
742 } |
|
743 else if ( ( operation == ECamFocusing || operation == ECamFocused || operation == ECamFocusFailed ) |
|
744 && !iController.CurrentSceneHasForcedFocus() ) |
|
745 { |
|
746 // If AutoFocus operation in progress. Can occur for still or |
|
747 // burst capture |
|
748 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
749 } |
|
750 // If timelapse capture is ongoing the keys should be blank and cancel |
|
751 else if ( burstEnabled && |
|
752 appui->CurrentBurstMode() == ECamImageCaptureTimeLapse && |
|
753 iController.SequenceCaptureInProgress() ) |
|
754 { |
|
755 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ); |
|
756 } |
|
757 // If "Burst" capture is starting |
|
758 else if ( burstEnabled && operation == ECamCapturing ) |
|
759 { |
|
760 |
|
761 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ); |
|
762 } |
|
763 // If "Burst" capture is completing |
|
764 else if ( burstEnabled && operation == ECamCompleting ) |
|
765 { |
|
766 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
767 } |
|
768 else if ( appui->SelfTimerEnabled() ) |
|
769 { |
|
770 // If self-timer enabled, check the precise state to show the |
|
771 // correct CBA state. |
|
772 CCamSelfTimer* selftimer = appui->SelfTimer(); |
|
773 if ( selftimer->IsActive() ) |
|
774 { |
|
775 { |
|
776 SetSoftKeysL( R_CAM_SOFTKEYS_SELFTIMER_BLANK_CANCEL ); |
|
777 } |
|
778 } |
|
779 else if( iEmbedded && operation == ECamCompleting ) |
|
780 { |
|
781 isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
782 } |
|
783 else |
|
784 { |
|
785 ViewCba()->MakeVisible( ETrue ); |
|
786 SetSoftKeysL( R_CAM_SOFTKEYS_ACTIVATE_CANCEL__SELECT ); |
|
787 } |
|
788 } |
|
789 else // otherwise, show the default softkeys |
|
790 { |
|
791 // options key is disabled if currently in capture mode |
|
792 // transition (i.e. switching to video mode) |
|
793 if ( iController.CaptureModeTransitionInProgress() ) |
|
794 { |
|
795 SetSoftKeysL( iEmbedded |
|
796 ? R_CAM_SOFTKEYS_BACK |
|
797 : R_CAM_SOFTKEYS_BLANK_EXIT ); |
|
798 if(iEmbedded ) |
|
799 { |
|
800 if(isSecondaryPortrait) |
|
801 { |
|
802 SetSoftKeysL(R_CAM_SOFTKEYS_BACK_SECONDARY); |
|
803 } |
|
804 else |
|
805 { |
|
806 SetSoftKeysL(R_CAM_SOFTKEYS_BACK); |
|
807 } |
|
808 } |
|
809 else |
|
810 { |
|
811 if(isSecondaryPortrait) |
|
812 { |
|
813 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY); |
|
814 } |
|
815 else |
|
816 { |
|
817 SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT); |
|
818 } |
|
819 } |
|
820 } |
|
821 else |
|
822 { |
|
823 if ( iEmbedded ) |
|
824 { |
|
825 if ( operation == ECamCapturing || operation == ECamCompleting ) |
|
826 { |
|
827 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
828 } |
|
829 else |
|
830 { |
|
831 if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) |
|
832 { |
|
833 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY ); |
|
834 } |
|
835 else |
|
836 { |
|
837 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE ); |
|
838 } |
|
839 |
|
840 } |
|
841 } |
|
842 else |
|
843 { |
|
844 if ( operation != ECamCompleting |
|
845 && ( !appui->ShowPostCaptureView() |
|
846 || iController.IsViewFinding() ) ) |
|
847 { |
|
848 const TCamOrientation orientation = appui->CamOrientation(); |
|
849 if ( iController.IsTouchScreenSupported() |
|
850 && (ECamOrientationCamcorder == orientation |
|
851 || ECamOrientationCamcorderLeft == orientation) ) |
|
852 { |
|
853 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); |
|
854 } |
|
855 else |
|
856 { |
|
857 if ( !appui->IsToolBarVisible() |
|
858 && appui->IsSecondCameraEnabled() |
|
859 && !iController.IsTouchScreenSupported() ) |
|
860 { |
|
861 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_TXT ); |
|
862 } |
|
863 else |
|
864 { |
|
865 appui->IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ): |
|
866 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); |
|
867 } |
|
868 } |
|
869 } |
|
870 else // operation == ECamCompleting |
|
871 { |
|
872 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
873 } |
|
874 |
|
875 } |
|
876 } |
|
877 } |
|
878 PRINT( _L("Camera <= CCamStillPreCaptureView::UpdateCbaL") ); |
|
879 } |
|
880 |
|
881 |
|
882 // --------------------------------------------------------------------------- |
|
883 // CCamStillPreCaptureView::SetTitlePaneTextL |
|
884 // Set the view's title text |
|
885 // --------------------------------------------------------------------------- |
|
886 // |
|
887 void CCamStillPreCaptureView::SetTitlePaneTextL() |
|
888 { |
|
889 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
890 #ifndef __WINS__ |
|
891 if ( iEmbedded /*&& !appUi->IsInCallSend()*/ ) |
|
892 { |
|
893 // only set the title if the construction is complete |
|
894 // otherwise the application is not yet set up correctly |
|
895 // as embedded |
|
896 if ( appUi->IsConstructionComplete() ) |
|
897 { |
|
898 // set title to name of embedding application |
|
899 appUi->SetTitleEmbeddedL(); |
|
900 } |
|
901 } |
|
902 else |
|
903 #endif |
|
904 { |
|
905 TInt titleResourceId = R_CAM_STILL_PRE_CAPTURE_TITLE_NAME; |
|
906 |
|
907 if ( iCaptureSetupModeActive || iSceneSettingModeActive || iInfoListBoxActive ) |
|
908 { |
|
909 titleResourceId = CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId(); |
|
910 } |
|
911 |
|
912 appUi->SetTitleL( titleResourceId ); |
|
913 } |
|
914 } |
|
915 |
|
916 // --------------------------------------------------------------------------- |
|
917 // CCamStillPreCaptureView::StartViewFinder |
|
918 // Enter viewfinder mode |
|
919 // --------------------------------------------------------------------------- |
|
920 // |
|
921 void CCamStillPreCaptureView::StartViewFinder() |
|
922 { |
|
923 iController.EnterViewfinderMode( ECamControllerImage ); |
|
924 } |
|
925 |
|
926 // --------------------------------------------------------------------------- |
|
927 // CCamStillPreCaptureView::StopViewFinder |
|
928 // Exit viewfinder mode |
|
929 // --------------------------------------------------------------------------- |
|
930 // |
|
931 void CCamStillPreCaptureView::StopViewFinder() |
|
932 { |
|
933 iController.ExitViewfinderMode( ECamControllerImage ); |
|
934 } |
|
935 |
|
936 // --------------------------------------------------------------------------- |
|
937 // CCamStillPreCaptureView::CreateContainerL |
|
938 // Create container control |
|
939 // --------------------------------------------------------------------------- |
|
940 // |
|
941 void CCamStillPreCaptureView::CreateContainerL() |
|
942 { |
|
943 PRINT( _L("Camera => CCamStillPreCaptureView::CreateContainerL" ) ) |
|
944 |
|
945 TRect screen; |
|
946 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); |
|
947 |
|
948 iContainer = CCamStillPreCaptureContainer::NewL( |
|
949 iController, |
|
950 *this, |
|
951 screen ); |
|
952 iContainer->SetMopParent( this ); |
|
953 |
|
954 CCamPreCaptureViewBase::CreateContainerL(); |
|
955 PRINT( _L("Camera <= CCamStillPreCaptureView::CreateContainerL" ) ) |
|
956 } |
|
957 |
|
958 // --------------------------------------------------------------------------- |
|
959 // CCamStillPreCaptureView::DynInitMenuPaneL |
|
960 // Changes MenuPane dynamically |
|
961 // --------------------------------------------------------------------------- |
|
962 // |
|
963 void CCamStillPreCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
964 { |
|
965 PRINT( _L("Camera => CamStillPreCaptureView::DynInitMenuPaneL")) |
|
966 |
|
967 if ( iContainer ) |
|
968 { |
|
969 iContainer->Window().SetNonFading( ETrue ); |
|
970 } |
|
971 |
|
972 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
973 __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); |
|
974 TInt itemPos(0); |
|
975 if( aMenuPane->MenuItemExists(ECamCmdToggleCourtesyUI, itemPos) ) |
|
976 { |
|
977 if ( !appUi->AlwaysDrawPreCaptureCourtesyUI() ) |
|
978 { |
|
979 aMenuPane->SetItemTextL( ECamCmdToggleCourtesyUI, |
|
980 R_CAM_CAPTURE_DISPLAY_ON_TEXT); |
|
981 } |
|
982 } |
|
983 |
|
984 // if menu pane is default still capture menu |
|
985 if ( aResourceId == ROID(R_CAM_STILL_PRE_CAPTURE_MENU_ID)) |
|
986 { |
|
987 DynInitSwitchCameraMenuItemL( aMenuPane ); |
|
988 } |
|
989 // else if ( aResourceId == R_CAM_STANDBY_MENU && iStandbyError != KErrNone ) |
|
990 else if ( aResourceId == R_CAM_STANDBY_MENU ) |
|
991 { |
|
992 if( appUi->StandbyStatus() != KErrNone ) |
|
993 aMenuPane->SetItemDimmed( ECamCmdExitStandby, ETrue ); |
|
994 } |
|
995 |
|
996 else if( aResourceId == ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_ID)) |
|
997 { |
|
998 DynInitSwitchCameraMenuItemL( aMenuPane ); |
|
999 |
|
1000 /*#ifndef __WINS__ |
|
1001 // if embedded and not in in-call send |
|
1002 if ( !appUi->IsInCallSend() ) |
|
1003 #endif |
|
1004 { |
|
1005 aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue ); |
|
1006 }*/ |
|
1007 aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue ); |
|
1008 } |
|
1009 else // otherwise, not embedded, not in burst mode or menu pane is not default |
|
1010 { |
|
1011 CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
1012 } |
|
1013 PRINT( _L("Camera <= CamStillPreCaptureView::DynInitMenuPaneL")) |
|
1014 } |
|
1015 |
|
1016 |
|
1017 // --------------------------------------------------------------------------- |
|
1018 // CCamPreCaptureViewBase::SwitchToSceneSettingModeL |
|
1019 // Switches the current mode to scene setting and activates a |
|
1020 // specific control. |
|
1021 // --------------------------------------------------------------------------- |
|
1022 // |
|
1023 void CCamStillPreCaptureView::SwitchToSceneSettingModeL() |
|
1024 { |
|
1025 if ( !iSceneSettingContainer ) |
|
1026 { |
|
1027 iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(), |
|
1028 *this, |
|
1029 ECamControllerImage, |
|
1030 iController ); |
|
1031 iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1); |
|
1032 } |
|
1033 |
|
1034 iSettingModeTitleResourceId = R_CAM_STILL_SCENE_SETTING_TITLE; |
|
1035 |
|
1036 if ( iEmbedded ) |
|
1037 { |
|
1038 iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); |
|
1039 } |
|
1040 else |
|
1041 { |
|
1042 iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID); |
|
1043 } |
|
1044 // Remove the view's main container, and add the capture setup |
|
1045 // control associated with the input command to the container stack. |
|
1046 //CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); |
|
1047 |
|
1048 CCamPreCaptureViewBase::SwitchToSceneSettingModeL(); |
|
1049 |
|
1050 |
|
1051 // only remove the capture setup menu container after |
|
1052 // the switch completes successfully |
|
1053 RemoveCaptureSetupMenuContainers(); |
|
1054 |
|
1055 // Stop the viewfinder as it isn't required for scene settings |
|
1056 StopViewFinder(); |
|
1057 } |
|
1058 |
|
1059 |
|
1060 // --------------------------------------------------------------------------- |
|
1061 // CCamPreCaptureViewBase::SwitchToInfoListBoxL |
|
1062 // Switches the current mode to scene setting and activates a |
|
1063 // specific control. |
|
1064 // --------------------------------------------------------------------------- |
|
1065 // |
|
1066 void CCamStillPreCaptureView::SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ) |
|
1067 { |
|
1068 CCamAppUi* appUi = static_cast<CCamAppUi*>( iCoeEnv->AppUi() ); |
|
1069 |
|
1070 TBool modeSelected = EFalse; |
|
1071 TInt listBoxResource; |
|
1072 TInt summaryResource; |
|
1073 TInt initialValue; |
|
1074 TInt titleResource; |
|
1075 TBool skinnedbackground = EFalse; |
|
1076 |
|
1077 switch( aMode ) |
|
1078 { |
|
1079 case EInfoListBoxModeTimeLapse: |
|
1080 { |
|
1081 // Find out whether we are in burst mode |
|
1082 TBool burstmode = EFalse; |
|
1083 |
|
1084 // if capturing burst with 0 interval then this is normal sequence mode |
|
1085 if ( appUi->IsBurstEnabled() ) |
|
1086 { |
|
1087 burstmode = ETrue; |
|
1088 } |
|
1089 |
|
1090 // Time lapse / sequence mode selector initialization values |
|
1091 initialValue = CamTimeLapseUtility::IntervalToEnum( iController.TimeLapseInterval(), burstmode ); |
|
1092 listBoxResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE; |
|
1093 summaryResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE_SUMMARY; |
|
1094 titleResource = R_CAM_TIME_LAPSE_TITLE; |
|
1095 |
|
1096 modeSelected = ETrue; |
|
1097 } |
|
1098 break; |
|
1099 |
|
1100 case EInfoListBoxModeISO: |
|
1101 { |
|
1102 // Light sensitivity selector initialization values |
|
1103 initialValue = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity ); |
|
1104 if ( iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) |
|
1105 { |
|
1106 listBoxResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY; |
|
1107 summaryResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY_SUMMARY; |
|
1108 } |
|
1109 else |
|
1110 { |
|
1111 listBoxResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY; |
|
1112 summaryResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY_SUMMARY; |
|
1113 } |
|
1114 titleResource = R_CAM_LIGHT_SENSITIVITY_TITLE; |
|
1115 modeSelected = ETrue; |
|
1116 skinnedbackground = EFalse; |
|
1117 } |
|
1118 break; |
|
1119 |
|
1120 default: |
|
1121 break; |
|
1122 } |
|
1123 |
|
1124 if( modeSelected ) |
|
1125 { |
|
1126 iInfoListBoxContainer = CCamInfoListBoxContainer::NewL( AppUi()->ApplicationRect(), |
|
1127 *this, |
|
1128 iController, |
|
1129 listBoxResource, |
|
1130 summaryResource, |
|
1131 initialValue, titleResource, |
|
1132 skinnedbackground ); |
|
1133 |
|
1134 iInfoListBoxContainer->DrawableWindow()->SetOrdinalPosition(-1); |
|
1135 iInfoListBoxContainer->SetMopParent( this ); |
|
1136 iInfoListBoxMode = aMode; |
|
1137 iSettingModeTitleResourceId = titleResource; |
|
1138 |
|
1139 if ( iEmbedded ) |
|
1140 { |
|
1141 iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); |
|
1142 } |
|
1143 else |
|
1144 { |
|
1145 iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID); |
|
1146 } |
|
1147 // Remove the view's main container, and add the capture setup |
|
1148 // control associated with the input command to the container stack. |
|
1149 CCamCaptureSetupViewBase::SwitchToInfoListBoxL( aMode, skinnedbackground ); |
|
1150 |
|
1151 // only remove the capture setup menu container after |
|
1152 // the switch completes successfully |
|
1153 RemoveCaptureSetupMenuContainers(); |
|
1154 if( skinnedbackground ) |
|
1155 { |
|
1156 // Stop the viewfinder |
|
1157 StopViewFinder(); |
|
1158 } |
|
1159 } |
|
1160 } |
|
1161 |
|
1162 |
|
1163 // --------------------------------------------------------------------------- |
|
1164 // CCamStillPreCaptureView::DoActivateL |
|
1165 // Activate this view |
|
1166 // --------------------------------------------------------------------------- |
|
1167 // |
|
1168 void CCamStillPreCaptureView::DoActivateL( const TVwsViewId& aPrevViewId, |
|
1169 TUid aCustomMessageId, |
|
1170 const TDesC8& aCustomMessage ) |
|
1171 { |
|
1172 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 1" ); |
|
1173 PRINT( _L("Camera => CCamStillPreCaptureView::DoActivateL") ); |
|
1174 PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewActivation ); |
|
1175 // Ensure the correct menu is used for the current mode. |
|
1176 |
|
1177 // If we are coming back from settings plugin wait for the sequence to complete |
|
1178 // during that time, update the softkey with BLANK_EXIT softkey |
|
1179 if ( TUid::Uid ( EAknSoftkeyBack ) == aCustomMessageId ) |
|
1180 { |
|
1181 iSoftkeyBlankIsNeeded = ETrue; |
|
1182 } |
|
1183 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
1184 |
|
1185 // fixed toolbar is used only with touch devices |
|
1186 if ( iController.IsTouchScreenSupported() ) |
|
1187 { |
|
1188 if ( appUi && appUi->IsEmbedded() ) |
|
1189 { |
|
1190 CAknToolbar* toolbar = Toolbar(); |
|
1191 toolbar->SetToolbarVisibility(EFalse); |
|
1192 } |
|
1193 } |
|
1194 else |
|
1195 { |
|
1196 // handled in CamPreCaptureViewBase |
|
1197 } |
|
1198 if ( appUi ) |
|
1199 { |
|
1200 // inform appui of current capture mode |
|
1201 TCamImageCaptureMode mode = appUi->CurrentBurstMode(); |
|
1202 |
|
1203 if ( ECamImageCaptureNone != mode ) |
|
1204 { |
|
1205 appUi->SetCaptureMode( ECamControllerImage, mode ); |
|
1206 } |
|
1207 else |
|
1208 { |
|
1209 appUi->SetCaptureMode( ECamControllerImage, ECamImageCaptureSingle ); |
|
1210 } |
|
1211 } |
|
1212 |
|
1213 |
|
1214 CCamPreCaptureViewBase::DoActivateL( aPrevViewId, |
|
1215 aCustomMessageId, |
|
1216 aCustomMessage ); |
|
1217 |
|
1218 |
|
1219 SetMenuBar(); |
|
1220 |
|
1221 |
|
1222 PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewActivation ); |
|
1223 PRINT( _L("Camera <= CCamStillPreCaptureView::DoActivateL") ); |
|
1224 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 0" ); |
|
1225 } |
|
1226 |
|
1227 |
|
1228 // --------------------------------------------------------------------------- |
|
1229 // CCamStillPreCaptureView::GetHelpContext |
|
1230 // Called to identify the help context for this view |
|
1231 // --------------------------------------------------------------------------- |
|
1232 // |
|
1233 void CCamStillPreCaptureView::GetHelpContext( TCoeHelpContext& aContext ) const |
|
1234 { |
|
1235 aContext.iMajor = TUid::Uid( KCameraappUID ); |
|
1236 |
|
1237 // First check to see if the scene settings list is open |
|
1238 if ( iSceneSettingModeActive ) |
|
1239 { |
|
1240 aContext.iContext = KLCAM_HLP_SCENES_PHOTO; |
|
1241 } |
|
1242 else if( iInfoListBoxActive && EInfoListBoxModeTimeLapse == iInfoListBoxMode ) |
|
1243 { |
|
1244 |
|
1245 // aContext.iContext = KLCAM_HLP_SCENES_PHOTO; |
|
1246 aContext.iContext = KLCAM_HLP_ADVANCED_SEQUENCE; |
|
1247 } |
|
1248 else if( iInfoListBoxActive && EInfoListBoxModeISO == iInfoListBoxMode ) |
|
1249 { |
|
1250 |
|
1251 // aContext.iContext = KLCAM_HLP_SCENES_PHOTO; |
|
1252 aContext.iContext = KLCAM_HLP_LIGHT_SENSITIVITY; |
|
1253 } |
|
1254 // Else check for standby mode |
|
1255 else if ( iStandbyModeActive ) |
|
1256 { |
|
1257 // Also check to see if this is embedded standby |
|
1258 if ( iEmbedded ) |
|
1259 { |
|
1260 aContext.iContext = KLCAM_HLP_STANDYBY_EM; |
|
1261 } |
|
1262 else |
|
1263 { |
|
1264 aContext.iContext = KLCAM_HLP_STANDYBY_EM; |
|
1265 } |
|
1266 } |
|
1267 // Else check for embedded mode |
|
1268 else if ( iEmbedded ) |
|
1269 { |
|
1270 aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO_EM; |
|
1271 } |
|
1272 // Else this is the plain photo viewfinder |
|
1273 else |
|
1274 { |
|
1275 aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO; |
|
1276 } |
|
1277 } |
|
1278 |
|
1279 // --------------------------------------------------------------------------- |
|
1280 // CCamStillPreCaptureView::DynInitToolbarL |
|
1281 // Dynamically initialize toolbar contents |
|
1282 // --------------------------------------------------------------------------- |
|
1283 // |
|
1284 void CCamStillPreCaptureView::DynInitToolbarL( TInt aResourceId, |
|
1285 CAknToolbar* aToolbar ) |
|
1286 { |
|
1287 PRINT2( _L("Camera => CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); |
|
1288 (void)aResourceId; // remove compiler warning |
|
1289 |
|
1290 CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
1291 iController.StartIdleTimer(); |
|
1292 |
|
1293 // fixed toolbar is used only with touch devices |
|
1294 if ( iController.IsTouchScreenSupported() ) |
|
1295 { |
|
1296 UpdateToolbarIconsL(); |
|
1297 if( aToolbar ) |
|
1298 { |
|
1299 if ( iEmbedded /* && appUi->IsSecondCameraEnabled()*/ ) |
|
1300 { |
|
1301 // Dim mode switch icon and disable tooltip |
|
1302 aToolbar->SetItemDimmed( ECamCmdNewVideo, ETrue, ETrue ); |
|
1303 |
|
1304 CAknButton* videoModeButton = static_cast<CAknButton*>( |
|
1305 aToolbar->ControlOrNull( ECamCmdNewVideo ) ); |
|
1306 if ( videoModeButton ) |
|
1307 { |
|
1308 videoModeButton->SetDimmedHelpTextL( KNullDesC ); |
|
1309 } |
|
1310 |
|
1311 |
|
1312 |
|
1313 if ( appUi && appUi->IsSecondCameraEnabled() ) |
|
1314 { |
|
1315 aToolbar->SetItemDimmed( ECamCmdPhotos, ETrue, ETrue ); |
|
1316 CAknButton* photosButton = static_cast<CAknButton*>( |
|
1317 aToolbar->ControlOrNull( ECamCmdPhotos ) ); |
|
1318 if ( photosButton ) |
|
1319 { |
|
1320 // do not show tooltip for dimmed item |
|
1321 photosButton->SetDimmedHelpTextL( KNullDesC ); |
|
1322 } |
|
1323 } |
|
1324 } |
|
1325 CAknToolbarExtension* extension = aToolbar->ToolbarExtension(); |
|
1326 |
|
1327 if( extension ) |
|
1328 { |
|
1329 |
|
1330 if ( iEmbedded ) |
|
1331 { |
|
1332 extension->HideItemL( ECamCmdNewVideo, ETrue ); |
|
1333 extension->HideItemL( ECamCmdTimeLapseSlider, ETrue ); |
|
1334 extension->HideItemL( ECamCmdPhotos, ETrue ); |
|
1335 } |
|
1336 else |
|
1337 { |
|
1338 extension->HideItemL( ECamCmdNewVideo, EFalse ); |
|
1339 extension->HideItemL( ECamCmdToggleFacetracking, EFalse ); |
|
1340 extension->HideItemL( ECamCmdPhotos, EFalse ); |
|
1341 } |
|
1342 if(aResourceId == ECamCmdToolbarExtension) |
|
1343 { |
|
1344 appUi->ZoomPane()->MakeVisible(EFalse,ETrue); |
|
1345 } |
|
1346 } |
|
1347 } |
|
1348 } |
|
1349 |
|
1350 PRINT2( _L("Camera <= CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); |
|
1351 } |
|
1352 |
|
1353 // --------------------------------------------------------------------------- |
|
1354 // CCamStillPreCaptureView::UpdateToolbarIconsL |
|
1355 // Update fixed toolbar icons according to current settings |
|
1356 // --------------------------------------------------------------------------- |
|
1357 // |
|
1358 void CCamStillPreCaptureView::UpdateToolbarIconsL() |
|
1359 { |
|
1360 PRINT( _L("Camera => CCamStillPreCaptureView::UpdateToolbarIconsL") ); |
|
1361 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 1" ); |
|
1362 // fixed toolbar is used only with touch devices |
|
1363 if(!iController.IsTouchScreenSupported()) |
|
1364 return; |
|
1365 UpdateFlashIconsL(); |
|
1366 UpdateLightSensitivityIconsL(); |
|
1367 UpdateColorToneIconsL(); |
|
1368 UpdateWhiteBalanceIconsL(); |
|
1369 UpdateSharpnessIconsL(); |
|
1370 UpdateExposureIconsL(); |
|
1371 UpdateContrastIconsL(); |
|
1372 UpdateSceneModeIconsL(); |
|
1373 UpdateSelfTimerIconsL(); |
|
1374 UpdateVFGridIconsL(); |
|
1375 UpdateBurstModeIconsL(); |
|
1376 UpdateFaceTrackingIconsL(); |
|
1377 RedrawToolBar(); |
|
1378 OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 0" ); |
|
1379 PRINT( _L("Camera <= CCamStillPreCaptureView::UpdateToolbarIconsL") ); |
|
1380 } |
|
1381 |
|
1382 // --------------------------------------------------------------------------- |
|
1383 // CCamStillPreCaptureView::UpdateFlashIconsL |
|
1384 // --------------------------------------------------------------------------- |
|
1385 // |
|
1386 void CCamStillPreCaptureView::UpdateFlashIconsL() |
|
1387 { |
|
1388 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupFlashStill); |
|
1389 if(!button) |
|
1390 return; |
|
1391 TCamFlashId flash = static_cast< TCamFlashId > |
|
1392 ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); |
|
1393 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1394 TFileName iconFileName; |
|
1395 CamUtility::ResourceFileName( iconFileName ); |
|
1396 switch(flash) |
|
1397 { |
|
1398 case ECamFlashAuto: |
|
1399 { |
|
1400 SetIconL( |
|
1401 button, |
|
1402 iconFileName, |
|
1403 EMbmCameraappQgn_indi_cam4_autoflash, |
|
1404 EMbmCameraappQgn_indi_cam4_autoflash_mask, |
|
1405 skinInstance, |
|
1406 KAknsIIDQgnIndiCam4Autoflash ); |
|
1407 |
|
1408 break; |
|
1409 } |
|
1410 case ECamFlashOff: |
|
1411 { |
|
1412 SetIconL( |
|
1413 button, |
|
1414 iconFileName, |
|
1415 EMbmCameraappQgn_indi_cam4_flash_off, |
|
1416 EMbmCameraappQgn_indi_cam4_flash_off_mask, |
|
1417 skinInstance, |
|
1418 KAknsIIDQgnIndiCam4FlashOff ); |
|
1419 break; |
|
1420 } |
|
1421 case ECamFlashAntiRedEye: |
|
1422 { |
|
1423 SetIconL( |
|
1424 button, |
|
1425 iconFileName, |
|
1426 EMbmCameraappQgn_indi_cam4_antired, |
|
1427 EMbmCameraappQgn_indi_cam4_antired_mask, |
|
1428 skinInstance, |
|
1429 KAknsIIDQgnIndiCam4Antired ); |
|
1430 break; |
|
1431 } |
|
1432 case ECamFlashForced: |
|
1433 { |
|
1434 SetIconL( |
|
1435 button, |
|
1436 iconFileName, |
|
1437 EMbmCameraappQgn_indi_cam4_flash_on, |
|
1438 EMbmCameraappQgn_indi_cam4_flash_on_mask, |
|
1439 skinInstance, |
|
1440 KAknsIIDQgnIndiCam4FlashOn ); |
|
1441 break; |
|
1442 } |
|
1443 default: |
|
1444 break; |
|
1445 } |
|
1446 } |
|
1447 |
|
1448 // --------------------------------------------------------------------------- |
|
1449 // CCamStillPreCaptureView::UpdateContrastIconsL |
|
1450 // --------------------------------------------------------------------------- |
|
1451 // |
|
1452 void CCamStillPreCaptureView::UpdateContrastIconsL() |
|
1453 { |
|
1454 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupContrastStill); |
|
1455 if ( button ) |
|
1456 { |
|
1457 if ( !iController.UiConfigManagerPtr()->IsContrastSupported() ) |
|
1458 { |
|
1459 HideButton(ECamCmdCaptureSetupContrastStill); |
|
1460 return; |
|
1461 } |
|
1462 TInt contrast = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoContrast ); |
|
1463 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1464 TFileName iconFileName; |
|
1465 CamUtility::ResourceFileName( iconFileName ); |
|
1466 if (contrast > 0) |
|
1467 { |
|
1468 SetIconL( |
|
1469 button, |
|
1470 iconFileName, |
|
1471 EMbmCameraappQgn_indi_cam4_contrast_plus, |
|
1472 EMbmCameraappQgn_indi_cam4_contrast_plus_mask, |
|
1473 skinInstance, |
|
1474 KAknsIIDQgnIndiCam4ContrastPlus ); |
|
1475 } |
|
1476 else if (contrast < 0) |
|
1477 { |
|
1478 SetIconL( |
|
1479 button, |
|
1480 iconFileName, |
|
1481 EMbmCameraappQgn_indi_cam4_contrast_minus, |
|
1482 EMbmCameraappQgn_indi_cam4_contrast_minus_mask, |
|
1483 skinInstance, |
|
1484 KAknsIIDQgnIndiCam4ContrastMinus ); |
|
1485 } |
|
1486 else |
|
1487 { |
|
1488 SetIconL( |
|
1489 button, |
|
1490 iconFileName, |
|
1491 EMbmCameraappQgn_indi_cam4_contrast, |
|
1492 EMbmCameraappQgn_indi_cam4_contrast_mask, |
|
1493 skinInstance, |
|
1494 KAknsIIDQgnIndiCam4Contrast ); |
|
1495 } |
|
1496 } |
|
1497 } |
|
1498 |
|
1499 |
|
1500 // --------------------------------------------------------------------------- |
|
1501 // CCamStillPreCaptureView::UpdateExposureIconsL |
|
1502 // --------------------------------------------------------------------------- |
|
1503 // |
|
1504 void CCamStillPreCaptureView::UpdateExposureIconsL() |
|
1505 { |
|
1506 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupExposureStill ); |
|
1507 if ( button ) |
|
1508 { |
|
1509 if ( !iController.UiConfigManagerPtr()->IsEVSupported() ) |
|
1510 { |
|
1511 HideButton(ECamCmdCaptureSetupExposureStill); |
|
1512 return; |
|
1513 } |
|
1514 TInt exposure = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoExposure ); |
|
1515 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1516 TFileName iconFileName; |
|
1517 CamUtility::ResourceFileName( iconFileName ); |
|
1518 if (exposure > 0) |
|
1519 { |
|
1520 SetIconL( |
|
1521 button, |
|
1522 iconFileName, |
|
1523 EMbmCameraappQgn_indi_cam4_exposure_plus, |
|
1524 EMbmCameraappQgn_indi_cam4_exposure_plus_mask, |
|
1525 skinInstance, |
|
1526 KAknsIIDQgnIndiCam4ExposurePlus ); |
|
1527 } |
|
1528 else if (exposure < 0) |
|
1529 { |
|
1530 SetIconL( |
|
1531 button, |
|
1532 iconFileName, |
|
1533 EMbmCameraappQgn_indi_cam4_exposure_minus, |
|
1534 EMbmCameraappQgn_indi_cam4_exposure_minus_mask, |
|
1535 skinInstance, |
|
1536 KAknsIIDQgnIndiCam4ExposureMinus ); |
|
1537 } |
|
1538 else |
|
1539 { |
|
1540 SetIconL( |
|
1541 button, |
|
1542 iconFileName, |
|
1543 EMbmCameraappQgn_indi_cam4_exposure, |
|
1544 EMbmCameraappQgn_indi_cam4_exposure_mask, |
|
1545 skinInstance, |
|
1546 KAknsIIDQgnIndiCam4Exposure ); |
|
1547 } |
|
1548 } |
|
1549 } |
|
1550 |
|
1551 |
|
1552 // --------------------------------------------------------------------------- |
|
1553 // CCamStillPreCaptureView::UpdateSharpnessIconsL |
|
1554 // --------------------------------------------------------------------------- |
|
1555 // |
|
1556 void CCamStillPreCaptureView::UpdateSharpnessIconsL() |
|
1557 { |
|
1558 CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupImageSharpnessStill); |
|
1559 if ( button ) |
|
1560 { |
|
1561 if ( !iController.UiConfigManagerPtr()->IsSharpnessFeatureSupported() ) |
|
1562 { |
|
1563 HideButton(ECamCmdCaptureSetupImageSharpnessStill); |
|
1564 return; |
|
1565 } |
|
1566 TCamImageSharpnessId sharpness = |
|
1567 static_cast< TCamImageSharpnessId > |
|
1568 ( iController.IntegerSettingValue( |
|
1569 ECamSettingItemDynamicPhotoImageSharpness ) ); |
|
1570 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1571 TFileName iconFileName; |
|
1572 CamUtility::ResourceFileName( iconFileName ); |
|
1573 static_cast< TCamImageSharpnessId > |
|
1574 ( iController.IntegerSettingValue( |
|
1575 ECamSettingItemDynamicPhotoImageSharpness ) ); |
|
1576 |
|
1577 switch ( sharpness ) |
|
1578 { |
|
1579 case ECamImageSharpnessHard: |
|
1580 { |
|
1581 SetIconL( |
|
1582 button, |
|
1583 iconFileName, |
|
1584 EMbmCameraappQgn_indi_cam4_sharpness_hard, |
|
1585 EMbmCameraappQgn_indi_cam4_sharpness_hard_mask, |
|
1586 skinInstance, |
|
1587 KAknsIIDQgnIndiCam4SharpnessHard ); |
|
1588 break; |
|
1589 } |
|
1590 case ECamImageSharpnessNorm: |
|
1591 { |
|
1592 SetIconL( |
|
1593 button, |
|
1594 iconFileName, |
|
1595 EMbmCameraappQgn_indi_cam4_sharpness_normal, |
|
1596 EMbmCameraappQgn_indi_cam4_sharpness_normal_mask, |
|
1597 skinInstance, |
|
1598 KAknsIIDQgnIndiCam4SharpnessNormal ); |
|
1599 break; |
|
1600 } |
|
1601 case ECamImageSharpnessSoft: |
|
1602 { |
|
1603 SetIconL( |
|
1604 button, |
|
1605 iconFileName, |
|
1606 EMbmCameraappQgn_indi_cam4_sharpness_soft, |
|
1607 EMbmCameraappQgn_indi_cam4_sharpness_soft_mask, |
|
1608 skinInstance, |
|
1609 KAknsIIDQgnIndiCam4SharpnessSoft ); |
|
1610 break; |
|
1611 } |
|
1612 default: |
|
1613 { |
|
1614 break; |
|
1615 } |
|
1616 } |
|
1617 } |
|
1618 |
|
1619 } |
|
1620 |
|
1621 |
|
1622 // --------------------------------------------------------------------------- |
|
1623 // CCamStillPreCaptureView::UpdateWhiteBalanceIconsL |
|
1624 // --------------------------------------------------------------------------- |
|
1625 // |
|
1626 void CCamStillPreCaptureView::UpdateWhiteBalanceIconsL() |
|
1627 { |
|
1628 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupWhiteBalanceStill ); |
|
1629 if ( button ) |
|
1630 { |
|
1631 if ( !iController.UiConfigManagerPtr()->IsWhiteBalanceFeatureSupported() ) |
|
1632 { |
|
1633 HideButton(ECamCmdCaptureSetupWhiteBalanceStill); |
|
1634 return; |
|
1635 } |
|
1636 TCamWhiteBalanceId wb = static_cast< TCamWhiteBalanceId > |
|
1637 ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoWhiteBalance ) ); |
|
1638 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1639 TFileName iconFileName; |
|
1640 CamUtility::ResourceFileName( iconFileName ); |
|
1641 switch ( wb ) |
|
1642 { |
|
1643 case ECamWhiteBalanceAWB: |
|
1644 { |
|
1645 SetIconL( |
|
1646 button, |
|
1647 iconFileName, |
|
1648 EMbmCameraappQgn_indi_cam4_wb_auto, |
|
1649 EMbmCameraappQgn_indi_cam4_wb_auto_mask, |
|
1650 skinInstance, |
|
1651 KAknsIIDQgnIndiCam4WbAuto ); |
|
1652 break; |
|
1653 } |
|
1654 case ECamWhiteBalanceDaylight: |
|
1655 { |
|
1656 SetIconL( |
|
1657 button, |
|
1658 iconFileName, |
|
1659 EMbmCameraappQgn_indi_cam4_wb_sunny, |
|
1660 EMbmCameraappQgn_indi_cam4_wb_sunny_mask, |
|
1661 skinInstance, |
|
1662 KAknsIIDQgnIndiCam4WbSunny ); |
|
1663 break; |
|
1664 } |
|
1665 case ECamWhiteBalanceCloudy: |
|
1666 { |
|
1667 SetIconL( |
|
1668 button, |
|
1669 iconFileName, |
|
1670 EMbmCameraappQgn_indi_cam4_wb_cloudy, |
|
1671 EMbmCameraappQgn_indi_cam4_wb_cloudy_mask, |
|
1672 skinInstance, |
|
1673 KAknsIIDQgnIndiCam4WbCloudy ); |
|
1674 break; |
|
1675 } |
|
1676 case ECamWhiteBalanceTungsten: |
|
1677 { |
|
1678 SetIconL( |
|
1679 button, |
|
1680 iconFileName, |
|
1681 EMbmCameraappQgn_indi_cam4_wb_tungsten, |
|
1682 EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, |
|
1683 skinInstance, |
|
1684 KAknsIIDQgnIndiCam4WbTungsten ); |
|
1685 break; |
|
1686 } |
|
1687 case ECamWhiteBalanceFlourescent: |
|
1688 { |
|
1689 SetIconL( |
|
1690 button, |
|
1691 iconFileName, |
|
1692 EMbmCameraappQgn_indi_cam4_wb_fluorecent, |
|
1693 EMbmCameraappQgn_indi_cam4_wb_fluorecent_mask, |
|
1694 skinInstance, |
|
1695 KAknsIIDQgnIndiCam4WbFluorecent ); |
|
1696 break; |
|
1697 } |
|
1698 default: |
|
1699 break; |
|
1700 } |
|
1701 } |
|
1702 |
|
1703 } |
|
1704 |
|
1705 |
|
1706 // --------------------------------------------------------------------------- |
|
1707 // CCamStillPreCaptureView::UpdateColorToneIconsL |
|
1708 // --------------------------------------------------------------------------- |
|
1709 // |
|
1710 void CCamStillPreCaptureView::UpdateColorToneIconsL() |
|
1711 { |
|
1712 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupColourFilterStill ); |
|
1713 if ( button ) |
|
1714 { |
|
1715 if ( !iController.UiConfigManagerPtr()->IsColorToneFeatureSupported() ) |
|
1716 { |
|
1717 HideButton(ECamCmdCaptureSetupColourFilterStill); |
|
1718 return; |
|
1719 } |
|
1720 TCamColourFilterId color = static_cast< TCamColourFilterId > |
|
1721 ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoColourFilter ) ); |
|
1722 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1723 TFileName iconFileName; |
|
1724 CamUtility::ResourceFileName( iconFileName ); |
|
1725 switch ( color ) |
|
1726 { |
|
1727 case ECamColourFilterColour: |
|
1728 { |
|
1729 SetIconL( |
|
1730 button, |
|
1731 iconFileName, |
|
1732 EMbmCameraappQgn_indi_cam4_colour_normal, |
|
1733 EMbmCameraappQgn_indi_cam4_colour_normal_mask, |
|
1734 skinInstance, |
|
1735 KAknsIIDQgnIndiCam4ColourNormal ); |
|
1736 break; |
|
1737 } |
|
1738 case ECamColourFilterBlackAndWhite: |
|
1739 { |
|
1740 SetIconL( |
|
1741 button, |
|
1742 iconFileName, |
|
1743 EMbmCameraappQgn_indi_cam4_colour_bw, |
|
1744 EMbmCameraappQgn_indi_cam4_colour_bw_mask, |
|
1745 skinInstance, |
|
1746 KAknsIIDQgnIndiCam4ColourBw ); |
|
1747 break; |
|
1748 } |
|
1749 case ECamColourFilterSepia: |
|
1750 { |
|
1751 SetIconL( |
|
1752 button, |
|
1753 iconFileName, |
|
1754 EMbmCameraappQgn_indi_cam4_colour_sepia, |
|
1755 EMbmCameraappQgn_indi_cam4_colour_sepia_mask, |
|
1756 skinInstance, |
|
1757 KAknsIIDQgnIndiCam4ColourSepia ); |
|
1758 break; |
|
1759 } |
|
1760 case ECamColourFilterNegative: |
|
1761 { |
|
1762 SetIconL( |
|
1763 button, |
|
1764 iconFileName, |
|
1765 EMbmCameraappQgn_indi_cam4_colour_negative, |
|
1766 EMbmCameraappQgn_indi_cam4_colour_negative_mask, |
|
1767 skinInstance, |
|
1768 KAknsIIDQgnIndiCam4ColourNegative ); |
|
1769 break; |
|
1770 } |
|
1771 case ECamColourFilterVivid: |
|
1772 { |
|
1773 SetIconL( |
|
1774 button, |
|
1775 iconFileName, |
|
1776 EMbmCameraappQgn_indi_cam4_colour_vivid, |
|
1777 EMbmCameraappQgn_indi_cam4_colour_vivid_mask, |
|
1778 skinInstance, |
|
1779 KAknsIIDQgnIndiCam4ColourVivid ); |
|
1780 break; |
|
1781 } |
|
1782 default: |
|
1783 break; |
|
1784 } |
|
1785 } |
|
1786 } |
|
1787 |
|
1788 // --------------------------------------------------------------------------- |
|
1789 // CCamStillPreCaptureView::UpdateLightSensitivityIconsL |
|
1790 // --------------------------------------------------------------------------- |
|
1791 // |
|
1792 void CCamStillPreCaptureView::UpdateLightSensitivityIconsL() |
|
1793 { |
|
1794 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupLightSensitivityStill ); |
|
1795 if ( button ) |
|
1796 { |
|
1797 if (!iController.UiConfigManagerPtr()->IsISOSupported()) |
|
1798 { |
|
1799 HideButton(ECamCmdCaptureSetupLightSensitivityStill); |
|
1800 return; |
|
1801 } |
|
1802 TCamLightSensitivityId iso = static_cast< TCamLightSensitivityId > |
|
1803 ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity ) ); |
|
1804 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1805 TFileName iconFileName; |
|
1806 CamUtility::ResourceFileName( iconFileName ); |
|
1807 switch ( iso ) |
|
1808 { |
|
1809 case ECamLightSensitivityAuto: |
|
1810 { |
|
1811 SetIconL( |
|
1812 button, |
|
1813 iconFileName, |
|
1814 EMbmCameraappQgn_indi_cam4_iso_auto, |
|
1815 EMbmCameraappQgn_indi_cam4_iso_auto_mask, |
|
1816 skinInstance, |
|
1817 KAknsIIDQgnIndiCam4IsoAuto ); |
|
1818 break; |
|
1819 } |
|
1820 case ECamLightSensitivityLow: |
|
1821 //case ECamLightSensitivityLowMed: |
|
1822 { |
|
1823 SetIconL( |
|
1824 button, |
|
1825 iconFileName, |
|
1826 EMbmCameraappQgn_indi_cam4_iso_low, |
|
1827 EMbmCameraappQgn_indi_cam4_iso_low_mask, |
|
1828 skinInstance, |
|
1829 KAknsIIDQgnIndiCam4IsoLow ); |
|
1830 break; |
|
1831 } |
|
1832 case ECamLightSensitivityMed: |
|
1833 //case ECamLightSensitivityMedHigh: |
|
1834 { |
|
1835 SetIconL( |
|
1836 button, |
|
1837 iconFileName, |
|
1838 EMbmCameraappQgn_indi_cam4_iso_medium, |
|
1839 EMbmCameraappQgn_indi_cam4_iso_medium_mask, |
|
1840 skinInstance, |
|
1841 KAknsIIDQgnIndiCam4IsoMedium ); |
|
1842 break; |
|
1843 } |
|
1844 case ECamLightSensitivityHigh: |
|
1845 { |
|
1846 SetIconL( |
|
1847 button, |
|
1848 iconFileName, |
|
1849 EMbmCameraappQgn_indi_cam4_iso_high, |
|
1850 EMbmCameraappQgn_indi_cam4_iso_high_mask, |
|
1851 skinInstance, |
|
1852 KAknsIIDQgnIndiCam4IsoHigh ); |
|
1853 break; |
|
1854 } |
|
1855 default: |
|
1856 break; |
|
1857 } |
|
1858 } |
|
1859 |
|
1860 } |
|
1861 |
|
1862 // --------------------------------------------------------------------------- |
|
1863 // CCamStillPreCaptureView::StartMskCapture() |
|
1864 // Try to start the capture with MSK command. Return true if started. |
|
1865 // --------------------------------------------------------------------------- |
|
1866 // |
|
1867 TBool CCamStillPreCaptureView::StartMskCaptureL() |
|
1868 { |
|
1869 PRINT( _L("Camera => CCamStillPreCaptureView::StartMskCapture") ); |
|
1870 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
1871 TCamOrientation orientation = appUi->CamOrientation(); |
|
1872 TBool startedCapture(EFalse); |
|
1873 if( orientation == ECamOrientationCamcorder || |
|
1874 orientation == ECamOrientationCamcorderLeft || |
|
1875 orientation == ECamOrientationPortrait ) |
|
1876 { |
|
1877 // In case of MSK if no AP on screen, it should work as capture |
|
1878 // If optical joystic is not available, we will start the |
|
1879 // capturing with auto-focusing here. Otherwise it is handled |
|
1880 // in CCamStillPreCaptureContainer |
|
1881 if ( appUi && !appUi->IsToolBarVisible() |
|
1882 && iController.UiConfigManagerPtr() |
|
1883 && !iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) |
|
1884 { |
|
1885 OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTUREVIEW_STARTMSKCAPTUREL, "e_CAM_PRI_AF_LOCK 1" ); |
|
1886 if ( iController.IsViewFinding() && appUi->CheckMemoryL() && |
|
1887 !iController.CaptureModeTransitionInProgress() ) |
|
1888 { |
|
1889 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); |
|
1890 |
|
1891 // fixed toolbar is used only with touch devices |
|
1892 if ( iController.IsTouchScreenSupported() ) |
|
1893 { |
|
1894 CAknToolbar* fixedToolbar = Toolbar(); |
|
1895 if ( fixedToolbar ) |
|
1896 { |
|
1897 fixedToolbar->SetToolbarVisibility( EFalse ); |
|
1898 } |
|
1899 } |
|
1900 // Start the autofocus operation now, the capture will be queued |
|
1901 // after focus completes |
|
1902 if ( !appUi->SelfTimerEnabled() ) |
|
1903 { |
|
1904 OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_STARTMSKCAPTUREL, "e_CAM_APP_AF 1" ); |
|
1905 iController.StartAutoFocus(); |
|
1906 } |
|
1907 |
|
1908 TKeyEvent keyEvent; |
|
1909 appUi->StartCaptureL( keyEvent ); |
|
1910 startedCapture = ETrue; |
|
1911 } |
|
1912 } |
|
1913 // else let the calling function take care of capturing |
|
1914 } |
|
1915 PRINT( _L("Camera <= CCamStillPreCaptureView::StartMskCapture") ); |
|
1916 return startedCapture; |
|
1917 } |
|
1918 |
|
1919 // --------------------------------------------------------------------------- |
|
1920 // CCamStillPreCaptureView::UpdateSelfTimerIconsL |
|
1921 // --------------------------------------------------------------------------- |
|
1922 // |
|
1923 void CCamStillPreCaptureView::UpdateSelfTimerIconsL() |
|
1924 { |
|
1925 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSelfTimer ); |
|
1926 if ( button ) |
|
1927 { |
|
1928 TCamSelfTimerId selftimer = static_cast< TCamSelfTimerId > |
|
1929 ( iController.IntegerSettingValue( ECamSettingItemDynamicSelfTimer ) ); |
|
1930 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1931 TFileName iconFileName; |
|
1932 CamUtility::ResourceFileName( iconFileName ); |
|
1933 switch ( selftimer ) |
|
1934 { |
|
1935 case ECamSelfTimerOff: |
|
1936 { |
|
1937 SetIconL( |
|
1938 button, |
|
1939 iconFileName, |
|
1940 EMbmCameraappQgn_indi_cam4_selftimer_off, |
|
1941 EMbmCameraappQgn_indi_cam4_selftimer_off_mask, |
|
1942 skinInstance, |
|
1943 KAknsIIDQgnIndiCam4SelftimerOff ); |
|
1944 break; |
|
1945 } |
|
1946 case ECamSelfTimer2: |
|
1947 { |
|
1948 SetIconL( |
|
1949 button, |
|
1950 iconFileName, |
|
1951 EMbmCameraappQgn_indi_cam4_selftimer_2sec, |
|
1952 EMbmCameraappQgn_indi_cam4_selftimer_2sec_mask, |
|
1953 skinInstance, |
|
1954 KAknsIIDQgnIndiCam4Selftimer2sec ); |
|
1955 break; |
|
1956 } |
|
1957 case ECamSelfTimer10: |
|
1958 { |
|
1959 SetIconL( |
|
1960 button, |
|
1961 iconFileName, |
|
1962 EMbmCameraappQgn_indi_cam4_selftimer_10s, |
|
1963 EMbmCameraappQgn_indi_cam4_selftimer_10s_mask, |
|
1964 skinInstance, |
|
1965 KAknsIIDQgnIndiCam4Selftimer10s ); |
|
1966 break; |
|
1967 } |
|
1968 case ECamSelfTimer20: |
|
1969 { |
|
1970 SetIconL( |
|
1971 button, |
|
1972 iconFileName, |
|
1973 EMbmCameraappQgn_indi_cam4_selftimer_20s, |
|
1974 EMbmCameraappQgn_indi_cam4_selftimer_20s_mask, |
|
1975 skinInstance, |
|
1976 KAknsIIDQgnIndiCam4Selftimer20s ); |
|
1977 break; |
|
1978 } |
|
1979 default: |
|
1980 break; |
|
1981 } |
|
1982 } |
|
1983 |
|
1984 } |
|
1985 |
|
1986 // --------------------------------------------------------------------------- |
|
1987 // CCamStillPreCaptureView::UpdateSceneModeIconsL |
|
1988 // --------------------------------------------------------------------------- |
|
1989 // |
|
1990 void CCamStillPreCaptureView::UpdateSceneModeIconsL() |
|
1991 { |
|
1992 CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSceneStill ); |
|
1993 |
|
1994 if ( button ) |
|
1995 { |
|
1996 TCamSceneId scene = static_cast< TCamSceneId > ( |
|
1997 iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); |
|
1998 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
1999 TFileName iconFileName; |
|
2000 CamUtility::ResourceFileName( iconFileName ); |
|
2001 |
|
2002 // For use with scene indicator |
|
2003 TInt32 iconId = EMbmCameraappQgn_indi_cam4_mode_auto; |
|
2004 TInt32 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask; |
|
2005 |
|
2006 switch ( scene ) |
|
2007 { |
|
2008 case ECamSceneAuto: |
|
2009 { |
|
2010 SetIconL( |
|
2011 button, |
|
2012 iconFileName, |
|
2013 EMbmCameraappQgn_indi_cam4_mode_auto, |
|
2014 EMbmCameraappQgn_indi_cam4_mode_auto_mask, |
|
2015 skinInstance, |
|
2016 KAknsIIDQgnIndiCam4ModeAuto ); |
|
2017 iconId = EMbmCameraappQgn_indi_cam4_mode_auto; |
|
2018 maskId = EMbmCameraappQgn_indi_cam4_mode_auto_mask; |
|
2019 break; |
|
2020 } |
|
2021 case ECamSceneUser: |
|
2022 { |
|
2023 SetIconL( |
|
2024 button, |
|
2025 iconFileName, |
|
2026 EMbmCameraappQgn_indi_cam4_mode_userscene, |
|
2027 EMbmCameraappQgn_indi_cam4_mode_userscene_mask, |
|
2028 skinInstance, |
|
2029 KAknsIIDQgnIndiCam4ModeUserscene ); |
|
2030 iconId = EMbmCameraappQgn_indi_cam4_mode_userscene; |
|
2031 maskId = EMbmCameraappQgn_indi_cam4_mode_userscene_mask; |
|
2032 break; |
|
2033 } |
|
2034 case ECamSceneMacro: |
|
2035 { |
|
2036 SetIconL( |
|
2037 button, |
|
2038 iconFileName, |
|
2039 EMbmCameraappQgn_indi_cam4_mode_closeup, |
|
2040 EMbmCameraappQgn_indi_cam4_mode_closeup_mask, |
|
2041 skinInstance, |
|
2042 KAknsIIDQgnIndiCam4ModeCloseup ); |
|
2043 iconId = EMbmCameraappQgn_indi_cam4_mode_closeup; |
|
2044 maskId = EMbmCameraappQgn_indi_cam4_mode_closeup_mask; |
|
2045 break; |
|
2046 } |
|
2047 case ECamScenePortrait: |
|
2048 { |
|
2049 SetIconL( |
|
2050 button, |
|
2051 iconFileName, |
|
2052 EMbmCameraappQgn_indi_cam4_mode_portrait, |
|
2053 EMbmCameraappQgn_indi_cam4_mode_portrait_mask, |
|
2054 skinInstance, |
|
2055 KAknsIIDQgnIndiCam4ModePortrait ); |
|
2056 iconId = EMbmCameraappQgn_indi_cam4_mode_portrait; |
|
2057 maskId = EMbmCameraappQgn_indi_cam4_mode_portrait_mask; |
|
2058 break; |
|
2059 } |
|
2060 case ECamSceneScenery: |
|
2061 { |
|
2062 SetIconL( |
|
2063 button, |
|
2064 iconFileName, |
|
2065 EMbmCameraappQgn_indi_cam4_mode_landscape, |
|
2066 EMbmCameraappQgn_indi_cam4_mode_landscape_mask, |
|
2067 skinInstance, |
|
2068 KAknsIIDQgnIndiCam4ModeLandscape ); |
|
2069 iconId = EMbmCameraappQgn_indi_cam4_mode_landscape; |
|
2070 maskId = EMbmCameraappQgn_indi_cam4_mode_landscape_mask; |
|
2071 break; |
|
2072 } |
|
2073 case ECamSceneNight: |
|
2074 { |
|
2075 SetIconL( |
|
2076 button, |
|
2077 iconFileName, |
|
2078 EMbmCameraappQgn_indi_cam4_mode_night, |
|
2079 EMbmCameraappQgn_indi_cam4_mode_night_mask, |
|
2080 skinInstance, |
|
2081 KAknsIIDQgnIndiCam4ModeNight ); |
|
2082 iconId = EMbmCameraappQgn_indi_cam4_mode_night; |
|
2083 maskId = EMbmCameraappQgn_indi_cam4_mode_night_mask; |
|
2084 break; |
|
2085 } |
|
2086 case ECamSceneSports: |
|
2087 { |
|
2088 SetIconL( |
|
2089 button, |
|
2090 iconFileName, |
|
2091 EMbmCameraappQgn_indi_cam4_mode_sport, |
|
2092 EMbmCameraappQgn_indi_cam4_mode_sport_mask, |
|
2093 skinInstance, |
|
2094 KAknsIIDQgnIndiCam4ModeSport ); |
|
2095 iconId = EMbmCameraappQgn_indi_cam4_mode_sport; |
|
2096 maskId = EMbmCameraappQgn_indi_cam4_mode_sport_mask; |
|
2097 break; |
|
2098 } |
|
2099 case ECamSceneNightScenery: |
|
2100 case ECamSceneNightPortrait: |
|
2101 { |
|
2102 SetIconL( |
|
2103 button, |
|
2104 iconFileName, |
|
2105 EMbmCameraappQgn_indi_cam4_mode_portrait_night, |
|
2106 EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask, |
|
2107 skinInstance, |
|
2108 KAknsIIDQgnIndiCam4ModePortraitNight ); |
|
2109 iconId = EMbmCameraappQgn_indi_cam4_mode_portrait_night; |
|
2110 maskId = EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask; |
|
2111 break; |
|
2112 } |
|
2113 case ECamSceneCandlelight: |
|
2114 default: |
|
2115 break; |
|
2116 } |
|
2117 |
|
2118 // Update the icon in the side pane |
|
2119 if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() ) |
|
2120 { |
|
2121 CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() ); |
|
2122 CCamSidePane* sidePane = appUi->SidePane(); |
|
2123 |
|
2124 if ( sidePane ) |
|
2125 { |
|
2126 PRINT( _L("Camera <> CCamStillPreCaptureView::UpdateSceneModeIconsL - Updating side pane indicator") ); |
|
2127 sidePane->UpdateSceneIndicatorL( iconId, maskId ); |
|
2128 } |
|
2129 } |
|
2130 } |
|
2131 } |
|
2132 |
|
2133 // --------------------------------------------------------------------------- |
|
2134 // CCamStillPreCaptureView::UpdateVFGridIconsL |
|
2135 // --------------------------------------------------------------------------- |
|
2136 // |
|
2137 void CCamStillPreCaptureView::UpdateVFGridIconsL() |
|
2138 { |
|
2139 CAknButton* button = ToolbarButtonById( ECamCmdViewfinderGrid ); |
|
2140 if ( button ) |
|
2141 { |
|
2142 CAknButtonState* state = button->State(); |
|
2143 if ( state ) |
|
2144 { |
|
2145 TInt grid = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid ); |
|
2146 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
2147 TFileName iconFileName; |
|
2148 CamUtility::ResourceFileName( iconFileName ); |
|
2149 |
|
2150 if ( grid == ECamViewfinderGridOff ) |
|
2151 { |
|
2152 SetIconL( |
|
2153 button, |
|
2154 iconFileName, |
|
2155 EMbmCameraappQgn_indi_cam4_viewfinder_off, |
|
2156 EMbmCameraappQgn_indi_cam4_viewfinder_off_mask, |
|
2157 skinInstance, |
|
2158 KAknsIIDQgnIndiCam4ViewfinderOff ); |
|
2159 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_GRID ); |
|
2160 state->SetTextL( *buttonText ); |
|
2161 CleanupStack::PopAndDestroy( buttonText ); |
|
2162 } |
|
2163 else |
|
2164 { |
|
2165 SetIconL( |
|
2166 button, |
|
2167 iconFileName, |
|
2168 EMbmCameraappQgn_indi_cam4_viewfinder_on, |
|
2169 EMbmCameraappQgn_indi_cam4_viewfinder_on_mask, |
|
2170 skinInstance, |
|
2171 KAknsIIDQgnIndiCam4ViewfinderOn ); |
|
2172 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_GRID ); |
|
2173 state->SetTextL( *buttonText ); |
|
2174 CleanupStack::PopAndDestroy( buttonText ); |
|
2175 } |
|
2176 } |
|
2177 } |
|
2178 |
|
2179 } |
|
2180 |
|
2181 // --------------------------------------------------------------------------- |
|
2182 // CCamStillPreCaptureView::UpdateVFGridIconsL |
|
2183 // --------------------------------------------------------------------------- |
|
2184 // |
|
2185 void CCamStillPreCaptureView::UpdateBurstModeIconsL() |
|
2186 { |
|
2187 if (!iController.UiConfigManagerPtr()->IsBurstModeSupported()) |
|
2188 { |
|
2189 HideButton( ECamCmdTimeLapseSlider ); |
|
2190 return; |
|
2191 } |
|
2192 CAknButton* button = ToolbarButtonById( ECamCmdTimeLapseSlider ); |
|
2193 if ( button ) |
|
2194 { |
|
2195 CAknButtonState* state = button->State(); |
|
2196 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
2197 TFileName iconFileName; |
|
2198 CamUtility::ResourceFileName( iconFileName ); |
|
2199 if ( state ) |
|
2200 { |
|
2201 TCamImageCaptureMode captureMode = iController.CurrentImageModeSetup(); |
|
2202 if ( captureMode == ECamImageCaptureSingle ) |
|
2203 { |
|
2204 SetIconL( |
|
2205 button, |
|
2206 iconFileName, |
|
2207 EMbmCameraappQgn_indi_cam4_sequence_burst, |
|
2208 EMbmCameraappQgn_indi_cam4_sequence_burst_mask, |
|
2209 skinInstance, |
|
2210 KAknsIIDQgnIndiCam4Sequence ); |
|
2211 |
|
2212 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_SEQUENCE ); |
|
2213 state->SetTextL( *buttonText ); |
|
2214 CleanupStack::PopAndDestroy( buttonText ); |
|
2215 } |
|
2216 else if ( captureMode == ECamImageCaptureBurst ) |
|
2217 { |
|
2218 SetIconL( |
|
2219 button, |
|
2220 iconFileName, |
|
2221 EMbmCameraappQgn_indi_cam4_sequence, |
|
2222 EMbmCameraappQgn_indi_cam4_sequence, |
|
2223 skinInstance, |
|
2224 KAknsIIDQgnIndiCam4SequenceBurst ); |
|
2225 |
|
2226 HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_TURN_SEQUENCE_OFF ); |
|
2227 state->SetTextL( *buttonText ); |
|
2228 CleanupStack::PopAndDestroy( buttonText ); |
|
2229 |
|
2230 } |
|
2231 else |
|
2232 { |
|
2233 // pass |
|
2234 } |
|
2235 } |
|
2236 } |
|
2237 } |
|
2238 |
|
2239 // --------------------------------------------------------------------------- |
|
2240 // CCamStillPreCaptureView::UpdateFaceTrackingIconsL |
|
2241 // --------------------------------------------------------------------------- |
|
2242 // |
|
2243 void CCamStillPreCaptureView::UpdateFaceTrackingIconsL() |
|
2244 { |
|
2245 CAknButton* button = ToolbarButtonById( ECamCmdToggleFacetracking ); |
|
2246 |
|
2247 if ( button ) |
|
2248 { |
|
2249 CAknButtonState* state = button->State(); |
|
2250 if ( state ) |
|
2251 { |
|
2252 TInt face = iController.IntegerSettingValue( |
|
2253 ECamSettingItemFaceTracking ); |
|
2254 |
|
2255 MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); |
|
2256 TFileName iconFileName; |
|
2257 CamUtility::ResourceFileName( iconFileName ); |
|
2258 if ( face == ECamSettOff ) |
|
2259 { |
|
2260 PRINT( _L( "Camera => UpdateFaceTrackingIconL off" ) ); |
|
2261 SetIconL ( |
|
2262 button, |
|
2263 iconFileName, |
|
2264 EMbmCameraappQgn_indi_cam4_tb_facedet_off, |
|
2265 EMbmCameraappQgn_indi_cam4_tb_facedet_off_mask, |
|
2266 skinInstance, |
|
2267 KAknsIIDQgnIndiCam4TbFacedetOff ); |
|
2268 } |
|
2269 else |
|
2270 { |
|
2271 PRINT( _L( "Camera => UpdateFaceTrackingIconL on" ) ); |
|
2272 SetIconL ( |
|
2273 button, |
|
2274 iconFileName, |
|
2275 EMbmCameraappQgn_indi_cam4_tb_facedet, |
|
2276 EMbmCameraappQgn_indi_cam4_tb_facedet_mask, |
|
2277 skinInstance, |
|
2278 KAknsIIDQgnIndiCam4TbFacedet ); |
|
2279 } |
|
2280 } |
|
2281 } |
|
2282 // Update the status indicator too. |
|
2283 iController.NotifyControllerObservers( ECamEventFaceTrackingStateChanged ); |
|
2284 } |
|
2285 |
|
2286 // End of File |
|