author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:09:54 +0300 | |
branch | RCL_3 |
changeset 67 | 756ad29ed18e |
parent 54 | bac7acad7cb3 |
permissions | -rw-r--r-- |
54 | 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: Controls the switching between different control modes* |
|
15 |
*/ |
|
16 |
||
17 |
||
18 |
// INCLUDE FILES |
|
19 |
#include "CamUserSceneSetupViewBase.h" |
|
20 |
#include "CamAppUiBase.h" |
|
21 |
#include "CamAppUi.h" |
|
22 |
#include "CamPanic.h" |
|
23 |
#include "CamUserSceneSetupContainer.h" |
|
24 |
#include "Cam.hrh" |
|
25 |
||
26 |
#include "CamPreCaptureContainerBase.h" |
|
27 |
||
28 |
#include <eiksoftkeypostingtransparency.h> |
|
29 |
#include <eikbtgpc.h> |
|
30 |
#include <avkon.rsg> |
|
31 |
#include <StringLoader.h> |
|
32 |
#include <AknQueryDialog.h> |
|
33 |
#include <cameraapp.rsg> |
|
34 |
#include <vgacamsettings.rsg> |
|
35 |
||
36 |
#include "CamUtility.h" |
|
37 |
||
38 |
// ================= MEMBER FUNCTIONS ======================= |
|
39 |
// --------------------------------------------------------------------------- |
|
40 |
// CCamUserSceneSetupViewBase::~CCamUserSceneSetupViewBase |
|
41 |
// Destructor |
|
42 |
// --------------------------------------------------------------------------- |
|
43 |
// |
|
44 |
CCamUserSceneSetupViewBase::~CCamUserSceneSetupViewBase() |
|
45 |
{ |
|
46 |
PRINT( _L("Camera => ~CCamUserSceneSetupViewBase" )) |
|
47 |
delete iContainer; |
|
48 |
iContainer = NULL; |
|
49 |
PRINT( _L("Camera <= ~CCamUserSceneSetupViewBase" )) |
|
50 |
} |
|
51 |
||
52 |
// --------------------------------------------------------------------------- |
|
53 |
// CCamUserSceneSetupViewBase::HandleCommandL |
|
54 |
// From CAknView Handle commands |
|
55 |
// --------------------------------------------------------------------------- |
|
56 |
// |
|
57 |
void CCamUserSceneSetupViewBase::HandleCommandL( TInt aCommand ) |
|
58 |
{ |
|
59 |
PRINT1( _L("Camera => CCamUserSceneSetupViewBase::HandleCommandL %d"), aCommand ); |
|
60 |
switch ( aCommand ) |
|
61 |
{ |
|
62 |
case ECamMSKCmdAppChange: |
|
63 |
{ |
|
64 |
||
65 |
if ( IsOnlyUserSceneSetupModeActive() ) |
|
66 |
{ |
|
67 |
CCamUserSceneSetupContainer* userSceneSetup = |
|
68 |
static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
69 |
userSceneSetup->HandleSelectionL(); |
|
70 |
} |
|
71 |
else |
|
72 |
{ |
|
73 |
CCamCaptureSetupViewBase::HandleCommandL( ECamCmdSelect ); |
|
74 |
||
75 |
// Update the User Scene Setup with all the new values. |
|
76 |
CCamUserSceneSetupContainer* userSceneSetup = |
|
77 |
static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
78 |
userSceneSetup->UpdateListItems(); |
|
79 |
} |
|
80 |
break; |
|
81 |
} |
|
82 |
// Handle the user scene scene list navi-key select selection |
|
83 |
case EAknSoftkeySelect: |
|
84 |
{ |
|
85 |
CCamCaptureSetupViewBase::HandleCommandL( aCommand ); |
|
86 |
// Update the User Scene Setup with all the new values. |
|
87 |
CCamUserSceneSetupContainer* userSceneSetup = |
|
88 |
static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
89 |
userSceneSetup->UpdateListItems(); |
|
90 |
break; |
|
91 |
} |
|
92 |
case ECamCmdSetUserDefault: |
|
93 |
{ |
|
94 |
TInt currentVal = iController.IntegerSettingValue( ECamSettingItemUserSceneDefault ); |
|
95 |
if ( currentVal ) |
|
96 |
{ |
|
97 |
currentVal = ECamSettNo; |
|
98 |
} |
|
99 |
else |
|
100 |
{ |
|
101 |
currentVal = ECamSettYes; |
|
102 |
} |
|
103 |
TRAP_IGNORE( iController.SetIntegerSettingValueL( ECamSettingItemUserSceneDefault, currentVal) ); |
|
104 |
CCamUserSceneSetupContainer* userSceneSetup = static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
105 |
userSceneSetup->UpdateListItems(); |
|
106 |
userSceneSetup->UpdateDisplayL(); |
|
107 |
} |
|
108 |
break; |
|
109 |
case ECamCmdUserSceneReset: |
|
110 |
{ |
|
111 |
DisplayResetUserSceneDlgL(); |
|
112 |
} |
|
113 |
break; |
|
114 |
case ECamCmdCaptureSetupWhiteBalanceUser: // fallthrough |
|
115 |
case ECamCmdCaptureSetupColourFilterUser: |
|
116 |
case ECamCmdCaptureSetupExposureUser: |
|
117 |
case ECamCmdCaptureSetupFlashUser: |
|
118 |
case ECamCmdCaptureSetupBrightnessUser: |
|
119 |
case ECamCmdCaptureSetupContrastUser: |
|
120 |
case ECamCmdCaptureSetupImageSharpnessUser: |
|
121 |
// case ECamCmdCaptureSetupLightSensitivityUser: |
|
122 |
{ |
|
123 |
SwitchToCaptureSetupModeL( aCommand ); |
|
124 |
} |
|
125 |
break; |
|
126 |
case ECamCmdCaptureSetupSceneUser: |
|
127 |
{ |
|
128 |
StatusPane()->MakeVisible( EFalse ); |
|
129 |
SwitchToSceneSettingModeL(); |
|
130 |
} |
|
131 |
break; |
|
132 |
case ECamCmdCaptureSetupLightSensitivityUser: |
|
133 |
{ |
|
134 |
SwitchToInfoListBoxL( EInfoListBoxModeISO, EFalse );//No skin |
|
135 |
} |
|
136 |
break; |
|
137 |
// If capture setup menu is active and user presses softkey cancel, |
|
138 |
// deactivate the menu. |
|
139 |
case EAknSoftkeyBack: |
|
140 |
{ |
|
141 |
||
142 |
if ( IsOnlyUserSceneSetupModeActive() ) |
|
143 |
{ |
|
144 |
ExitUserSceneSetupModeL(); |
|
145 |
} |
|
146 |
else |
|
147 |
{ |
|
148 |
CCamCaptureSetupViewBase::HandleCommandL( aCommand ); |
|
149 |
||
150 |
} |
|
151 |
} |
|
152 |
break; |
|
153 |
||
154 |
case EAknSoftkeyOptions: |
|
155 |
{ |
|
156 |
// do nothing, the command is handled by the framework |
|
157 |
} |
|
158 |
break; |
|
159 |
||
160 |
case ECamCmdExitStandby: |
|
161 |
{ |
|
162 |
CCamViewBase::ExitStandbyModeL(); |
|
163 |
break; |
|
164 |
} |
|
165 |
case ECamCmdInternalExit: |
|
166 |
{ |
|
167 |
PRINT( _L("Camera CCamUserSceneSetupViewBase::HandleCommandL ECamCmdInternalExit") ); |
|
168 |
||
169 |
CCamCaptureSetupViewBase* preCaptureView = |
|
170 |
static_cast<CCamCaptureSetupViewBase*>( AppUi()->View( TUid::Uid( ECamViewIdStillPreCapture ) ) ); |
|
171 |
// reset scene setting flag so that precapture view returns to normal mode in next startup |
|
172 |
// Note: this is NOT the proper way to reset precapture view to normal state but seems |
|
173 |
// to be the only way that works here. None of the Exit.. or SwitchTo... functions work |
|
174 |
// here because precapture view is not the active view. |
|
175 |
if ( preCaptureView ) |
|
176 |
{ |
|
177 |
preCaptureView->SetSceneSettingMode( EFalse ); |
|
178 |
if ( iController.IsTouchScreenSupported() ) |
|
179 |
{ |
|
180 |
// re-create the toolbar because it's gone for some reason |
|
181 |
preCaptureView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR ); |
|
182 |
} |
|
183 |
} |
|
184 |
CCamCaptureSetupViewBase::HandleCommandL( ECamCmdInternalExit ); |
|
185 |
||
186 |
||
187 |
PRINT( _L("Camera CCamUserSceneSetupViewBase::HandleCommandL ECamCmdInternalExit OK") ); |
|
188 |
break; |
|
189 |
} |
|
190 |
case EAknSoftkeyCancel: |
|
191 |
{ |
|
192 |
PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL EAknSoftkeyCancel iCancelRequest=%d" ),iCancelRequest); |
|
193 |
if( ! iCancelRequest ) // EFalse |
|
194 |
{ |
|
195 |
if( !iController.IsViewFinding( ) && iVFRequested ) |
|
196 |
{ |
|
197 |
PRINT( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL viewfinder inactive" )); |
|
198 |
||
199 |
//viewfinder is not active then set to ETrue ... |
|
200 |
//and wait until controller is ready. |
|
201 |
iCancelRequest=ETrue; |
|
202 |
} |
|
203 |
else |
|
204 |
{ |
|
205 |
CCamCaptureSetupViewBase::HandleCommandL( aCommand ); |
|
206 |
} |
|
207 |
} |
|
208 |
break; |
|
209 |
} |
|
210 |
||
211 |
case EAknSoftkeyOk: |
|
212 |
{ |
|
213 |
PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL EAknSoftkeyOk iOkRequest=%d" ),iOkRequest); |
|
214 |
if( ! iOkRequest ) // EFalse |
|
215 |
{ |
|
216 |
if( !iController.IsViewFinding( ) && iVFRequested ) |
|
217 |
{ |
|
218 |
PRINT( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL viewfinder inactive" )); |
|
219 |
||
220 |
//viewfinder is not active then set to ETrue ... |
|
221 |
//and wait until controller is ready. |
|
222 |
iOkRequest=ETrue; |
|
223 |
} |
|
224 |
else |
|
225 |
{ |
|
226 |
CCamCaptureSetupViewBase::HandleCommandL( aCommand ); |
|
227 |
} |
|
228 |
} |
|
229 |
break; |
|
230 |
} |
|
231 |
default: |
|
232 |
CCamCaptureSetupViewBase::HandleCommandL( aCommand ); |
|
233 |
||
234 |
} |
|
235 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::HandleCommandL ") ); |
|
236 |
} |
|
237 |
||
238 |
||
239 |
// ----------------------------------------------------------------------------- |
|
240 |
// CCamUserSceneSetupViewBase::HandleForegroundEventL |
|
241 |
// Handle foreground event |
|
242 |
// ----------------------------------------------------------------------------- |
|
243 |
// |
|
244 |
void CCamUserSceneSetupViewBase::HandleForegroundEventL( TBool aForeground ) |
|
245 |
{ |
|
246 |
PRINT1( _L("Camera => CCamUserSceneSetupViewBase::HandleForegroundEventL %d"), aForeground ); |
|
247 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() ); |
|
248 |
if ( aForeground ) |
|
249 |
{ |
|
250 |
// if foreground event is received while in videocall, go to standby with error |
|
251 |
if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) |
|
252 |
{ |
|
253 |
ExitAllModesL(); |
|
254 |
appUi->SetStandbyStatus( KErrInUse ); |
|
255 |
appUi->HandleCommandL( ECamCmdGoToStandby ); |
|
256 |
return; |
|
257 |
} |
|
258 |
else if ( !appUi->IsInPretendExit() && !iNotifierPopupShowing ) |
|
259 |
{ |
|
260 |
// Register that we want to use the engine |
|
261 |
IncrementCameraUsers(); |
|
262 |
iController.StartIdleTimer(); |
|
263 |
||
264 |
// copied from still precapture handleforegroundevent implementations |
|
265 |
iController.IsProfileSilent(); |
|
266 |
UpdateCbaL(); |
|
267 |
||
268 |
||
269 |
// start viewfinder unless the is activating to standby or scene settings |
|
270 |
// SwitchToInfoListBoxL( EInfoListBoxModeISO, EFalse ) where FullySkinned is EFalse, it |
|
271 |
// indicate VF need to start in case of iInfoListBoxActive |
|
272 |
if ( !iStandbyModeActive && !iSceneSettingModeActive && |
|
273 |
!iUserSceneSetupModeActive ) |
|
274 |
{ |
|
275 |
iVFRequested=ETrue; |
|
276 |
StartViewFinder(); |
|
277 |
} |
|
278 |
||
279 |
} |
|
280 |
else |
|
281 |
{ |
|
282 |
// The view can get a foreground event while the application is |
|
283 |
// actually in a pretend exit situation. This occurs when the view switch |
|
284 |
// was called before the exit event, but didn't complete until after the |
|
285 |
// exit event. In this case the view should not register an interest in |
|
286 |
// the engine as the application is really in the background and the resources |
|
287 |
// need to be released |
|
288 |
} |
|
289 |
} |
|
290 |
// To background |
|
291 |
else if( !aForeground ) |
|
292 |
{ |
|
67
756ad29ed18e
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
54
diff
changeset
|
293 |
iNotifierPopupShowing = appUi->AppInBackground( ETrue ); |
54 | 294 |
PRINT( _L("Camera <> CCamUserSceneSetupViewBase::HandleForegroundEventL dec engine count") ); |
295 |
// Register that we nolonger need the engine |
|
296 |
if( !iNotifierPopupShowing ) |
|
297 |
DecrementCameraUsers(); |
|
298 |
} |
|
299 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::HandleForegroundEventL ") ); |
|
300 |
} |
|
301 |
||
302 |
||
303 |
// --------------------------------------------------------------------------- |
|
304 |
// CCamUserSceneSetupViewBase::DoActivateL |
|
305 |
// From CAknView activate the view |
|
306 |
// --------------------------------------------------------------------------- |
|
307 |
// |
|
308 |
void CCamUserSceneSetupViewBase::DoActivateL( const TVwsViewId& aPrevViewId, |
|
309 |
TUid aCustomMessageId, const TDesC8& aCustomMessage ) |
|
310 |
{ |
|
311 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::DoActivateL") ); |
|
312 |
iCancelRequest=EFalse; |
|
313 |
iOkRequest=EFalse; |
|
314 |
iVFRequested=EFalse; |
|
315 |
||
316 |
StatusPane()->MakeVisible( ETrue ); |
|
317 |
||
318 |
CCamViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
|
319 |
SwitchToUserSceneSetupModeL(); |
|
320 |
||
321 |
// Need to monitor the controller for standby events |
|
322 |
iController.AddControllerObserverL( this ); |
|
323 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::DoActivateL") ); |
|
324 |
} |
|
325 |
||
326 |
// --------------------------------------------------------------------------- |
|
327 |
// CCamUserSceneSetupViewBase::DoDeactivate |
|
328 |
// From CAknView deactivates the view |
|
329 |
// --------------------------------------------------------------------------- |
|
330 |
// |
|
331 |
void CCamUserSceneSetupViewBase::DoDeactivate() |
|
332 |
{ |
|
333 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::DoDeactivateL") ); |
|
334 |
CCamViewBase::DoDeactivate(); |
|
335 |
||
336 |
iController.RemoveControllerObserver( this ); |
|
337 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::DoDeactivateL") ); |
|
338 |
} |
|
339 |
||
340 |
// ----------------------------------------------------------------------------- |
|
341 |
// CCamUserSceneSetupViewBase::HandleControllerEventL |
|
342 |
// Handle controller events |
|
343 |
// ----------------------------------------------------------------------------- |
|
344 |
// |
|
345 |
void |
|
346 |
CCamUserSceneSetupViewBase |
|
347 |
::HandleControllerEventL( TCamControllerEvent aEvent, |
|
348 |
TInt /*aError*/ ) |
|
349 |
{ |
|
350 |
PRINT( _L( "Camera => CCamUserSceneSetupViewBase::HandleControllerEventL" ) ); |
|
351 |
||
352 |
switch( aEvent ) |
|
353 |
{ |
|
354 |
/* |
|
355 |
// --------------------------------- |
|
356 |
case ECamEventOperationStateChanged: |
|
357 |
{ |
|
358 |
switch ( iController.CurrentOperation() ) |
|
359 |
{ |
|
360 |
// Standby event |
|
361 |
case ECamStandby: |
|
362 |
{ |
|
363 |
ExitAllModesL(); |
|
364 |
// Get the UI to move to standby in the appropriate |
|
365 |
// pre capture view |
|
366 |
AppUi()->HandleCommandL( ECamCmdGoToStandby ); |
|
367 |
break; |
|
368 |
} |
|
369 |
default: |
|
370 |
{ |
|
371 |
break; |
|
372 |
} |
|
373 |
} |
|
374 |
break; |
|
375 |
} |
|
376 |
*/ |
|
377 |
// --------------------------------- |
|
378 |
case ECamEventControllerReady: |
|
379 |
{ |
|
380 |
PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleControllerEventL ECamEventControllerReady iCancelRequest=%d" ),iCancelRequest); |
|
381 |
PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleControllerEventL ECamEventControllerReady iOkRequest=%d" ),iOkRequest); |
|
382 |
iVFRequested=EFalse; |
|
383 |
||
384 |
if( iCancelRequest ) |
|
385 |
{ |
|
386 |
//CAncel has been requested and Cameraengine is now ready to |
|
387 |
//switch view and continue cancel. |
|
388 |
iCancelRequest=EFalse; |
|
389 |
TRAP_IGNORE( HandleCommandL( EAknSoftkeyCancel ) ); |
|
390 |
} |
|
391 |
else if( iOkRequest ) |
|
392 |
{ |
|
393 |
//Ok has been requested and Cameraengine is now ready to |
|
394 |
//switch view and continue with Ok. |
|
395 |
iOkRequest=EFalse; |
|
396 |
TRAP_IGNORE( HandleCommandL( EAknSoftkeyOk ) ); |
|
397 |
} |
|
398 |
||
399 |
break; |
|
400 |
} |
|
401 |
default: |
|
402 |
break; |
|
403 |
// --------------------------------- |
|
404 |
} |
|
405 |
PRINT( _L( "Camera <= CCamUserSceneSetupViewBase::HandleControllerEventL") ); |
|
406 |
} |
|
407 |
||
408 |
||
409 |
// --------------------------------------------------------------------------- |
|
410 |
// CCamUserSceneSetupViewBase::CCamUserSceneSetupViewBase |
|
411 |
// C++ Constructor |
|
412 |
// --------------------------------------------------------------------------- |
|
413 |
// |
|
414 |
CCamUserSceneSetupViewBase::CCamUserSceneSetupViewBase |
|
415 |
( CCamAppController& aController ) |
|
416 |
: CCamCaptureSetupViewBase( aController ) |
|
417 |
{ |
|
418 |
} |
|
419 |
||
420 |
// --------------------------------------------------------------------------- |
|
421 |
// CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL |
|
422 |
// Exits the user scene setup mode |
|
423 |
// --------------------------------------------------------------------------- |
|
424 |
// |
|
425 |
void CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL() |
|
426 |
{ |
|
427 |
iUserSceneSetupModeActive = EFalse; |
|
428 |
iContainer->MakeVisible( ETrue ); |
|
429 |
||
430 |
AppUi()->RemoveFromStack( iContainer ); |
|
431 |
} |
|
432 |
||
433 |
// --------------------------------------------------------------------------- |
|
434 |
// CCamUserSceneSetupViewBase::UpdateCbaL |
|
435 |
// Updates the command button array for this view |
|
436 |
// --------------------------------------------------------------------------- |
|
437 |
// |
|
438 |
void CCamUserSceneSetupViewBase::UpdateCbaL() |
|
439 |
{ |
|
440 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::UpdateCbaL()") ); |
|
441 |
// if videocall is active, set the softkeys already here |
|
442 |
if ( iController.InVideocallOrRinging() ) |
|
443 |
{ |
|
444 |
SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); |
|
445 |
} |
|
446 |
// if the view is in capture setup mode |
|
447 |
else if ( iCaptureSetupModeActive ) |
|
448 |
{ |
|
449 |
if( iForceAvkonCBA ) |
|
450 |
{ |
|
451 |
SetSoftKeysL( R_AVKON_SOFTKEYS_OK_CANCEL__OK ); //Avkon softkeys. Not transparent |
|
452 |
} |
|
453 |
else |
|
454 |
{ |
|
455 |
SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT );//color etc. |
|
456 |
} |
|
457 |
} |
|
458 |
else if ( iSceneSettingModeActive ) |
|
459 |
{ |
|
460 |
SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); |
|
461 |
if( iForceAvkonCBA ) |
|
462 |
{ |
|
463 |
EikSoftkeyPostingTransparency::MakeTransparent( |
|
464 |
*ViewCba(), EFalse ); |
|
465 |
} |
|
466 |
} |
|
467 |
else if ( iInfoListBoxActive ) |
|
468 |
{ |
|
469 |
SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE_TRANSPARENT ); |
|
470 |
EikSoftkeyPostingTransparency::MakeTransparent( |
|
471 |
*ViewCba(), !iForceAvkonCBA ); |
|
472 |
} |
|
473 |
// if the view is user scene setup |
|
474 |
else |
|
475 |
{ |
|
476 |
SetSoftKeysL( R_AVKON_SOFTKEYS_BACK ); |
|
477 |
} |
|
478 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::UpdateCbaL()") ); |
|
479 |
} |
|
480 |
||
481 |
||
482 |
||
483 |
// --------------------------------------------------------------------------- |
|
484 |
// CCamUserSceneSetupViewBase::SetTitlePaneTextL |
|
485 |
// Set the view's title text |
|
486 |
// --------------------------------------------------------------------------- |
|
487 |
// |
|
488 |
void CCamUserSceneSetupViewBase::SetTitlePaneTextL() |
|
489 |
{ |
|
490 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::SetTitlePaneTextL()") ); |
|
491 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() ); |
|
492 |
// It is known that the container for this view is of the special |
|
493 |
// type CCamUserSceneSetupContainer, and so we can use it's methods. |
|
494 |
CCamUserSceneSetupContainer* userSceneSetup = |
|
495 |
static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
496 |
appUi->SetTitleL( userSceneSetup->TitlePaneTextResourceId() ); |
|
497 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SetTitlePaneTextL()") ); |
|
498 |
} |
|
499 |
||
500 |
// --------------------------------------------------------------------------- |
|
501 |
// CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL |
|
502 |
// Switches to the user scene setup mode. |
|
503 |
// --------------------------------------------------------------------------- |
|
504 |
// |
|
505 |
void CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL() |
|
506 |
{ |
|
507 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL()") ); |
|
508 |
iContainer->SetMopParent( this ); |
|
509 |
||
510 |
// Activate the menu control and mode. |
|
511 |
AppUi()->AddToStackL( iContainer ); |
|
512 |
iContainer->ActivateL(); |
|
513 |
iContainer->MakeVisible( ETrue ); |
|
514 |
iUserSceneSetupModeActive = ETrue; |
|
515 |
||
516 |
StatusPane()->MakeVisible( ETrue ); |
|
517 |
||
518 |
// Update the command button array. |
|
519 |
iForceAvkonCBA=EFalse; |
|
520 |
UpdateCbaL(); |
|
521 |
SetTitlePaneTextL(); |
|
522 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL()") ); |
|
523 |
} |
|
524 |
||
525 |
||
526 |
// --------------------------------------------------------------------------- |
|
527 |
// CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL |
|
528 |
// Switches the current mode to capture setup and activates a |
|
529 |
// specific control.. |
|
530 |
// --------------------------------------------------------------------------- |
|
531 |
// |
|
532 |
void CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL( TInt aSetupCommand ) |
|
533 |
{ |
|
534 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL()") ); |
|
535 |
iUserSceneSetupModeActive = EFalse; |
|
536 |
SetCaptureSetupModeActive(ETrue); |
|
537 |
iContainer->MakeVisible( ETrue ); |
|
538 |
AppUi()->RemoveFromStack( iContainer ); |
|
539 |
iVFRequested=ETrue; |
|
540 |
StartViewFinder(); |
|
541 |
iController.StartIdleTimer(); |
|
542 |
||
543 |
||
544 |
// Remove the view's main container, and add the capture setup |
|
545 |
// control associated with the input command to the container stack. |
|
546 |
CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL( aSetupCommand, ETrue ); |
|
547 |
StatusPane()->MakeVisible( EFalse ); |
|
548 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL()") ); |
|
549 |
} |
|
550 |
||
551 |
||
552 |
// --------------------------------------------------------------------------- |
|
553 |
// CCamUserSceneSetupViewBase::ExitCaptureSetupModeL |
|
554 |
// Exit capture setup mode. |
|
555 |
// --------------------------------------------------------------------------- |
|
556 |
// |
|
557 |
void CCamUserSceneSetupViewBase::ExitCaptureSetupModeL() |
|
558 |
{ |
|
559 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitCaptureSetupModeL()") ); |
|
560 |
StopViewFinder(); |
|
561 |
||
562 |
StatusPane()->MakeVisible( ETrue ); |
|
563 |
CCamCaptureSetupViewBase::ExitCaptureSetupModeL(); |
|
564 |
||
565 |
SwitchToUserSceneSetupModeL(); |
|
566 |
||
567 |
iContainer->DrawDeferred(); |
|
568 |
||
569 |
SetCaptureSetupModeActive(EFalse); |
|
570 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitCaptureSetupModeL()") ); |
|
571 |
} |
|
572 |
||
573 |
// --------------------------------------------------------------------------- |
|
574 |
// CCamUserSceneSetupViewBase::ExitSceneSettingModeL |
|
575 |
// Exit scene setting mode. |
|
576 |
// --------------------------------------------------------------------------- |
|
577 |
// |
|
578 |
void CCamUserSceneSetupViewBase::ExitSceneSettingModeL() |
|
579 |
{ |
|
580 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitSceneSettingModeL()") ); |
|
581 |
CCamCaptureSetupViewBase::ExitSceneSettingModeL(); |
|
582 |
SwitchToUserSceneSetupModeL(); |
|
583 |
||
584 |
iContainer->DrawDeferred(); |
|
585 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitSceneSettingModeL()") ); |
|
586 |
} |
|
587 |
||
588 |
// --------------------------------------------------------------------------- |
|
589 |
// CCamUserSceneSetupViewBase::ExitInfoListBoxL |
|
590 |
// Exit scene setting mode. |
|
591 |
// --------------------------------------------------------------------------- |
|
592 |
// |
|
593 |
void CCamUserSceneSetupViewBase::ExitInfoListBoxL() |
|
594 |
{ |
|
595 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitInfoListBoxL()") ); |
|
596 |
StopViewFinder(); |
|
597 |
||
598 |
CCamCaptureSetupViewBase::ExitInfoListBoxL(); |
|
599 |
SwitchToUserSceneSetupModeL(); |
|
600 |
||
601 |
iContainer->DrawDeferred(); |
|
602 |
||
603 |
StatusPane()->MakeVisible( ETrue ); |
|
604 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitInfoListBoxL()") ); |
|
605 |
} |
|
606 |
||
607 |
// ----------------------------------------------------------------------------- |
|
608 |
// CCamUserSceneSetupViewBase::ExitAllModesL |
|
609 |
// Revert to normal mode |
|
610 |
// ----------------------------------------------------------------------------- |
|
611 |
// |
|
612 |
void CCamUserSceneSetupViewBase::ExitAllModesL() |
|
613 |
{ |
|
614 |
PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitAllModesL()") ); |
|
615 |
if ( iSceneSettingModeActive ) |
|
616 |
{ |
|
617 |
ExitSceneSettingModeL(); |
|
618 |
} |
|
619 |
if ( iCaptureSetupModeActive ) |
|
620 |
{ |
|
621 |
ExitCaptureSetupModeL(); |
|
622 |
} |
|
623 |
if( iInfoListBoxActive ) |
|
624 |
{ |
|
625 |
ExitInfoListBoxL(); |
|
626 |
} |
|
627 |
PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitAllModesL()") ); |
|
628 |
} |
|
629 |
||
630 |
||
631 |
// --------------------------------------------------------------------------- |
|
632 |
// CCamUserSceneSetupViewBase::IsOnlyUserSceneSetupModeActive |
|
633 |
// Returns true if only the user scene setup mode is active. |
|
634 |
// --------------------------------------------------------------------------- |
|
635 |
// |
|
636 |
TBool CCamUserSceneSetupViewBase::IsOnlyUserSceneSetupModeActive() |
|
637 |
{ |
|
638 |
return ( iUserSceneSetupModeActive && !iCaptureSetupModeActive |
|
639 |
&& !iSceneSettingModeActive && !iUserScenePageModeActive ); |
|
640 |
} |
|
641 |
||
642 |
// --------------------------------------------------------------------------- |
|
643 |
// CCamUserSceneSetupViewBase::DisplayResetUserSceneDlgL |
|
644 |
// Display reset user setting confirmation dialog |
|
645 |
// --------------------------------------------------------------------------- |
|
646 |
// |
|
647 |
void CCamUserSceneSetupViewBase::DisplayResetUserSceneDlgL() |
|
648 |
{ |
|
649 |
HBufC* confirmationText; |
|
650 |
confirmationText = StringLoader::LoadLC( R_CAM_RESET_USER_SCENE_NOTE_TEXT ); |
|
651 |
CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); |
|
652 |
CleanupStack::PopAndDestroy( confirmationText ); |
|
653 |
||
654 |
if ( confirmationDialog->ExecuteLD( R_CAM_RESET_USER_SCENE_NOTE ) ) |
|
655 |
{ |
|
656 |
iController.ResetUserSceneL(); |
|
657 |
CCamUserSceneSetupContainer* userSceneSetup = |
|
658 |
static_cast<CCamUserSceneSetupContainer*>( iContainer ); |
|
659 |
||
660 |
userSceneSetup->UpdateListItems(); |
|
661 |
userSceneSetup->UpdateDisplayL(); |
|
662 |
} |
|
663 |
} |
|
664 |
||
665 |
// End of File |
|
666 |
||
667 |
||
668 |
||
669 |