camerauis/cameraapp/generic/src/CamAppui.cpp
author Fionntina Carville <fionntinac@symbian.org>
Fri, 12 Nov 2010 18:52:18 +0000
branchRCL_3
changeset 69 a2232ad2df6d
parent 67 756ad29ed18e
permissions -rw-r--r--
Update xhtml.zip with mappings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  App UI class for cameraapp
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
// This needs to be included first, because other include files
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
// may be variated using these flags.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <avkon.hrh>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <barsread.h>  // TResourceReader
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <StringLoader.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <sysutil.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <eikenv.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <hlplch.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <apgwgnam.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <apgcli.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <DocumentHandler.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <apmstd.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <textresolver.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <aknnotewrappers.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <akntitle.h>  // CAknTitlePane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <aknclearer.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <aknnavide.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include <AknWaitDialog.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include <aknstaticnotedialog.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include <AknCapServerDefs.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include <akntoolbar.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include <aknstyluspopupmenu.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include <aknlayoutscalable_apps.cdl.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include <akntoolbarextension.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include <eiksoftkeypostingtransparency.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include <centralrepository.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include <AknSgcc.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include <cameraapp.rsg>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include <vgacamsettings.rsg>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
#include <activepalette2ui.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include <AknGlobalNote.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#include <hal.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include <hal_data.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include <oommonitorsession.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include <driveinfo.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include <pathinfo.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include <AccMonitor.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
#ifndef __WINSCW__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
//#include <SFIUtilsAppInterface.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
#include <musresourceproperties.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
#include <cameraplatpskeys.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
#include <AknCommonDialogsDynMem.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
#include <CAknMemorySelectionDialogMultiDrive.h>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
#include "CameraappPrivateCRKeys.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
#include "CamAppUi.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
#include "CamUtility.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
#include "CamAppController.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
#include "CamControllerObservers.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
#include "CamTimer.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
#include "CamLogger.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
#include "CamStillPreCaptureView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
#include "CamStillPostCaptureView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
#include "CamVideoPreCaptureView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
#include "CamVideoPostCaptureView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
#include "CamBurstThumbnailView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
#include "CamSelfTimer.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
#include "CamPanic.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
#include "CamBurstModeObserver.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
#include "CamStillUserSceneSetupView.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
#include "CamNaviCounterControl.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
#include "CamNaviCounterModel.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
#include "CamNaviProgressBarControl.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
#include "Cam.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
#include "CamSettings.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
#include "CamProductSpecificSettings.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
#include "CamAppUiBase.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
#include "CamWaitDialog.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
#include "CamSidePane.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
#include "CamZoomPane.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
#include "CamAppUid.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
#include <csxhelp/lcam.hlp.hrh>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
#include "CameraVariant.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
#include "OstTraceDefinitions.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
#ifdef OST_TRACE_COMPILER_IN_USE
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
#include "CamAppuiTraces.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
#include "camactivepalettehandler.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
#include "CamContainerBase.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
#include "camuidconstants.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
#include "CamGSInterface.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
#include "CamFileCheckAo.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
#include "CamLocalViewIds.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
#include "CameraUiConfigManager.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
#include "MCamAddToAlbumObserver.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
#include "CamCollectionManagerAo.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
#include "glxgallery.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
#include "glxcollectionplugincamera.hrh"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
#include "s32mem.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
#include "camflashstatus.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
#include "CamMemoryMonitor.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
#include "camstartuplogocontroller.h"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
// ===========================================================================
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
// Constants
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
// Sequence mode related constants that define the amount of pictures taken
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
// with sequence mode.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
const TInt KShortBurstCount  = 18;   // number of images captured during burst
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
// When asked if current memory is full in video mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
// there needs to be at least following amount of recording
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
// time left or memory is said to be full.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
const TTimeIntervalMicroSeconds KMemoryFullVideoRemaining = 1000*1000;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
// This is used to find the window group id for Eikon Server.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
// The Eikon Server window group id is later used to ignore all window server
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
// events saying Eikon Server has gained focus.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
_LIT( KEikonServer, "EikonServer" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
_LIT8(K3gpVideoMimeType, "video/3gpp");
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
_LIT8(KMp4VideoMimeType, "video/mp4");
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
//const TCamMediaStorage KCamInternalStorage = ECamMediaStoragePhone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
const TUint KCameraEventInterest = ( ECamCameraEventClassBasicControl
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
                                   | ECamCameraEventClassImage
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
                                   | ECamCameraEventClassVideo
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
                                   | ECamCameraEventClassVfControl
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
                                   | ECamCameraEventClassSsControl
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
                                   | ECamCameraEventClassSettings );
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   149
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
// ===========================================================================
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
// Member functions
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
// CCamAppUi::~CCamAppUi
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
// Destructor
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
CCamAppUi::~CCamAppUi()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    PRINT( _L("Camera => ~CCamAppUi" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    if ( iMemoryMonitor )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
        iMemoryMonitor->StopMonitoring();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
        delete iMemoryMonitor;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
        iMemoryMonitor = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
    delete iStartupLogoController;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    iController.SetAppUiAvailable( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
    iResourceLoaders.Close();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
    if( iPostCapIdle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
        iPostCapIdle->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
        delete iPostCapIdle;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
    if ( iFileCheckAo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
        iFileCheckAo->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
        delete iFileCheckAo;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
    if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
         iSensorIdle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
        CancelSensorIdle();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
        delete iSensorIdle;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
        }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
#if !defined(__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
    // relinquish capture keys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
    UnRegisterCaptureKeys();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
    SaveCaptureMode();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
    SaveCourtesyUiState();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
    delete iDecoratedNaviPaneCounter;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    delete iDecoratedNaviPaneProgressBar;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
#if defined( CAMERAAPP_CAPI_V2_DVF )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
    if ( iSelfTimer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
        iSelfTimer->RemoveObserver( this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
#endif // CAMERAAPP_CAPI_V2_DVF
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
    delete iSelfTimer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    delete iParentAppName;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    delete iTextResolver;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    iController.RemoveControllerObserver( this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
    // Burst mode observers are not owned, delete only the pointers to them.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
    iBurstModeObservers.Close();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
    if ( iWaitTimer && iWaitTimer->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
        iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
    delete iWaitTimer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    delete iDocHandler;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    delete iCamSidePane;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
    delete iCamZoomPane;       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
    delete iRepository;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
/*#ifndef __WINSCW__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
    delete iSFIUtils;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
#endif*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
    delete iNaviCounterControl;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
    delete iNaviProgressBarControl;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
    delete iNaviCounterModel;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
    delete iNaviProgressBarModel;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
    delete iActivePaletteHandler;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
    iActivePaletteHandler = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    if( iCourtesyTimer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
        iCourtesyTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
    delete iCourtesyTimer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
    delete iScreenClearer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
    delete iVolumeKeyObserver;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    delete iCollectionManager;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    iCollectionManager = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    PRINT( _L("Camera <= ~CCamAppUi" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
// CCamAppUi::ConstructL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
// Symbian 2nd phase constructor can leave.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
void CCamAppUi::ConstructL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
  OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_CONSTRUCTL, "e_CCamAppUi_ConstructL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
  PRINT( _L("Camera => CCamAppUi::ConstructL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
  iRotatedKeyEvent = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
  iReturnedFromPlugin = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
  iController.SetAppUiAvailable( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
  iLockedQwertyState = E2ndCamUnknown; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
  iMemoryMonitor = CCamMemoryMonitor::NewL( this, &iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
  TInt memError =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
  iMemoryMonitor->CheckAndRequestMemoryL( iController.UiConfigManagerPtr()->CriticalLevelRamMemory(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
                                          iController.UiConfigManagerPtr()->RequiredRamMemory(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
                                          ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
  TInt freeMemory = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
  HAL::Get( HALData::EMemoryRAMFree, freeMemory );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
  if ( memError && freeMemory < iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
      User::Leave( memError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
  iUiConstructionComplete = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
  iDSASupported = iController.UiConfigManagerPtr()->IsDSAViewFinderSupported();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
  TBool uiOrientationOverride = iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
  // Get the screenmode values used for setting  the orientation
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   292
  RArray<TInt> screenModeValues;
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
  if ( uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
      iController.UiConfigManagerPtr()->SupportedScreenModesL( screenModeValues );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
      iLandscapeScreenMode = screenModeValues[0];
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
      iPortraitScreenMode = screenModeValues[1];
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
  // The embedded views are set after ConstructL completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
  // but the value is only of interest if the app is embedded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
  iEmbeddedViewSet = !IsEmbedded();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
  PRINT1( _L("Camera => CCamAppUi::ConstructL iEmbeddedViewSet:%d"), iEmbeddedViewSet );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
  // In embedded case requesting new file without defined resolution
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
  // the 0*0 is interpreted as the default mms size resolution
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
  iRequestedNewFileResolution.SetSize( 0, 0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
  // Camera window group id
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
  iMyWgId = iCoeEnv->RootWin().Identifier();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
  // Get the id of Eikon Server window group
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
  iEikonServerWindowGroupId = iCoeEnv->WsSession().FindWindowGroupIdentifier(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
    0,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
    KEikonServer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
  CApaWindowGroupName::FindByAppUid(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
    KBtNotifierServerUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
    iCoeEnv->WsSession(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
    iBTServerWindowGroupId);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
  CApaWindowGroupName::FindByAppUid(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
    KPhoneAppUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
    iCoeEnv->WsSession(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
    iPhoneAppWindowGroupId);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
  PRINT( _L("Camera <> create new repository") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
  TInt crValue = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
  if( !iRepository )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
    iRepository = CRepository::NewL( KCRUidCameraappSettings ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
  // get softkey position
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
  CamUtility::GetPsiInt( ECamPsiSoftKeyPosition, iSoftkeyPosition );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
  iCamOrientation = ReadCurrentDeviceOrientation();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
  PRINT1( _L("Camera <> CurrentDeviceOrientation (%d)"), iCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
  PERF_EVENT_START_L2( EPerfEventAvkonUIConstruction );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
  TInt orientation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
  if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
      PRINT( _L("Camera <> using slider position to set orientation") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
      // Use the current slider position for the required orientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
      TInt sliderPosition;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
      TInt err = RProperty::Get(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
            CameraPlatPSKeys::KPSCameraPlatUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
            CameraPlatPSKeys::KLensCoverStatus,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
            sliderPosition );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
      // ToDo this could be removed after PCFW has released new implementation (wk25/2009)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
      if( err == KErrNotFound )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
          PRINT( _L("Camera <> using slider position to set orientation") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
          err = RProperty::Get(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
              NMusResourceApi::KCategoryUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
              NMusResourceApi::KCameraAvailability,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
              sliderPosition );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
      PRINT2( _L("Camera <> slider position = %d, error = %d"),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
            sliderPosition, err );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
      // If there is an error then assume the slider is closed (as long as there is
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
      // more than one camera) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
      if ( err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
        PRINT1( _L("Camera <> Slider status err%d - Check status later"),err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
        iController.SetCameraSwitchRequired( ESwitchToUnknown );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
      if ( ( ( CCamAppController::CamerasAvailable() > 1 && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
             sliderPosition == CameraPlatPSKeys::EClosed ) || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
           err != KErrNone ) && !IsQwerty2ndCamera( ETrue ) ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
          PRINT( _L("Camera <> setting orientation for secondary camera") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
          CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, orientation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
          PRINT( _L("Camera <> setting orientation for primary camera") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
          CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, orientation );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
          } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
      // Without lens cover support, always start to primary camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
      CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, orientation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
  if ( orientation == ( TInt ) EAppUiOrientationLandscape )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
    PRINT( _L("Camera <> orientation is landscape ") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
    iCamOrientation = (ECamHandLeft == iSoftkeyPosition ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
                    ? ECamOrientationCamcorderLeft 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
                    : ECamOrientationCamcorder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
    PRINT( _L("Camera <> Calling BaseConstructL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
    OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 1" ); //CCORAPP_APP_BASE_CONSTRUCT_START
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
    BaseConstructL( EAppOrientationLandscape | EAknEnableSkin | EAknEnableMSK | 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
                    ENonStandardResourceFile | EAknSingleClickCompatible );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
    OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 0" );    //CCORAPP_APP_BASE_CONSTRUCT_END
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
    PRINT( _L("Camera <> BaseConstructL Complete") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
                            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
    if( uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
      // Finish engine construction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
      iController.CompleteConstructionL();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
      //set orientation to CCamera	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
      iController.SetCameraOrientationModeL( iLandscapeScreenMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
      // and complete the cameracontroller construction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
      iController.CompleteCameraConstructionL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
    PRINT( _L("Camera <> orientation is portrait") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
    iCamOrientation = ECamOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
    PRINT( _L("Camera <> Calling BaseConstructL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
    OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
    BaseConstructL( EAppOrientationPortrait | EAknEnableSkin | EAknEnableMSK | 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
                    ENonStandardResourceFile );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
    OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
    PRINT( _L("Camera <> BaseConstructL Complete") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    if( uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
      // Finish engine construction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
      iController.CompleteConstructionL();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
      //set orientation to CCamera	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
      iController.SetCameraOrientationModeL( iPortraitScreenMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
      // and complete the cameracontroller construction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
      iController.CompleteCameraConstructionL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
      }     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
    PERF_EVENT_END_L2( EPerfEventAvkonUIConstruction );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
#if !defined (__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
#if !( defined(__WINS__) || defined(__WINSCW__) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
  // Ensure that the macro switch keys are always captured by this
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
  // application.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
  if ( !AppInBackground( EFalse ) )  //camera is constructed in background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
      RegisterCaptureKeysL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
#endif // !defined(__WINS__) || defined(__WINSCW__)    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
  if( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    // Load the settings model static settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
    PRINT( _L("Camera <> call CCamAppController::LoadStaticSettingsL..") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
    iController.LoadStaticSettingsL( IsEmbedded() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
    // Check the screen size if it matches the orientation we expect.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
    // If not, delay the initialization until HandleScreenDeviceChangedL is called.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP6_CCAMAPPUI_CONSTRUCTL, "e_ReadUiOrientationFromWindowServer 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
    TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
    PRINT2( _L("<> CCamAppUi::ConstructL() iCoeEnv->ScreenDevice()->SizeInPixels():  w=%d h=%d"), screenSize.iWidth, screenSize.iHeight );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
    TBool expectLandscape = (iCamOrientation != ECamOrientationPortrait);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
    TBool isLandscape     = (screenSize.iWidth > screenSize.iHeight);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
    if( isLandscape != expectLandscape || AppInBackground( EFalse ) )   //screen is not ready or camera app is in background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
      iEngineConstructionDelayed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP7_CCAMAPPUI_CONSTRUCTL, "e_ReadUiOrientationFromWindowServer 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
    // initialise the self timer mode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
    iInSelfTimerMode = ECamSelfTimerDisabled;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
    if ( !iEngineConstructionDelayed )     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP8_CCAMAPPUI_CONSTRUCTL, "e_EngineConstructionDelayed 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
      iController.CompleteConstructionL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
      iController.StoreUserSceneSettingsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP9_CCAMAPPUI_CONSTRUCTL, "e_EngineConstructionDelayed 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
      } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
    iEngineConstructionDelayed = EFalse;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
    iInSelfTimerMode = ECamSelfTimerDisabled;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
  iEmbeddedObserver = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
  iController.AddControllerObserverL( this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
  iController.AddCameraObserverL( this, KCameraEventInterest );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
  if( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
/*#ifndef __WINSCW__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
    // Initialize SFIUtils
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
  OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP10_CCAMAPPUI_CONSTRUCTL, "e_InitSendFileInCall 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
	PRINT(_L("iSFIUtils = CSFIUtilsAppInterface::NewL -->"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
    TRAPD(errSFI,iSFIUtils = CSFIUtilsAppInterface::NewL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
	PRINT1(_L("iSFIUtils = CSFIUtilsAppInterface::NewL <-- errSFI=%d"),errSFI);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
	User::LeaveIfError(errSFI);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
    iSendFileInCall = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
  OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP11_CCAMAPPUI_CONSTRUCTL, "e_InitSendFileInCall 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
    PRINT( _L("iSendFileInCall = EFalse") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
#endif*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
    // Create text resolver for error note text
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
    iTextResolver = CTextResolver::NewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
    ConstructPreCaptureViewsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
    iSelfTimer = CCamSelfTimer::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
#if defined( CAMERAAPP_CAPI_V2_DVF )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
    iSelfTimer->AddObserverL( this ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
#endif // CAMERAAPP_CAPI_V2_DVF
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
    PRINT( _L("Camera <> creating navicounter model") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
    iNaviCounterModel = CCamNaviCounterModel::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
    PRINT( _L("Camera <> append navicounter to resourceloaders") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
    User::LeaveIfError( iResourceLoaders.Append(iNaviCounterModel) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
    PRINT( _L("Camera <> creating progress bar model") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
    iNaviProgressBarModel = CCamNaviProgressBarModel::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
    PRINT( _L("Camera <> append progressbar to resourceloaders") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
    User::LeaveIfError(iResourceLoaders.Append(iNaviProgressBarModel));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
    ConstructNaviPaneL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
  iRepository->Get( KCamCrAlwaysDrawCourtesyUi, crValue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
  iAlwaysDrawPreCaptureCourtesyUI = (crValue == KCamCrAlwaysDrawCourtesyUiIsOn);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
  iCoeEnv->RootWin().EnableScreenChangeEvents();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
  if( uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
    // always start in still mode	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
    iMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    iTargetMode = ECamControllerImage;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
    {  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
    // If the view launch needs to wait until the engine
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
    // is constructed or the embedded launch view is set, the starting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
    // state will be standby    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
    if ( !IsConstructionComplete() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
      iViewState = ECamViewStateStandby;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
    // Get start up mode from settings.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
    // If the application is embedded the new view will be set
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
    // when HandleNewFileL is called by the framework
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
    PRINT( _L("Camera <> CCamAppUi::ConstructL set default view") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
    if ( StartupMode() == ECamStillCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
      iMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
      iTargetMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
      SetDefaultViewL( *iStillCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
      iMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
      iTargetMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
      SetDefaultViewL( *iVideoCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
      }      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
    if( !iEngineConstructionDelayed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
      // pre-construct side-pane & zoom pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
      // get whether we overlay sidepane over view-finder
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
      TBool overlayViewFinder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
      User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
      PRINT( _L("Camera <> CCamAppUi::ConstructL create sidepane") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
      iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
      User::LeaveIfError(iResourceLoaders.Append(iCamSidePane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
      PRINT( _L("Camera <> CCamAppUi::ConstructL create zoom pane") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
      iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
      User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
  }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
  // create the timer used for callbacks
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
  iWaitTimer = CPeriodic::NewL( CActive::EPriorityHigh );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
  // initialise the view construction states
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
  iPostCaptureViewsConstructed     = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
  iUserSceneSetupViewConstructed   = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
  iCustomiseToolbarViewConstructed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
  if( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
    {  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
    PRINT( _L("Camera => CCamAppUi::ConstructL create doc handler") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
    iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
    iDocHandler->SetExitObserver(this);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
  iController.CheckMemoryToUseL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
    // create navi-pane and navi-porgress bar for use in camcorder mode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
    PRINT( _L("Camera => CCamAppUi::ConstructL create navicounter control") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
    iNaviCounterControl = CCamNaviCounterControl::NewL( *iNaviCounterModel );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
    iNaviCounterControl->SetExtentToWholeScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
    PRINT( _L("Camera => CCamAppUi::ConstructL create progress bar control") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
    iNaviProgressBarControl = CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
    // get max num of images for burst capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
    CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, iMaxBurstCaptureNum );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
    PRINT( _L("Camera => CCamAppUi::ConstructL create AP handler") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
    iActivePaletteHandler = CCamActivePaletteHandler::NewL( iController, EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
  iDrawPreCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
  iDrawPostCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
  iAlwaysDrawPostCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
  iLeftSoftKeyPressed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
  if( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
    // get coutesy UI timeout
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
    TInt timeoutValue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
    CamUtility::GetPsiInt( ECamPsiCourtesyUiTimeoutValue, timeoutValue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
    iCourtesyTimer = CCamTimer::NewL( timeoutValue * 1000000, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
                                      TCallBack( CCamAppUi::CourtesyTimeout, this ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
    PRINT( _L("Camera => CCamAppUi::ConstructL update navi models") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
    UpdateNaviModelsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
    PRINT( _L("Camera => CCamAppUi::ConstructL navi counter reload resources") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
    iNaviCounterModel->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
    PRINT( _L("Camera => CCamAppUi::ConstructL navi progress bar reload resources") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
    iNaviProgressBarModel->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
  iZoomPaneShown = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
  iFirstBoot = ETrue; // Show zoom
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
  iProcessingScreenRedraw = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
  iSendAsInProgress = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
  if( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
    {  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
    iFileCheckAo = CCamFileCheckAo::NewL( iController, *this );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
    iCollectionManager = new (ELeave) CCamCollectionManagerAO( *this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
  iCheckOperationInProgress = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
  iLostFocusToNewWindow = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
  iFirstVFStart = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
  if ( !uiOrientationOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
    iUiConstructionComplete = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
  iMemoryMonitor->StartMonitoring( iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
                                   iController.UiConfigManagerPtr()->RequiredRamMemoryFocusGained() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
  // TRAP errors so camera starts up even if startup animation fails
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
  TRAP_IGNORE(iStartupLogoController = CCamStartupLogoController::NewL(EStartupLogoVisible));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
  PRINT( _L("Camera <= CCamAppUi::ConstructL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
  OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP3_CCAMAPPUI_CONSTRUCTL, "e_CCamAppUi_ConstructL 0" );
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   665
  }
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
// IsInternalView
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
TBool CCamAppUi::IsInternalView( TCamViewState aViewState ) const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
  PRINT1( _L("Camera => CCamAppUi::IsInternalView [%s]"), KCamViewStateNames[aViewState] );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
  TBool internal( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
  if ( aViewState < ECamViewStateRangeInternalMax
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
    && aViewState > ECamViewStateRangeInternalMin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
      internal = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
  else if( aViewState < ECamViewStateRangeExternalMax
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
        && aViewState > ECamViewStateRangeExternalMin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
      internal = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
    CamPanic( ECamPanicInvalidView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
  PRINT1( _L("Camera <= CCamAppUi::IsInternalView, return %d"), internal );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
  return internal;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
  }
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   697
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   698
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   699
 
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
// CCamAppUi::IsConstructionComplete
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
// Returns whether or not all construction has completed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
TBool CCamAppUi::IsConstructionComplete() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
    {     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
    TBool complete = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
    complete = !iEngineConstructionDelayed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
    return complete && iEmbeddedViewSet; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
// CCamAppUi::NaviCounter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
// Returns the pointer to the NaviCounter control
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
CCamNaviCounterControl* CCamAppUi::NaviCounterControl()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
    return iNaviCounterControl;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
// CCamAppUi::NaviProgressBar
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
// Returns the pointer to the NaviProgress control
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
CCamNaviProgressBarControl* CCamAppUi::NaviProgressBarControl()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
    return iNaviProgressBarControl;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
// CCamAppUi::NaviCounterModel
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
// Returns the pointer to the NaviCounter model
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
CCamNaviCounterModel* CCamAppUi::NaviCounterModel()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
    return iNaviCounterModel;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
// CCamAppUi::CCamAppUi
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
// C++ default constructor can NOT contain any code, that
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
// might leave.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
CCamAppUi::CCamAppUi( CCamAppController& aController )                              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
    : iController( aController ),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
    iViewState( ECamViewStatePreCapture ),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
    iTargetViewState( ECamViewStatePreCapture ), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
    iPreventActivePaletteDisplay( EFalse ),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
    iInternalStorage(ECamMediaStorageNone)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
// CCamAppUi::SetTitleL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
// Set title pane text from a resource.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
void CCamAppUi::SetTitleL( TInt aResourceId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
    // Set title
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
    CAknTitlePane* title = static_cast<CAknTitlePane*>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
        StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
    TResourceReader reader;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
    iCoeEnv->CreateResourceReaderLC( reader, aResourceId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
    title->SetFromResourceL( reader );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
    CleanupStack::PopAndDestroy();  // resource reader
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
// CCamAppUi::SetTitleL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
// Set title pane text from a descriptor.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
void CCamAppUi::SetTitleL( const TDesC& aText )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
    CAknTitlePane* title = static_cast<CAknTitlePane*>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
        StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
    title->SetTextL( aText );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
// CCamAppUi::PushNaviPaneCounterL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
// Push navi pane counter on to navi pane stack.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
CCamAppUi::PushNaviPaneCounterL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
  iNaviCounterModel->SetCaptureModeL( iMode, iImageMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
  iDecoratedNaviPaneCounter->MakeScrollButtonVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
  NaviPaneL()->PushL( *iDecoratedNaviPaneCounter );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
// CCamAppUi::PushNaviPaneProgressBarL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
// Push navi pane progress bar on to navi pane stack.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
void CCamAppUi::PushNaviPaneProgressBarL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
    iDecoratedNaviPaneProgressBar->MakeScrollButtonVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
    NaviPaneL()->PushL( *iDecoratedNaviPaneProgressBar );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
// CCamAppUi::PushDefaultNaviPaneL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
// Push default navi pane on to navi pane stack.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
void CCamAppUi::PushDefaultNaviPaneL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
    NaviPaneL()->PushDefaultL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
// CCamAppUi::DisplayDeleteNoteL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
// Call DisplayDeleteNoteL on the current view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
TBool CCamAppUi::DisplayDeleteNoteL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
  TBool deleted = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
          static_cast<CCamPostCaptureViewBase*>( iView )->DisplayDeleteNoteL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
  // If the image/video has been deleted, switch view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
  if ( deleted )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
                              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
    if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() && IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
        // if in embedded mode, then check the status of the slide
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
        // and set a pending camera switch if the slide has been
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
        // opened/closed after starting the capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
        iController.CheckSlideStatus();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
        }      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
                               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
    // if this is burst mode and there are still images left, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
    // return to thumbnail view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
    if ( ECamImageCaptureBurst == iController.CurrentImageModeSetup()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
      && 0                     <  iController.CurrentItemCount() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
      iTargetViewState = ECamViewStateBurstThumbnail;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
    // otherwise switch to pre-capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
      iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
    TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
  return deleted;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
// CCamAppUi::SelfTimerEnableL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
// Enable or disable SelfTimer functionality
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
void CCamAppUi::SelfTimerEnableL( TCamSelfTimerFunctions aState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
    // If the requested state is the current state, do nothing.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
    if ( iInSelfTimerMode == aState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
    __ASSERT_DEBUG( iSelfTimer, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
    // Update the member variable
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
    iInSelfTimerMode = aState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
    if ( aState != ECamSelfTimerDisabled  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
        {     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
        // Set up for current timer mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
        iSelfTimer->SetModeL( iMode, iImageMode, iInSelfTimerMode );              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
        UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
    else                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
        // stop the timer and remove the indicator from the side pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
        iSelfTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
        // In capture setup mode, toolbar and indicators are not visible
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   896
        // They will be updated when returning to precap, similar to
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   897
        // when setting the self timer mode above.
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   898
        // Also, during transition from still pre-capture view to video 
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   899
        // pre-capture view, there's no need to show toolbar of still image. 
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   900
        // It will display toolbar of video when entering video pre-capture.
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   901
        if ( iPreCaptureMode != ECamPreCapCaptureSetup && 
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   902
             iPreCaptureMode != ECamPreCapSceneSetting )
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
            // Re-show the active palette
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
            iActivePaletteHandler->UpdateActivePaletteL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
            iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
            SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
            if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
                CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
                if (toolbar)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
                    toolbar->SetToolbarVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
            // Cancel any active focusing operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
            // this won't cancel if capture has already been requested
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
            iController.CancelFocusAndCapture();
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   920
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
            iStillCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
            // Raise precapture UI and restart courtesy UI timer,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
            // if hide icons is enabled.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
            RaisePreCaptureCourtesyUI(EFalse);        
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   926
            }
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
        UpdateCba();
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
   929
        }
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
// CCamAppUi::SelfTimerEnabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
// Returns current self-timer state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
//        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
TBool CCamAppUi::SelfTimerEnabled() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
    return ( iInSelfTimerMode != ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
// CCamAppUi::SelfTimer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
// Returns pointer to self-timer object
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
//        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
CCamSelfTimer* CCamAppUi::SelfTimer()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
    return iSelfTimer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
// CCamAppUi::AddBurstModeObserverL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
// Register an observer for burst mode changes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
CCamAppUi::AddBurstModeObserverL( MCamBurstModeObserver* aBurstModeObserver )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
  // Check for non-null and only add once.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
  if( aBurstModeObserver &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
     KErrNotFound == iBurstModeObservers.Find( aBurstModeObserver ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
    iBurstModeObservers.AppendL( aBurstModeObserver );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
// CCamAppUi::RemoveBurstModeObserver
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
// Remove the burst mode observer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
CCamAppUi::RemoveBurstModeObserver( const MCamBurstModeObserver* aBurstModeObserver )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
  if( aBurstModeObserver )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
    TInt index = iBurstModeObservers.Find( aBurstModeObserver );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
    if( KErrNotFound != index )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
      iBurstModeObservers.Remove( index );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
// CCamAppUi::IsBurstEnabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
// Return burst mode enabled state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   991
TBool CCamAppUi::IsBurstEnabled() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   992
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   993
  PRINT_FRQ( _L("Camera => CCamAppUi::IsBurstEnabled" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   994
  TBool ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
  if ( ECamImageCaptureBurst     == iImageMode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   996
    || ECamImageCaptureTimeLapse == iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   997
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
    ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
  PRINT_FRQ( _L("Camera <= CCamAppUi::IsBurstEnabled" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
  return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
// CCamAppUi::CurrentBurstMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
// Return burst mode enabled type
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
TCamImageCaptureMode CCamAppUi::CurrentBurstMode() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
  PRINT_FRQ( _L("Camera => CCamAppUi::CurrentBurstMode" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
  TCamImageCaptureMode mode( ECamImageCaptureNone );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
  if ( ECamImageCaptureBurst     == iImageMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
    || ECamImageCaptureTimeLapse == iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
    mode = iImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
  PRINT_FRQ( _L("Camera <= CCamAppUi::CurrentBurstMode" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
  return mode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
  }   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
// CCamAppUi::IsSecondCameraEnabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
// Returns whether or the secondary camera has been activated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
// Will return ETrue when when the second camera is active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
TBool CCamAppUi::IsSecondCameraEnabled() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
    PRINT_FRQ( _L("Camera =><= CCamAppUi::IsSecondCameraEnabled" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
    return iController.ActiveCamera() == ECamActiveCameraSecondary;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
// CCamAppUi::IsQwerty2ndCamera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
TBool CCamAppUi::IsQwerty2ndCamera( TBool aLock )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
    TBool ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
    if ( aLock )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
        iLockedQwertyState = E2ndCamUnknown;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
    switch( iLockedQwertyState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
        case E2ndCamPortraitForced: 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
            ret = EFalse; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
        case E2ndCamLandscapeForced:     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
            ret = ETrue; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
        case E2ndCamUnknown:     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
            // Get variant setting i.e. initialize
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
            TInt value = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
            if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
               {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
            	value = iController.UiConfigManagerPtr()->IsQwerty2ndCamera();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
                iLockedQwertyState = static_cast<T2ndCamOrientation>(value); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
                if ( iLockedQwertyState == E2ndCamAuto )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
                    ret = CamUtility::IsQwertyOpen(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
                    ret = iLockedQwertyState == E2ndCamLandscapeForced;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
 		}            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
        case E2ndCamAuto:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
            ret = CamUtility::IsQwertyOpen(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
        default: 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
    if ( aLock )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
        iLockedQwertyState = ret?E2ndCamLandscapeForced:E2ndCamPortraitForced;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
    return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
// CCamAppUi::IsWaitDialog
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
TBool CCamAppUi::IsWaitDialog() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
  return iWaitDialog != NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
// CCamAppUi::ActiveCamera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
// Returns the active camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
TCamActiveCamera CCamAppUi::ActiveCamera() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
  return iController.ActiveCamera();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
// CCamAppUi::HandleCommandL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
// Handle user menu selections
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
void CCamAppUi::HandleCommandL( TInt aCommand )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
  PRINT1( _L("Camera => CCamAppUi::HandleCommandL (%d)"), aCommand )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
  switch( aCommand )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
    {       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
    case ECamCmdRaiseCourtesyUI:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
      {            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
      if ( ECamViewStatePreCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
        RaisePreCaptureCourtesyUI(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
      else if ( ECamViewStatePostCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
        // iLeftSoftKeyPressed resembles the Left SoftKey(LSK) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
        // press when AP tool bar is hidden
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
        if ( iLeftSoftKeyPressed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
        	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
        	// LSK is pressed, we raise the AP tool bar
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
        	RaisePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
        	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
        	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
        	// RSK is pressed, we return back to PreCaptureView
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
        	HandleCommandL( EAknSoftkeyBack );	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
        	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
    case ECamCmdSceneSettingList:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
      iTargetViewState = ECamViewStateSceneSettingList;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
    case ECamCmdGoToStandby:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
      CAknTitlePane* title = static_cast<CAknTitlePane*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
                             ( StatusPane()->ControlL( TUid::Uid ( EEikStatusPaneUidTitle ) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
      title->SetTextL( _L("") ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1172
      title->MakeVisible( ETrue ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
      title->DrawNow(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
      SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
      if ( iView 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
          && ( iStillCaptureView == iView || iVideoCaptureView == iView ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
          iProcessingScreenRedraw = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
          static_cast<CCamPreCaptureViewBase*>( iView )->Container()->DrawNow();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
          iProcessingScreenRedraw = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
      PRINT1( _L("CCamAppUi::HandleCommandL standby %d"), iViewState );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
      iTargetViewState = ECamViewStateStandby;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
    case ECamCmdSwitchToPrecapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
      iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
    case ECamCmdNewPhoto:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
	  if ( !iController.IsViewFinding() && iController.EngineRequestsPending() ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
	    {	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
		return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
	    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
      // check if currently preparing return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
      if ( iController.CaptureModeTransitionInProgress() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1205
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
      #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
      PERF_EVENT_START_L1( EPerfEventSwitchToStillMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
      iController.SetPerformanceState( EPerfWaitingForStillMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
      #endif    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
      if ( iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1214
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
        ZoomPane()->ResetZoomTo1x();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
      // Hide the active palette before switching so that 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
      // it is not visible until the preview is visible.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1221
      SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1222
      if( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1223
          iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1224
          iVideoCaptureView->Container() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1225
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1226
          PRINT( _L("Camera <> CCamAppUi::HandleCommandL calling Draw") ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1227
          iVideoCaptureView->Container()->DrawNow();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1228
          } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1229
      // Switch to still pre capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1230
      iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1231
      // if coming from video mode then set single capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1232
      // otherwise stay with the current capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1233
      if ( iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1234
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1235
        iTargetMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1236
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1237
      SubmergeToolbar(); //Fix flickering when switching modes.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1238
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1239
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1240
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1241
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1242
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1243
    case EEikCmdExit: // fallthrough
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1244
    case EAknSoftkeyExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1245
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1246
      CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1247
      if ( fixedToolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1248
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1249
        CAknToolbarExtension* extension = fixedToolbar->ToolbarExtension();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1250
        if ( extension )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1251
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1252
            extension->SetShown( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1253
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1254
        fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1255
        } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1256
      OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP3_CCAMAPPUI_HANDLECOMMANDL, "e_ExternalExit 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1257
      PRINT( _L("Camera CCamAppUi external exit call") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1258
      if ( iEikonEnv->StartedAsServerApp() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1259
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1260
        if ( iEmbeddedObserver )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1261
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1262
            iEmbeddedObserver->AbortL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1263
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1264
        CloseAppL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1265
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1266
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1267
/*#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1268
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1269
          if( iSendFileInCall )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1270
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1271
              // bring phone app to fore  ground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1272
              BringPhoneAppToForeGroundL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1273
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1274
          else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1275
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1276
              // hide task icon immediately so it doesn't show during
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1277
              // closing which might take a while
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1278
              HideTaskL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1279
              CloseAppL();  	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1280
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1281
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1282
#else*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1283
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1284
          HideTaskL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1285
          CloseAppL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1286
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1287
//#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1288
        OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP5_CCAMAPPUI_HANDLECOMMANDL, "e_ExternalExit 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1289
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1290
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1291
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1292
    case ECamCmdInternalExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1293
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1294
      OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdInternalExit 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1295
      PRINT( _L("Camera <> CCamAppUi::HandleCommandL case ECamCmdInternalExit") );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1296
    #ifdef CAMERAAPP_PERF_LOG_MEMORY 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1297
      // Manually save the current memory log data. This is needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1298
      // in case the application just goes to background, in which
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1299
      // case the log data is not saved automatically.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1300
      CCamPerformanceLogger::SaveAndReset();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1301
    #endif  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1302
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1303
    #ifdef CAMERAAPP_PERF_LOG_TRACES 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1304
      // Shutdown end event cannot be logged to memory logger
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1305
      // So also log start event only to traces
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1306
      if( !iController.AlwaysOnSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1307
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1308
        PERF_EVENT_START_TRACE( EPerfEventApplicationShutdown );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1309
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1310
    #endif  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1311
      PRINT( _L("Camera CCamAppUi::ECamCmdInternalExit") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1312
      InternalExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1313
      OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdInternalExit 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1314
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1315
      break;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1316
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1317
    case ECamCmdSlideClosedExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1318
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1319
      // The controller tells the AppUi that the app needs to 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1320
      // do an internal exit because the slider has closed.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1321
      // However the view needs to do some processing of this command
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1322
      // e.g. to ensure that the application leaves standby mode.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1323
      // Pass the cammand on to the view. It will come back to
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1324
      // the AppUi as ECamCmdInternalExit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1325
      OstTrace0( TRACE_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdSlideClosedExit 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1326
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1327
      iLensCoverExit = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1328
      PRINT( _L("Camera CCamAppUi::ECamCmdSlideClosedExit") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1329
      if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1330
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1331
        PRINT( _L("Camera CCamAppUi passing ECamCmdSlideClosedExit to iView") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1332
        iView->HandleCommandL( ECamCmdInternalExit );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1333
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1334
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1335
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1336
        PRINT( _L("Camera CCamAppUi handlingECamCmdSlideClosedExit") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1337
        HandleCommandL( ECamCmdInternalExit );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1338
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1339
      OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP4_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdSlideClosedExit 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1340
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1341
      break;               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1342
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1343
    case EAknSoftkeyBack:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1344
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1345
      PRINT( _L("Camera <> CCamAppUi::HandleCommandL case EAknSoftkeyBack") );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1346
      // If in burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1347
      if ( iImageMode == ECamImageCaptureBurst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1348
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1349
        // If in burst post-capture view, "back" is to the thumbnail grid
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1350
        if ( iViewState == ECamViewStatePostCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1351
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1352
          iTargetViewState = ECamViewStateBurstThumbnail ;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1353
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1354
        else // From any other burst view... 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1355
          {                             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1356
          iTargetViewState = ECamViewStatePreCapture;               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1357
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1358
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1359
        // Switch to pre capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1360
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1361
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1362
        iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1363
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1364
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1365
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1366
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1367
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1368
    case ECamCmdDelete:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1369
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1370
      // Request that the view displays the delete confirmation note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1371
	  if(!iController.IsProcessingCapture())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1372
		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1373
		DisplayDeleteNoteL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1374
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1375
	  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1376
		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1377
		//Do Nothing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1378
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1379
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1380
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1381
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1382
    case ECamCmdNewVideo:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1383
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1384
      // check if currently preparing return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1385
      if ( iController.CaptureModeTransitionInProgress() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1386
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1387
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1388
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1389
      #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1390
      PERF_EVENT_START_L1( EPerfEventSwitchToVideoMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1391
      iController.SetPerformanceState( EPerfWaitingForVideoMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1392
      #endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1393
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1394
      if ( iMode == ECamControllerImage )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1395
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1396
        ZoomPane()->ResetZoomTo1x();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1397
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1398
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1399
      // Hide the active palette before any attempt to switch off burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1400
      // otherwise the view switch to video fails when we call GetFocusWindowGroup to
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1401
      // see which application has the foreground. Use SetSuppressUIRiseOnViewfinderStart
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1402
      // otherwise the AP is raised automatically when the viewfinder starts.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1403
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1404
      SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1405
      SetSuppressUIRiseOnViewfinderStart( ETrue );                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1406
      // Switch burst mode off before changing to video
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1407
      if ( IsBurstEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1408
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1409
        SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1410
        PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdNewVideo completed switch to single"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1411
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1412
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1413
      // Switch to video pre capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1414
      iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1415
      iTargetMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1416
      SetSuppressUIRiseOnViewfinderStart( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1417
      PRINT( _L("Camera => CCamAppUi::HandleCommandL Try switch to video mode"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1418
      SubmergeToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1419
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1420
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1421
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1422
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1423
    case ECamCmdSelfTimer1: // 10-sec self-timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1424
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1425
      SelfTimerEnableL( ECamSelfTimerMode1 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1426
      }             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1427
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1428
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1429
    case ECamCmdSelfTimer2: // 2-sec self-timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1430
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1431
      SelfTimerEnableL( ECamSelfTimerMode2 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1432
      }             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1433
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1434
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1435
    case ECamCmdSelfTimer3: // (not supported)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1436
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1437
      SelfTimerEnableL( ECamSelfTimerMode3 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1438
      }             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1439
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1440
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1441
    case ECamCmdSelfTimerActivate:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1442
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1443
        // Self timed capture happens either from shutter press or
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1444
        // self timer activate event from softkey press. Shutter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1445
        // press case is handled in CCamStillPreCaptureContainer.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1446
        if( iController.UiConfigManagerPtr()->IsXenonFlashSupported() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1447
            !iController.CheckFlash() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1448
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1449
            // Flash is not ready for taking a picture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1450
            return;            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1451
            }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1452
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1453
      // In touch UI we will get two ECamCmdSelfTimerActivate commands
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1454
      // immediately then the user touches the left softkey to activate
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1455
      // self-timer. We need to ignore the second one to enable the counter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1456
      // to count down properly.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1457
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1458
      // only start countdown if there is space to save image
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1459
      if ( CheckMemoryL() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1460
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1461
        if ( iMode != ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1462
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1463
          InitCaptureCountL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1464
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1465
        // Start capture operation NOW
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1466
        iSelfTimer->StartSelfTimer();            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1467
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1468
        if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1469
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1470
          CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1471
          if (toolbar)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1472
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1473
            toolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1474
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1475
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1476
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1477
        iPreventActivePaletteDisplay = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1478
        SetActivePaletteVisibility( EFalse );           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1479
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1480
        // Update CBA
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  1481
        UpdateCba();
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1482
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1483
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1484
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1485
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1486
    case ECamCmdSelfTimerCancel:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1487
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1488
      // Called when the user clicks "Cancel" to leave self-timer mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1489
      SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1490
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1491
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1492
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1493
    case ECamCmdSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1494
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1495
      // Turn off the courtesy timer if its active so that the softkeys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1496
      // will remain active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1497
      if( iCourtesyTimer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1498
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1499
        iCourtesyTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1500
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1501
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1502
      iReturnedFromPlugin = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1503
      iSettingsPluginLaunched = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1504
      SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1505
      CCamViewBase* precapView = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1506
      if ( iView == iStillCaptureView ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1507
          iView == iVideoCaptureView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1508
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1509
        precapView = static_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1510
        __ASSERT_DEBUG(precapView, CamPanic(ECamPanicNullPointer));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1511
		precapView->BlankSoftkeysL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1512
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1513
      iTargetViewState = ECamViewStateSettings;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1514
      if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1515
         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1516
          CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1517
          if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1518
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1519
              toolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1520
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1521
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1522
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1523
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1524
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1525
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1526
    case ECamCmdSelect:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1527
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1528
      PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSelect"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1529
      if ( iEikonEnv->StartedAsServerApp() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1530
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1531
        const TDesC& name( iController.CurrentFullFileName() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1532
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1533
        PRINT1( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSelect %S"), &name )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1534
        iEmbeddedObserver->FileCompleteL( name );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1535
        iController.EnterShutdownMode( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1536
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1537
/*#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1538
      else if ( iSendFileInCall )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1539
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1540
        PRINT( _L("CCamAppUi::HandleCommandL SendMedia file") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1541
        // handle in-call send interaction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1542
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1543
        // Sending of captured media file and to return to call view after sending        			
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1544
        BringPhoneAppToForeGroundL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1545
        DoInCallSendL();			  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1546
        HideTaskL( ETrue ); // otherwise camera would show in "Active Applications"   		
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1547
        iPretendExit = ETrue; // we are basicly in a "pretended exit" state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1548
        //BringPhoneAppToForeGroundL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1549
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1550
#endif*/               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1551
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1552
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1553
        // ACS What do we need to do here? Call internal exit?
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1554
        // this will exit when any current process completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1555
        iController.EnterShutdownMode( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1556
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1557
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1558
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1559
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1560
    case EAknSoftkeyEmpty: // Must handle this key, but do nothing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1561
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1562
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1563
    case ECamCmdPhotos:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1564
      { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1565
      iController.ReleaseCamera();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1566
      TUid msgUidLastModified(TUid::Uid(KGlxActivationCmdShowLastModified));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1567
      TUid msgUidCameraAlbum(TUid::Uid(KGlxActivationCameraAlbum));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1568
      TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1569
      TApaTask apaTask = apaTaskList.FindApp( TUid::Uid( KGlxGalleryApplicationUid) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1570
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1571
      TBuf8<100> buffer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1572
      RDesWriteStream stream( buffer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1573
      CleanupClosePushL( stream );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1574
      stream.Open( buffer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1575
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1576
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1577
      if ( ECamViewStatePreCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1578
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1579
          stream << msgUidCameraAlbum;          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1580
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1581
      else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1582
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1583
          stream << msgUidLastModified;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1584
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1585
      stream.CommitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1586
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1587
      //Hide fixed toolbar before calling to start photos.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1588
      if ( iController.IsTouchScreenSupported() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1589
           IsSecondCameraEnabled() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1590
           iViewState == ECamViewStatePreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1591
          {         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1592
          CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1593
          if ( fixedToolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1594
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1595
              fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1596
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1597
          //Bitmap mode's VF consumes much of CPU in second camera, stop VF in advance to accelerate switching to photos.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1598
          iController.StopViewFinder(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1599
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1600
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1601
      if ( apaTask.Exists() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1602
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1603
          // sending APA task message
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1604
          apaTask.SendMessage( TUid::Uid( KGlxActivationCmdShowLastModified ), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1605
                                          buffer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1606
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1607
      else // Photos Application is not running
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1608
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1609
          StartAppCmdLineL( buffer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1610
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1611
      CleanupStack::PopAndDestroy( &stream );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1612
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1613
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1614
      // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1615
      // This should only be available when time lapse is not supported    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1616
      // so the current mode should be still or multi
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1617
    case ECamCmdToggleMulti:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1618
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1619
      if ( iImageMode == ECamImageCaptureSingle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1620
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1621
        TRAPD( ignore, SwitchStillCaptureModeL( ECamImageCaptureBurst, ETrue ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1622
        if ( ignore )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1623
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1624
            // do nothing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1625
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1626
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1627
      else if ( iImageMode == ECamImageCaptureBurst )   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1628
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1629
        SwitchStillCaptureModeL( ECamImageCaptureSingle, ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1630
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1631
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1632
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1633
        // Lint
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1634
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1635
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1636
      // Update timelapse interval
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1637
      iController.SetTimeLapseInterval( 0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1638
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1639
      // stop and start the viewfinder in order to update the settings   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1640
      iController.ExitViewfinderMode( ECamControllerImage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1641
      iController.EnterViewfinderMode( ECamControllerImage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1642
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1643
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1644
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1645
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1646
    // Toggle facetracking setting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1647
    case ECamCmdToggleFacetracking:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1648
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1649
      if ( iController.UiConfigManagerPtr()->IsFaceTrackingSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1650
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1651
        if ( iController.IntegerSettingValue( ECamSettingItemFaceTracking ) == ECamSettOn )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1652
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1653
            iController.SetIntegerSettingValueL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1654
                                         ECamSettingItemFaceTracking,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1655
                                         ECamSettOff );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1656
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1657
        else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1658
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1659
            iController.SetIntegerSettingValueL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1660
                                         ECamSettingItemFaceTracking,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1661
                                         ECamSettOn );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1662
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1663
        iController.TryAFRequest( ECamRequestCancelAutofocus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1664
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1665
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1666
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1667
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1668
    // Switch to single capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1669
    case ECamCmdSingleCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1670
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1671
      SwitchStillCaptureModeL( ECamImageCaptureSingle, ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1672
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1673
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1674
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1675
    // Activate burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1676
    case ECamCmdSequence:       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1677
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1678
      SwitchStillCaptureModeL( ECamImageCaptureBurst, ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1679
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1680
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1681
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1682
    // Activate time lapse mode    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1683
    case ECamCmdTimeLapse:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1684
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1685
      SwitchStillCaptureModeL( ECamImageCaptureTimeLapse, ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1686
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1687
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1688
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1689
    case ECamCmdOpenPhoto:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1690
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1691
      if(iViewState == ECamViewStateBurstThumbnail )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1692
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1693
        iTargetViewState = ECamViewStatePostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1694
        TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1695
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1696
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1697
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1698
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1699
    case ECamCmdUserScene:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1700
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1701
      iTargetViewState = ECamViewStateUserSceneSetup;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1702
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1703
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1704
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1705
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1706
    case ECamCmdPlay:   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1707
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1708
      PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. case ECamCmdPlay, iVideoClipPlayInProgress:%d"), iVideoClipPlayInProgress);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1709
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1710
      if ( !iVideoClipPlayInProgress)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1711
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1712
        TInt           err;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1713
        TDataType dataType( K3gpVideoMimeType );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1714
#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1715
        TCamVideoFileType fileType = static_cast< TCamVideoFileType > 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1716
            ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1717
        if ( fileType == ECamVideoMpeg4 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1718
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1719
            PRINT(_L("Camera <> CCamAppUi::HandleCommandL. case ECamCmdPlay D"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1720
            dataType=TDataType( KMp4VideoMimeType );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1721
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1722
#endif                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1723
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1724
        SetEmbedding( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1725
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1726
        err = iDocHandler->OpenFileEmbeddedL( iController.CurrentFullFileName(),  dataType );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1727
        PRINT1(_L("Camera <=> CCamAppUi::HandleCommandL. iDocHandler ->OpenFileEmbeddedL err:%d"), err);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1728
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1729
        if ( KErrNone == err)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1730
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1731
            iVideoClipPlayInProgress = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1732
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1733
        }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1734
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1735
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1736
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1737
     // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1738
     case ECamCmdSwitchCamera:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1739
         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1740
         PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1741
         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1742
         // By now it safe to assume that we are no longer returning from a pretended exit.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1743
         PRINT( _L("Camera <> Set iReturningFromPretendExit = EFalse") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1744
         iReturningFromPretendExit = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1745
         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1746
         //If modechange sequence going on ignore switching...
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1747
         if( iController.CaptureModeTransitionInProgress() ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1748
             iController.CaptureState() != ECamCaptureOff || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1749
             iController.IsSavingInProgress() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1750
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1751
             PRINT( _L("Camera <= CCamAppUi::HandleCommandL STOP ECamCmdSwitchCamera" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1752
             iController.SetCameraSwitchRequired( ESwitchDone );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1753
             break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1754
             } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1755
         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1756
         // Hide fixed toolbar and softkeys to prevent blinking
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1757
         if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1758
             {         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1759
             CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1760
             if ( fixedToolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1761
                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1762
                 fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1763
                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1764
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1765
         CCamViewBase* precapView = static_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1766
		 __ASSERT_DEBUG( precapView, CamPanic( ECamPanicNullPointer ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1767
         if ( precapView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1768
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1769
             precapView->ViewCba()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1770
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1771
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1772
         PRINT( _L("Camera <> CCamAppUi::HandleCommandL continue ECamCmdSwitchCamera" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1773
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1774
         if ( ActiveCamera() == ECamActiveCameraPrimary && IsBurstEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1775
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1776
             SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1777
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1778
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1779
         TInt primaryOrientation   = EAppUiOrientationUnspecified;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1780
         TInt secondaryOrientation = EAppUiOrientationUnspecified;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1781
         TCamPsiKey orientation = IsQwerty2ndCamera( ETrue )?     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1782
                                  ECamPsiPrimaryCameraOrientation:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1783
                                  ECamPsiSecondaryCameraOrientation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1784
         if ( !CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1785
                                      primaryOrientation ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1786
              !CamUtility::GetPsiInt( orientation, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1787
                                      secondaryOrientation ) )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1788
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1789
             if ( primaryOrientation != secondaryOrientation || IsQwerty2ndCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1790
                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1791
                 if( ( !IsSecondCameraEnabled() || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1792
                       iController.CameraSwitchQueued() == ESwitchSecondaryOrientation ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1793
                     !IsQwerty2ndCamera() )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1794
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1795
                     PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera 2ndary portrait" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1796
                     iCamOrientation = ECamOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1797
                     SetOrientationL( static_cast<TAppUiOrientation>( secondaryOrientation ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1798
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1799
                     if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1800
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1801
                         iStillCaptureView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR_PORTRAIT );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1802
                         iVideoCaptureView->CreateAndSetToolbarL( R_CAM_VIDEO_PRECAPTURE_TOOLBAR_PORTRAIT );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1803
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1804
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1805
                     StatusPane()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1806
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1807
                 else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1808
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1809
                     PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera 1ary or 2nd landscape" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1810
                     iCamOrientation = (iSoftkeyPosition == ECamHandLeft)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1811
                     ? ECamOrientationCamcorderLeft
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1812
                         : ECamOrientationCamcorder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1813
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1814
                     SetOrientationL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1815
                        static_cast<TAppUiOrientation>( primaryOrientation ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1816
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1817
                     if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1818
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1819
                         if ( ( !IsSecondCameraEnabled() || iController.CameraSwitchQueued() == ESwitchSecondaryOrientation ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1820
                               IsQwerty2ndCamera() )   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1821
                            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1822
                            iStillCaptureView->CreateAndSetToolbarL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1823
                                    R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1824
                            iVideoCaptureView->CreateAndSetToolbarL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1825
                                    R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1826
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1827
                         else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1828
                            { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1829
                            iStillCaptureView->CreateAndSetToolbarL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1830
                                    R_CAM_STILL_PRECAPTURE_TOOLBAR );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1831
                            if(iController.UiConfigManagerPtr()->IsXenonFlashSupported())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1832
                                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1833
                                iVideoCaptureView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1834
                                iVideoCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1835
                                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1836
                            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1837
                                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1838
                                iVideoCaptureView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1839
                                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1840
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1841
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1842
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1843
                     StatusPane()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1844
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1845
                 UpdateNaviModelsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1846
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1847
                 //Reset zoom when changing cameras
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1848
                 ZoomPane()->ResetZoomTo1x(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1849
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1850
                 TInt rl( 0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1851
                 for ( rl = 0; rl < iResourceLoaders.Count(); rl++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1852
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1853
                     iResourceLoaders[rl]->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1854
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1855
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1856
                 iCamSidePane->UpdateLayout();          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1857
                 iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1858
                 TrySwitchViewL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1859
                 iController.SwitchCameraL();       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1860
                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1861
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1862
         }                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1863
         break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1864
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1865
    case EAknCmdHelp:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1866
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1867
      LaunchHelpL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1868
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1869
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1870
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1871
    case ECamCmdRedrawScreen:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1872
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1873
      if( !iProcessingScreenRedraw && iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1874
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1875
        iProcessingScreenRedraw = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1876
        iView->HandleCommandL(ECamCmdRedrawScreen);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1877
        iProcessingScreenRedraw = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1878
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1879
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1880
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1881
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1882
    case ECamCmdRedrawVideoTime:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1883
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1884
      if( !iProcessingScreenRedraw && iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1885
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1886
        iProcessingScreenRedraw = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1887
        iView->HandleCommandL(ECamCmdRedrawVideoTime);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1888
        iProcessingScreenRedraw = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1889
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1890
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1891
      break;      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1892
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1893
    case ECamCmdRedrawZoom:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1894
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1895
      if( !iProcessingScreenRedraw && iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1896
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1897
        iProcessingScreenRedraw = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1898
        iView->HandleCommandL(ECamCmdRedrawZoom);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1899
        iProcessingScreenRedraw = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1900
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1901
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1902
      break;            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1903
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1904
    case ECamCmdShootSetup: // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1905
    case ECamCmdFlash:      // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1906
    case ECamCmdAddAudio:   // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1907
    case ECamCmdEdit:       // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1908
    case ECamCmdPrint:      // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1909
    case ECamCmdSendToCallerMultimedia: // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1910
    case ECamCmdRenameImage:            // fall through
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1911
    case ECamCmdRenameVideo:            // fall through        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1912
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1913
      User::Leave( KErrNotSupported );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1914
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1915
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1916
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1917
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1918
    case ECamCmdViewfinderGrid:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1919
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1920
      SelectViewFinderGridSettingL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1921
      break;     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1922
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1923
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1924
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1925
    case EAknCmdTaskSwapper:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1926
    	/*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1927
    	* MSK: Active Applications
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1928
    	* This command is actually handled by Avkon FW
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1929
    	* Applications should not handle this
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1930
    	*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1931
    	break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1932
    //-------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1933
    default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1934
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1935
      PRINT( _L("Camera <> CCamAppUi::HandleCommandL does nothing") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1936
      } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1937
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1938
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1939
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1940
    PRINT( _L("Camera <= CCamAppUi::HandleCommandL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1941
  } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1942
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1943
// ===========================================================================
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1944
// From MCamCameraObserver
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1945
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1946
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1947
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1948
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1949
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1950
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1951
CCamAppUi::HandleCameraEventL( TInt              /*aStatus*/, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1952
                               TCamCameraEventId  aEventId, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1953
                               TAny*             /*aEventData //= NULL */
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1954
                             )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1955
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1956
  switch( aEventId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1957
    {        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1958
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1959
    case ECamCameraEventVfStart: // ECamEventViewFinderStarted
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1960
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1961
      PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventVfStart" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1962
      if( iScreenClearer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1963
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1964
        delete iScreenClearer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1965
        iScreenClearer = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1966
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1967
#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1968
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1969
      // Construct postcapture views when idle  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1970
      // or latest when view switch is requested
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1971
      StartPostCapIdleL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1972
#else               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1973
      TRAPD( err, ConstructPostCaptureViewsL() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1974
      if ( KErrNone != err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1975
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1976
        TRAP_IGNORE( HandleCameraErrorL( err ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1977
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1978
        // if embedded need to notify embeddee
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1979
        if ( iEikonEnv->StartedAsServerApp() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1980
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1981
          iEmbeddedObserver->AbortL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1982
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1983
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1984
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1985
          CloseAppL();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1986
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1987
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1988
#endif            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1989
      // Only show the Active Palette once viewfinding has started
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1990
      iPreventActivePaletteDisplay = EFalse;     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1991
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1992
      // For forced focus scenes, do one autofocus request once vf starts if needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1993
      if( iController.UiConfigManagerPtr()->IsAutoFocusSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1994
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1995
        if( iController.CurrentSceneHasForcedFocus() ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1996
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1997
            PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL, TryAFRequest( ECamRequestCancelAutofocus )") );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1998
            //Only autofocuscancel will set AFrange which is needed for forced focus cases
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1999
            iController.TryAFRequest( ECamRequestCancelAutofocus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2000
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2001
        else // For scenes with reticule cancel the autofocus, which sets the focus correctly
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2002
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2003
            if ( iController.UiConfigManagerPtr()->IsAutofocusSetInHyperfocalAtStartup() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2004
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2005
                PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL, TryAFRequest( ECamRequestCancelAutofocus )") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2006
                iController.TryAFRequest( ECamRequestCancelAutofocus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2007
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2008
            else if ( !iFirstVFStart )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2009
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2010
                iController.TryAFRequest( ECamRequestCancelAutofocus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2011
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2012
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2013
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2014
     else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2015
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2016
        SetToolbarVisibility();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2017
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2018
      iFirstVFStart = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2019
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2020
      PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL updating CBA") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2021
      UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2022
      break;              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2023
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2024
      // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2025
      case ECamCameraEventVideoAsyncStop: // Audio and video streams are stopped
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2026
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2027
        PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventVideoAsyncStop" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2028
        // Stop View finder if not needed to left run
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2029
        if ( iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2030
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2031
          iController.StopViewFinderEcam();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2032
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2033
        // Check if currently selected storagemedia has available memory for next capturing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2034
        // unless incoming call has stopped recording
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2035
        if ( !iController.InCallOrRinging() && !iController.InVideocallOrRinging() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2036
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2037
            CheckMemoryAvailableForCapturing();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2038
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2039
        break;              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2040
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2041
    // -----------------------------------------------------        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2042
    case ECamCameraEventPowerOnRequested:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2043
    case ECamCameraEventReserveRequested:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2044
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2045
      // event only send if UIOrientationOverride feature is supported,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2046
      // in that case UI construction is divided into two parts, call here 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2047
      // to complete the construction	if in first startup
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2048
      if( iFirstBoot )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2049
          {	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2050
          PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventReserveRequested/ECamCameraEventPowerOnRequested" ) )	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2051
          // in embedded mode appui construct timer started already
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2052
          if ( !IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2053
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2054
              if ( iWaitTimer->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2055
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2056
                  PRINT( _L( "Camera <> timer already active" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2057
                  iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2058
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2059
              PRINT( _L( "Camera <> start the appui construct timer" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2060
              iWaitTimer->Start( 0, 0,  TCallBack( AppUIConstructCallbackL, this ) );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2061
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2062
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2063
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2064
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2065
          //load settings in case they were changed via GS	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2066
          iController.LoadStaticSettingsL( IsEmbedded() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2067
          if ( iController.CurrentMode() == ECamControllerImage 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2068
                  || iController.TargetMode() == ECamControllerImage )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2069
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2070
              iStillCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2071
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2072
     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2073
          // and check the availability of the memory to be used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2074
          iController.CheckMemoryToUseL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2075
          }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2076
      break;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2077
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2078
    default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2079
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2080
      break;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2081
      }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2082
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2083
    }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2084
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2085
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2086
// ===========================================================================
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2087
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2088
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2089
// CCamAppUi::HandleControllerEventL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2090
// Handle controller events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2091
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2092
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2093
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2094
CCamAppUi::HandleControllerEventL( TCamControllerEvent aEvent, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2095
                                   TInt                aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2096
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2097
  PRINT1( _L( "Camera => CCamAppUi::HandleControllerEventL() %d" ), aEvent ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2098
  switch ( aEvent )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2099
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2100
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2101
    case ECamEventExitRequested:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2102
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2103
      PRINT( _L( "Camera <> case ECamEventExitRequested" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2104
      if ( SettingsLaunchedFromCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2105
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2106
        SettingsPluginExitedL( ECameraCompleteExit ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2107
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2108
      if ( iWaitTimer->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2109
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2110
        PRINT( _L( "Camera <> timer already active" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2111
        iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2112
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2113
      PRINT( _L( "Camera <> start the exit timer" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2114
      iWaitTimer->Start( 0, 0,  TCallBack( CallExit, this ) );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2115
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2116
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2117
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2118
    case ECamEventOperationStateChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2119
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2120
      PRINT( _L("Camera <> case ECamEventOperationStateChanged") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2121
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2122
      switch ( iController.CurrentOperation() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2123
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2124
        case ECamFocusing:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2125
          UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2126
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2127
        case ECamCapturing:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2128
          iPreventActivePaletteDisplay = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2129
          SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2130
          //Image capture has started. If postcaptureview is enabled assume that postcapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2131
          //is next view. Thus if camera goes to background and comes back to foreground don't
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2132
          //start viewfinder because it is not needed in postcapture view. If image capture fails
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2133
          //or is canceled enabling viewfinder is possible.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2134
          if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2135
                  && ShowPostCaptureView() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2136
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2137
              SetAssumePostCaptureView( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2138
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2139
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2140
        case ECamStandby:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2141
          //DismissMemoryNote();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2142
          HandleStandbyEventL( aError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2143
          break;         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2144
        case ECamNoOperation:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2145
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2146
            if( iPreventActivePaletteDisplay )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2147
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2148
                iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2149
                }            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2150
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2151
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2152
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2153
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2154
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2155
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2156
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2157
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2158
    case ECamEventRecordComplete:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2159
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2160
      PRINT( _L("Camera <> case ECamEventRecordComplete") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2161
      // Dismiss the saving video clip wait dialog
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2162
      if ( iWaitDialog )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2163
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2164
        iWaitDialog->ProcessFinishedL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2165
        //iWaitDialog = NULL; //ProcessFinishedL() will make iWaitDialog NULL asynchronously
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2166
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2167
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2168
      // switch on active palette recording is complete
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2169
      if( ECamOrientationCamcorder     == iCamOrientation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2170
       || ECamOrientationCamcorderLeft == iCamOrientation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2171
       || ECamOrientationPortrait      == iCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2172
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2173
        iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2174
        if ( DrawPreCaptureCourtesyUI() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2175
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2176
          SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2177
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2178
        } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2179
      if ( iController.InCallOrRinging() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2180
           iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2181
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2182
        // when video recording is stopped by incoming call
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2183
        // and post capture view is turned on, post capture timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2184
        // should only start after some user interaction
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2185
        iDelayVideoPostCaptureTimeout = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2186
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2187
      }            //lint -fallthrough to switch to post capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2188
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2189
    case ECamEventSnapshotReady:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2190
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2191
      PRINT( _L("Camera <> case ECamEventSnapshotReady") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2192
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2193
      // If burst mode is active, do nothing until the whole burst completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2194
      if ( IsBurstEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2195
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2196
        // handle error if necessary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2197
        HandleCameraErrorL( aError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2198
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2199
        // Check if there was an error, and there were no successful
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2200
        // captures.  In this case, we will be staying in pre-capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2201
        // so allow the active palette to be displayed again
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2202
        if ( aError != KErrNone &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2203
             iController.CurrentItemCount() == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2204
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2205
          iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2206
          SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2207
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2208
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2209
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2210
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2211
      // if the MMC has been removed while recording video to it, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2212
      // don't go to post-capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2213
      else if ( iMode == ECamControllerVideo
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2214
                && iController.IntegerSettingValueUnfiltered( ECamSettingItemVideoMediaStorage ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2215
                    == ECamMediaStorageCard 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2216
                && ( aError != KErrNone && aError != KErrDiskFull )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2217
                && CamUtility::MemoryCardStatus() != ECamMemoryCardInserted )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2218
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2219
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2220
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2221
      // if USB was connected while MMC or mass storage was used as storage, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2222
      // don't go to postcapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2223
      else if ( CamUtility::IsUsbActive() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2224
                ( iController.CurrentStorage() == ECamMediaStorageCard ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2225
                iController.CurrentStorage() == ECamMediaStorageMassStorage ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2226
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2227
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2228
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2229
      else if ( iController.IsCaptureStoppedForUsb() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2230
                ( iController.CurrentStorage() == ECamMediaStorageCard ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2231
                iController.CurrentStorage() == ECamMediaStorageMassStorage ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2232
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2233
        PRINT( _L("Camera <> HandleControllerEventL ECamEventSnapshotReady: video stopped for usb" ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2234
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2235
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2236
      // If there was an error (we have no snap), we must stay in pre-capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2237
      else if ( aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2238
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2239
        iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2240
        SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2241
        iController.SetCaptureKeyPressedWhileImageSaving(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2242
        // To be able to continue viewfinding
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2243
        iController.FreezeViewFinder( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2244
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2245
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2246
        }               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2247
      // If the user has the show captured image setting turned on.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2248
      // switch to post capture view (Except in burst mode)            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2249
      else if ( ShowPostCaptureView() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2250
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2251
          if( iController.CaptureKeyPressedWhileImageSaving() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2252
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2253
              PRINT( _L("Camera <> HandleControllerEventL ECamEventSnapshotReady - Capture key pressed while saving ") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2254
              iController.SetCaptureKeyPressedWhileImageSaving(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2255
              iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2256
              SetSuppressUIRiseOnViewfinderStart( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2257
              // To be able to continue viewfinding
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2258
              iController.FreezeViewFinder( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2259
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2260
          else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2261
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2262
              if ( !CamUtility::IsBatteryPowerEmpty() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2263
                { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2264
                if ( iLensCoverExit )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2265
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2266
                  PRINT (_L ("Camera <> set target to precapture if Battery not Empty") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2267
                  iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2268
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2269
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2270
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2271
                  PRINT (_L ("Camera <> set target to postcapture if Battery not Empty") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2272
                  iTargetViewState = ECamViewStatePostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2273
				  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2274
                  //We need to blank the precapture view CBA here to prevent
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2275
                  //blinking when changing back to precapture from postcapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2276
                  UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2277
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2278
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2279
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2280
          if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2281
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2282
              // This is set to false when StartCaptureL() is run
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2283
              iSelfTimedCapture = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2284
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2285
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2286
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2287
      // Always switch to post capture view if self timer is enabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2288
      else if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2289
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2290
          iTargetViewState = ECamViewStatePostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2291
          // ensure that the view doesn't switch to precapture view when
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2292
          // ECamEventCaptureComplete is received
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2293
          iSelfTimedCapture = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2294
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2295
      // Otherwise, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2296
      // if not showing captured images go straight to pre capture view 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2297
      // (Except in burst mode)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2298
      else               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2299
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2300
          iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2301
          SetSuppressUIRiseOnViewfinderStart( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2302
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2303
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2304
      // The app is not going to try to switch to post capture view at all
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2305
      // so the array needs to be released now.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2306
      if ( iTargetViewState == ECamViewStatePreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2307
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2308
          iController.ReleaseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2309
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2310
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2311
      // If no view switch is needed make sure the cba is not disabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2312
      // and the self timer is switched off
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2313
      if ( ViewSwitchRequired() != ECamViewSwitch )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2314
          {                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2315
          if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2316
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2317
              SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2318
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2319
          UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2320
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2321
      TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2322
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2323
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2324
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2325
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2326
    case ECamEventCaptureComplete:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2327
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2328
      PRINT( _L("Camera <> case ECamEventCaptureComplete") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2329
      // check if exit is required
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2330
      if ( iController.CheckExitStatus() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2331
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2332
        PRINT( _L("Camera <> calling internal exit after checking exit status") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2333
        // The exit event is replacing the view switch, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2334
        // so  release the array now
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2335
        iController.ReleaseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2336
        InternalExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2337
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2338
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2339
      if( ECamControllerImage == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2340
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2341
        switch( iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2342
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2343
          // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2344
          // If burst mode is active, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2345
          // only switch view when the whole burst completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2346
          case ECamImageCaptureBurst:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2347
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2348
            // If there are images to show (i.e. user has not cancelled), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2349
            // switch to thumbnail view. "Show captured images" setting has no
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2350
            // effect in burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2351
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2352
            if ( iController.CurrentItemCount() != 0 && !iController.IsCaptureStoppedForUsb() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2353
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2354
              iTargetViewState = ECamViewStateBurstThumbnail;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2355
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2356
              // Normally iPreventActivePaletteDisplay is set to EFalse when
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2357
              // postcture AP is shown, but in burst case that doesn't
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2358
              // necessarily happen so do this here.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2359
              iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2360
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2361
            // Otherwise, no images to show. Go straight to pre capture view. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2362
            else               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2363
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2364
              iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2365
              // The app is not going to try to switch to post capture view at 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2366
              // all. So the array needs to be released now.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2367
              iController.ReleaseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2368
              iController.StopViewFinder(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2369
              iController.StartViewFinder();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2370
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2371
            // If no view switch is needed make sure the cba is not disabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2372
            // and the self timer is switched off
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2373
            if ( ViewSwitchRequired() != ECamViewSwitch )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2374
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2375
              if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2376
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2377
                SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2378
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2379
                UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2380
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2381
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2382
            TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2383
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2384
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2385
          // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2386
          case ECamImageCaptureTimeLapse:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2387
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2388
            iTargetViewState = ECamViewStatePostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2389
            TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2390
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2391
            }      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2392
          // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2393
          case ECamImageCaptureSingle:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2394
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2395
            PRINT( _L("Camera <> case ECamImageCaptureSingle") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2396
            if( aError != KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2397
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2398
              PRINT( _L("Camera <> error received") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2399
              // handle error if necessary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2400
              HandleCameraErrorL( aError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2401
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2402
              iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2403
              SetActivePaletteVisibility( ETrue );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2404
                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2405
   			  if (iCamOrientation == ECamOrientationPortrait) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2406
   			   {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2407
    		   iTargetViewState = ECamViewStatePrePortraitCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2408
   		       }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2409
  			  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2410
     		   {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2411
    		   iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2412
    		   }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2413
            TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2414
              }       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2415
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2416
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2417
              PRINT( _L("Camera <> no errors in") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2418
              if ( !ShowPostCaptureView() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2419
                   iInSelfTimerMode == ECamSelfTimerDisabled && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2420
                   !IsSelfTimedCapture() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2421
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2422
                PRINT( _L("Camera <> update cba") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2423
                UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2424
				if( ActiveCamera() != ECamActiveCameraPrimary )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2425
					{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2426
	                PRINT( _L("Camera <> release array") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2427
	                iController.ReleaseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2428
					}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2429
                iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2430
                SetActivePaletteVisibility( ETrue );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2431
                if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2432
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2433
                    CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2434
                    if ( fixedToolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2435
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2436
                        fixedToolbar->SetToolbarVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2437
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2438
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2439
                HandleCommandL( ECamCmdRaiseCourtesyUI );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2440
                if ( IsSecondCameraEnabled() || IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2441
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2442
                    //For secondary or embedded camera the viewfinder
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2443
                    //was stopped. Restart it now.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2444
                    iController.StartViewFinder(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2445
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2446
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2447
              else if ( !ShowPostCaptureView() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2448
                       iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2449
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2450
                SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2451
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2452
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2453
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2454
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2455
          // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2456
          default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2457
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2458
            // do nothing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2459
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2460
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2461
          // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2462
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2463
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2464
            // reset the selftimed capture flag for next capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2465
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2466
      }     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2467
    // -----------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2468
    case ECamEventControllerReady: 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2469
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2470
        if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2471
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2472
            if ( iFirstBoot && IsSecondCameraEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2473
                            && IsQwerty2ndCamera()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2474
                            && CurrentViewState() != ECamViewStateStandby )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2475
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2476
                PRINT( _L("Camera <> Booting directly to the secondary camera") )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2477
                // Main camera settings are loades as default. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2478
                // Need to be updated to secondary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2479
                iStillCaptureView->CreateAndSetToolbarL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2480
                                    R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2481
                iVideoCaptureView->CreateAndSetToolbarL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2482
                                    R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2483
                // Add toolbar observer. Needed in first boot to secondary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2484
                SetPreCaptureMode( ECamPreCapViewfinder ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2485
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2486
            iFirstBoot = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2487
            // Do not show zoom pane when toolbar extension is visible
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2488
            if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2489
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2490
                CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2491
                if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2492
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2493
                    CAknToolbarExtension* toolbarextension =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2494
                    toolbar->ToolbarExtension();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2495
                    if ( toolbarextension && !toolbarextension->IsShown() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2496
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2497
                        iView->HandleCommandL( ECamCmdPopUpMenuZoom );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2498
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2499
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2500
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2501
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2502
        //Remaining recording time counter update needed when recording has stopped and
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2503
        //show last captured video setting is off.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2504
        if( iNaviPaneCounterControl && !ShowPostCaptureView() && iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2505
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2506
            iNaviPaneCounterControl->ForceNaviPaneUpdate();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2507
            }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2508
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2509
        }      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2510
    // -----------------------------        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2511
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2512
    // The MMC is removed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2513
    case ECamEventMemoryCardHotswap:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2514
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2515
        TBool mmcInUse = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2516
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2517
        TCamMediaStorage currentLocation = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2518
            static_cast<TCamMediaStorage>( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2519
            iController.IntegerSettingValueUnfiltered( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2520
                                          ECamSettingItemVideoMediaStorage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2521
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2522
        // if app is in back show MMC note on returning to foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2523
        PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2524
        if ( currentLocation == ECamMediaStorageCard )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2525
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2526
            if ( AppInBackground( ETrue ) && iReturnFromBackground )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2527
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2528
                PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap bckgrn") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2529
                //iMMCRemoveNoteRequired = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2530
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2531
                // Force use of phone memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2532
                // with multiple drive support, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2533
                // this actually uses the internal mass memory
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2534
               iController.UsePhoneMemoryL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2535
               }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2536
        else // show note on next capture attempt
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2537
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2538
            PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap not bckgrnd") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2539
            iMMCRemoveNoteRequiredOnCapture = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2540
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2541
            // force update of navi pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2542
            iNaviPaneCounterControl->ForceNaviPaneUpdate();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2543
            if ( IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2544
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2545
                TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2546
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2547
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2548
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2549
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2550
        // if the current mode is video, and the storage location is MMC
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2551
        if ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2552
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2553
            mmcInUse = (ECamMediaStorageCard == currentLocation);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2554
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2555
           // if the current mode is still, and the storage location is MMC
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2556
        else        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2557
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2558
            mmcInUse = ( ECamMediaStorageCard == 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2559
                       iController.IntegerSettingValueUnfiltered( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2560
                           ECamSettingItemPhotoMediaStorage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2561
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2562
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2563
        // If a post capture view is active, and the current files
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2564
        // are saved to the MMC, switch to pre capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2565
        if ( mmcInUse
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2566
             && ( ECamViewStateBurstThumbnail == iViewState
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2567
             || ECamViewStatePostCapture    == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2568
           )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2569
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2570
            if (iCamOrientation == ECamOrientationPortrait) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2571
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2572
                iTargetViewState = ECamViewStatePrePortraitCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2573
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2574
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2575
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2576
                iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2577
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2578
            TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2579
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2580
        break;            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2581
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2582
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2583
    case ECamEventCounterUpdated:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2584
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2585
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2586
    case ECamEventVideoPauseTimeout:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2587
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2588
        PRINT( _L( "Camera <> case ECamEventVideoPauseTimeout" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2589
        EndCapture();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2590
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2591
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2592
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2593
    case ECamEventSaveLocationChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2594
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2595
        PRINT( _L( "Camera <> case ECamEventSaveLocationChanged" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2596
        DismissMemoryNoteL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2597
        if ( IsMMCRemovedNotePending() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2598
           ( CamUtility::MemoryCardStatus() != ECamMemoryCardNotInserted ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2599
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2600
            iMMCRemoveNoteRequired = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2601
            iMMCRemoveNoteRequiredOnCapture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2602
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2603
        if ( IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2604
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2605
            TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2606
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2607
        if ( ECamViewStatePostCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2608
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2609
            iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2610
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2611
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2612
        }   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2613
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2614
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2615
    case ECamEventSaveComplete:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2616
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2617
        PRINT( _L( "Camera <> case ECamEventSaveComplete" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2618
        // Check if currently selected storagemedia has available memory for next capturing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2619
        // unless saving just started
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2620
        if( !iController.IsSaveStarted() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2621
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2622
            CheckMemoryAvailableForCapturing();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2623
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2624
        if ( ECamImageCaptureSingle == iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2625
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2626
            if( iController.CaptureKeyPressedWhileImageSaving() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2627
                ShowPostCaptureView())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2628
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2629
                PRINT( _L("Camera <> HandleControllerEventL ECamEventSaveComplete - Capture key pressed while saving ") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2630
                iController.SetCaptureKeyPressedWhileImageSaving(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2631
                if (iCamOrientation == ECamOrientationPortrait)  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2632
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2633
                    iTargetViewState = ECamViewStatePrePortraitCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2634
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2635
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2636
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2637
                    iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2638
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2639
               TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2640
               }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2641
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2642
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2643
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2644
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2645
    case ECamEventMediaFileChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2646
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2647
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2648
        if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2649
             !iController.UiConfigManagerPtr()->IsLocationSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2650
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2651
            PRINT2( _L( "Camera <> CCamAppU, ECamEventMediaFileChanged, mode [%s], targetmode[%s]" ), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2652
                KCamModeNames[ iController.CurrentMode() ], 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2653
                KCamModeNames[ iController.TargetMode() ] )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2654
    	  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2655
            if( iEndKeyPressed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2656
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2657
                if ( iController.CurrentMode() == ECamControllerShutdown || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2658
                     iController.IsInShutdownMode() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2659
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2660
                    PRINT( _L( "Camera <> ECamEventMediaFileChanged, notify shutdown" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2661
                    HandleControllerEventL( ECamEventExitRequested, KErrNone );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2662
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2663
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2664
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2665
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2666
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2667
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2668
    case ECamEventCameraChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2669
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2670
        PRINT( _L("Camera <> case ECamEventCameraChanged"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2671
        // exit standby and use the new camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2672
        if( iView)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2673
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2674
            iView->HandleCommandL( ECamCmdExitStandby );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2675
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2676
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2677
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2678
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2679
    case ECamEventInvalidMemoryCard:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2680
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2681
        PRINT( _L( "Camera <> case ECamEventInvalidMemoryCard" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2682
        ShowErrorNoteL( ECamMemoryStatusCardNotInserted );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2683
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2684
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2685
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2686
    case ECamEventRestoreCameraSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2687
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2688
        PRINT( _L( "Camera <> case ECamEventRestoreCameraSettings" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2689
        if ( SettingsLaunchedFromCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2690
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2691
            iSettingsPluginLaunched = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2692
            iReturnedFromPlugin = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2693
            } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2694
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2695
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2696
        // get start up mode from settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2697
        if ( StartupMode() == ECamStillCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2698
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2699
            iMode       = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2700
            iTargetMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2701
            SetDefaultViewL( *iStillCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2702
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2703
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2704
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2705
            iMode       = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2706
            iTargetMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2707
            SetDefaultViewL( *iVideoCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2708
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2709
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2710
        TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2711
        // After restoring settings, still capture view should be active 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2712
        // -> Update all toolbar icons for still-capture view. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2713
        iStillCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2714
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2715
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2716
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2717
    case ECamEventCallStateChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2718
        SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2719
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2720
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2721
    default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2722
        break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2723
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2724
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2725
    PRINT( _L( "Camera: <= CCamAppUi::HandleControllerEventL()" ) );         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2726
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2727
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2728
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2729
// HandleStandbyEventL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2730
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2731
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2732
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2733
CCamAppUi::HandleStandbyEventL( TInt aStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2734
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2735
  PRINT( _L( "Camera => CCamAppUi::HandleStandbyEventL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2736
  if( !iPretendExit &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2737
      !AppInBackground( EFalse )  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2738
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2739
    if( ECamViewStateStandby != iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2740
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2741
      DismissMemoryNoteL();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2742
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2743
      if (iStartupLogoController)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2744
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2745
          iStartupLogoController->HideLogo();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2746
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2747
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2748
      if( IsInternalView( iViewState ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2749
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2750
         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2751
        if ( aStatus != KErrInUse &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2752
             iPreCaptureMode == ECamPreCapCaptureSetup ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2753
             iPreCaptureMode == ECamPreCapSceneSetting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2754
             || iPreCaptureMode == ECamPreCapGenericSetting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2755
            )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2756
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2757
            // VF settings does not go to standby state, VF is stopped instead
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2758
            // Screen saver releases resources
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2759
            iViewFinderStopped = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2760
            PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: in one of settings view. Release camera") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2761
            iController.ReleaseCamera();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2762
            //Draw black viewfinder area. Because camera is in internal viewstate view is valid.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2763
            static_cast<CCamViewBase*>( iView )->HandleCommandL( ECamCmdRedrawScreen );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2764
            }         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2765
        else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2766
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2767
            PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: call iView->ExitAllModesL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2768
            PRINT2( _L( "Camera <> CCamAppUi::HandleStandbyEventL: iView = 0x%x, iViewId = %d"), iView, iView->Id().iUid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2769
            // Exit any special modes.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2770
            // If AppUI construction is not finished, do it first, otherwise
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2771
            // the view has not been created yet
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2772
            if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2773
                 iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2774
                 !iUiConstructionComplete )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2775
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2776
              CompleteAppUIConstructionL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2777
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2778
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2779
              {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2780
              if( iView)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2781
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2782
                  CCamViewBase* view  = dynamic_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2783
                  if( view )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2784
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2785
                      view->ExitAllModesL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2786
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2787
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2788
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2789
             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2790
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2791
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2792
      // Not InternalView
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2793
      else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2794
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2795
        PRINT( _L( "Camera <= CCamAppUi::HandleStandbyEventL: Not internalView, standby ignored, return") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2796
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2797
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2798
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2799
      // VF settings does not go to standby state, VF is stopped instead
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2800
      if ( aStatus == KErrInUse || iPreCaptureMode != ECamPreCapCaptureSetup &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2801
           iPreCaptureMode != ECamPreCapSceneSetting   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2802
           && iPreCaptureMode != ECamPreCapGenericSetting )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2803
           {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2804
           PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Set standby status..") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2805
           SetStandbyStatus( aStatus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2806
           if ( iController.InVideocallOrRinging() && iScreenClearer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2807
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2808
             delete iScreenClearer;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2809
             iScreenClearer = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2810
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2811
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2812
           PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Send command ECamCmdGoToStandby..") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2813
           HandleCommandL( ECamCmdGoToStandby );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2814
           }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2815
       }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2816
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2817
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2818
      PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Already in standby, ignored!") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2819
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2820
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2821
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2822
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2823
    PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Camera already in background, no action..") );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2824
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2825
  PRINT( _L( "Camera <= CCamAppUi::HandleStandbyEventL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2826
  } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2827
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2828
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2829
// SetStandbyStatus
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2830
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2831
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2832
void CCamAppUi::SetStandbyStatus( TInt aStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2833
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2834
  PRINT1( _L( "Camera =><= CCamAppUi::SetStandbyStatus( %d )"), aStatus );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2835
  iStandbyStatus = aStatus;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2836
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2837
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2838
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2839
// StandbyStatus
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2840
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2841
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2842
TInt CCamAppUi::StandbyStatus() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2843
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2844
  return iStandbyStatus;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2845
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2846
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2847
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2848
// CCamAppUi::IsEmbedded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2849
// Retrun whether we are embedded or not
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2850
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2851
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2852
TBool CCamAppUi::IsEmbedded() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2853
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2854
  PRINT( _L("Camera => CCamAppUi::IsEmbedded") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2855
/*#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2856
  PRINT1( _L("CCamAppUi::IsEmbedded %d"), iSendFileInCall );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2857
  // treat inCallSend mode as same as embedded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2858
  if( iSendFileInCall )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2859
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2860
    PRINT( _L("CCamAppUi::IsEmbedded iCall" ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2861
    return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2862
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2863
#endif*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2864
  PRINT( _L("Camera <= CCamAppUi::IsEmbedded") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2865
  return iEikonEnv->StartedAsServerApp();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2866
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2867
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2868
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2869
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2870
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2871
// CCamAppUi::HandleWsEventL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2872
// Handle a window server event. Used to handle focus loss
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2873
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2874
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2875
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2876
CCamAppUi::HandleWsEventL( const TWsEvent&    aEvent,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2877
                                 CCoeControl* aDestination )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2878
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2879
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2880
  TInt type = aEvent.Type();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2881
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2882
  PRINT1( _L("Camera => CCamAppUi::HandleWsEventL (type: %d)"), type )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2883
  // In case we receive an enter key event, we should map it to MSK
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2884
  if ( aEvent.Type() == EEventKey && aEvent.Key()->iRepeats == 0 && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2885
       aEvent.Key()->iScanCode == EStdKeyEnter && iViewState != ECamViewStateUserSceneSetup &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2886
       !( iMode == ECamControllerVideo && iViewState == ECamViewStatePreCapture && iController.IsDemandKeyRelease() ) ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2887
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2888
    PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: mapping enter to MSK") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2889
    // Gets the window group id of the app in foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2890
    TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2891
    // if the foreground app is this app
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2892
    if ( windowGroupId == iMyWgId ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2893
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2894
        // enter key should be mapped to MSK.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2895
        TWsEvent  ownEvent = aEvent;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2896
        ownEvent.Key()->iScanCode = EStdKeyDevice3;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2897
        ownEvent.Key()->iCode = EKeyOK;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2898
        iCoeEnv->WsSession().SendEventToWindowGroup(windowGroupId, ownEvent);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2899
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2900
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2901
  // in case we receive a long press of applications key when the self timer is 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2902
  // enabled, we should cancel the self timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2903
  else if ( aEvent.Type() == EEventKey &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2904
            aEvent.Key()->iScanCode == EStdKeyApplication0 &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2905
            aEvent.Key()->iRepeats > 0 && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2906
            SelfTimerEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2907
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2908
        SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2909
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2910
  // in other cases do the normal handling
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2911
  else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2912
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2913
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2914
      switch ( type )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2915
        { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2916
        // a new window group has the focus
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2917
        case EEventFocusGroupChanged:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2918
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2919
          PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusGroupChanged") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2920
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2921
          // When camera looses its focus after going to background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2922
          // during the state of ViaPlayer play back mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2923
          // we dont perform any operation; but return directly      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2924
          if ( iViewState == ECamViewStateViaPlayer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2925
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2926
            // We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2927
            CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2928
            return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2929
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2930
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2931
          // When camera looses its focus after going to background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2932
          // we return to the same settings page that was before       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2933
          if ( SettingsLaunchedFromCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2934
          	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2935
          	// We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2936
          	CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2937
          	return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2938
          	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2939
          // we are going to background no need for harvester callbacks.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2940
          iController.DeRegisterHarverterClientEvents();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2941
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2942
          if ( AppInBackground( ETrue ) && iPretendExit )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2943
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2944
            //Make the current container invisible to prevent windowserver from bringing it to front
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2945
            //before the foreground event.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2946
            TVwsViewId currentViewId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2947
            GetActiveViewId( currentViewId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2948
            switch ( currentViewId.iViewUid.iUid )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2949
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2950
                case ECamViewIdStillPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2951
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2952
                    if( iStillCaptureView->Container() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2953
                        !APHandler()->AccessedViaAP() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2954
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2955
                        iStillCaptureView->Container()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2956
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2957
                    iLastHiddenViewId = currentViewId.iViewUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2958
                    break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2959
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2960
                case ECamViewIdStillPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2961
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2962
                    CCamStillPostCaptureView* stillPostCaptureView = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2963
                    ((CCamStillPostCaptureView*)View( currentViewId.iViewUid ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2964
                    if( stillPostCaptureView && stillPostCaptureView->Container() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2965
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2966
                        stillPostCaptureView->Container()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2967
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2968
                    iLastHiddenViewId = currentViewId.iViewUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2969
                    break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2970
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2971
                case ECamViewIdVideoPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2972
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2973
                    if( iVideoCaptureView->Container() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2974
                        !APHandler()->AccessedViaAP() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2975
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2976
                        iVideoCaptureView->Container()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2977
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2978
                    iLastHiddenViewId = currentViewId.iViewUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2979
                    break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2980
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2981
                case ECamViewIdVideoPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2982
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2983
                    CCamVideoPostCaptureView* videoPostCaptureView = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2984
                     ((CCamVideoPostCaptureView*)View( currentViewId.iViewUid ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2985
                     if( videoPostCaptureView && videoPostCaptureView->Container() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2986
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2987
                         videoPostCaptureView->Container()->MakeVisible( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2988
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2989
                    iLastHiddenViewId = currentViewId.iViewUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2990
                    break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2991
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2992
                default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2993
                    break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2994
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2995
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2996
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2997
          // if the application has gone to the background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2998
          // note this does not include eikon server windows
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2999
          // The exception to this is when the slider is closed with keypad 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3000
          // lock active and the app grid opens with a keypad status note. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3001
          // We know in this situation that the app should release resources.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3002
          if ( AppInBackground( EFalse ) || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3003
             ( AppInBackground( ETrue ) && iPretendExit ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3004
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3005
            PRINT( _L("Camera <> AppUI EEventFocusGroupChanged A"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3006
            // when we return to foreground we use this boolean to
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3007
            // check if we have to still exit the settings modes e.g. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3008
            // UserScene or SceneSettings that we are in when screen saver 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3009
            // comes or going InternalExit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3010
            iLostFocusToNewWindow = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3011
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3012
            // Handle losing focus to another application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3013
            // this is used for behaviour that does not need to occur
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3014
            // when views go to the background for another view within our
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3015
            // own application. Also for when the application was behind
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3016
            // an eikon server window but another application has now taken
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3017
            // the foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3018
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3019
            if( iView && iReturnedFromPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3020
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3021
              PRINT( _L("Camera <> AppUI EEventFocusGroupChanged B"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3022
              static_cast<CCamViewBase*>( iView )->HandleFocusLossL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3023
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3024
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3025
            // the application knows it is in the background so we are
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3026
            // not interested in any more events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3027
            iCoeEnv->RootWin().DisableFocusChangeEvents();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3028
            // disable timeout to standby when going to background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3029
            iController.StopIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3030
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3031
            // We need to know if we gain focus from a true background event
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3032
            iReturnFromBackground = ETrue;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3033
            // Sent to the background, so compress the heap
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3034
            User::Heap().Compress();                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3035
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3036
            // stop listening mmc dismount notifications
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3037
            iController.CancelDismountMonitoring();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3038
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3039
    #if !defined (__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3040
            if ( AppInBackground( ETrue ) )     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3041
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3042
              // relinquish capture keys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3043
              UnRegisterCaptureKeys();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3044
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3045
    #endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3046
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3047
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3048
          if (iStartupLogoController)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3049
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3050
            iStartupLogoController->HideLogo();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3051
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3052
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3053
          if( AppInBackground(EFalse) || ( !CamUtility::IsBatteryPowerOK() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3054
                                           !CamUtility::IsBatteryCharging() ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3055
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3056
            if( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3057
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3058
              TCamCaptureOperation operation( iController.CurrentOperation() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3059
              // In case of phone app, video rec is stopped already when the call starts ringing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3060
              if ( ( !iController.CurrentlySavingVideo() ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3061
                 ( ECamCapturing == operation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3062
                || ECamPaused    == operation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3063
                || ECamPausing   == operation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3064
                || ECamResuming  == operation ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3065
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3066
                iController.StopVideoRecording();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3067
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3068
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3069
            else if( iController.SequenceCaptureInProgress() && IsBurstEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3070
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3071
              iController.StopSequenceCaptureL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3072
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3073
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3074
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3075
              if( iController.IsViewFinding() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3076
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3077
                if(CamUtility::IsBatteryPowerOK() )         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3078
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3079
                  iController.StopViewFinder();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3080
                  iViewFinderStopped = ETrue;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3081
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3082
                // stop self timer countdown if necessary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3083
                if( SelfTimer() && SelfTimer()->IsActive() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3084
                    CamUtility::IsBatteryPowerOK() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3085
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3086
                  // If low battery note appears, do not cancel self timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3087
                  SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3088
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3089
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3090
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3091
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3092
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3093
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3094
        // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3095
        // the camera app has regained the focus
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3096
        case EEventFocusGained:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3097
          {            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3098
          PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusGained") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3099
          RAknUiServer* capServ = CAknSgcClient::AknSrv();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3100
          CleanupStack::PushL( TCleanupItem( CleanupBlankScreen, this ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3101
          if ( iPretendExit ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3102
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3103
            capServ->BlankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3104
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3105
          iReturningFromPretendExit = iPretendExit; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3106
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3107
          TBool uiOverride = iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3108
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3109
          if ( !iSendAsInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3110
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3111
              // if we've regained focus assume we're not embedding anything
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3112
              SetEmbedding( EFalse ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3113
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3114
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3115
          //Make the current container visible again. This way the camera ui doesn't flash quickly in the portait mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3116
          //when returning from the background. unless this is first startup and uiorientationioverride api is used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3117
          if ( !uiOverride || ( !iFirstBoot && uiOverride ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3118
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3119
              switch ( iLastHiddenViewId.iUid )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3120
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3121
                  case ECamViewIdStillPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3122
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3123
                      if( iStillCaptureView->Container() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3124
                          && !APHandler()->AccessedViaAP())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3125
                          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3126
                          iStillCaptureView->Container()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3127
                          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3128
                      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3129
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3130
                  case ECamViewIdStillPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3131
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3132
                      CCamStillPostCaptureView* stillPostCaptureView = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3133
                      ((CCamStillPostCaptureView*)View( iLastHiddenViewId ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3134
                      if( stillPostCaptureView && stillPostCaptureView->Container() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3135
                          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3136
                          stillPostCaptureView->Container()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3137
                          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3138
                      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3139
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3140
                  case ECamViewIdVideoPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3141
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3142
                  if( iVideoCaptureView->Container() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3143
                      && !APHandler()->AccessedViaAP())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3144
                          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3145
                          iVideoCaptureView->Container()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3146
                          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3147
                      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3148
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3149
                  case ECamViewIdVideoPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3150
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3151
                      CCamVideoPostCaptureView* videoPostCaptureView = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3152
                       ((CCamVideoPostCaptureView*)View( iLastHiddenViewId ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3153
                       if( videoPostCaptureView && videoPostCaptureView->Container() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3154
                           {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3155
                           videoPostCaptureView->Container()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3156
                           }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3157
                      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3158
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3159
                  default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3160
                      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3161
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3162
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3163
          // focus gained event is received while videocall is active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3164
          if ( iController.InVideocallOrRinging() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3165
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3166
              if ( ECamViewStateStandby == iViewState && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3167
                   StandbyStatus() == KErrInUse )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3168
                  { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3169
                  // We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3170
                  capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3171
                  CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3172
                  CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3173
                  return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3174
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3175
              else if ( iViewState != ECamViewStateSettings && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3176
                        iViewState != ECamViewStateViaPlayer &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3177
                        iTargetViewState != ECamViewStatePostCapture &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3178
                       !iFirstBoot )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3179
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3180
                  //Don't update task state in case of embedded camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3181
                  if ( !iEikonEnv->StartedAsServerApp())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3182
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3183
                      HideTaskL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3184
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3185
                  iPretendExit = EFalse; 	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3186
                  // Go to standby with error	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3187
                  capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3188
                  CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3189
                  HandleStandbyEventL( KErrInUse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3190
                  // We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3191
                  CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3192
                  return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3193
                  } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3194
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3195
          // Only do startup performance traces if this is
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3196
          // a subsequent startup.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3197
          if ( IsInPretendExit() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3198
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3199
              OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPUI_HANDLEWSEVENTL, "e_CAM_APP_INIT 1" ); //CCORAPP_APP_INIT_START
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3200
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3201
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3202
          PERF_EVENT_START_L1( EPerfEventAppSubsequentStartup );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3203
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3204
         // start listening mmc dismount notifications
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3205
         iController.StartDismountMonitoring();	 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3206
               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3207
          if ( !uiOverride || ( !iFirstBoot && uiOverride ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3208
              {      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3209
              NotifyViews( ECamAppEventFocusGained );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3210
              if( !uiOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3211
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3212
                  // whenever we come from background, we reset the image, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3213
                  // video & common settings as there is a possibility that 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3214
                  // some settings might have changed from the GS application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3215
                  // by the user.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3216
                  iController.LoadStaticSettingsL( IsEmbedded() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3217
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3218
              PRINT( _L("Camera <> CCamAppUi::HandleWsEvent ECamEventFocusGained calling UpdateToolbarIconsL") );      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3219
              if ( iPretendExit ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3220
              iStillCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3221
              if( !uiOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3222
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3223
                  //check for silent profile whenever we come to foreground.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3224
                  iController.IsProfileSilent();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3225
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3226
              }                  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3227
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3228
          //Check existance of current file if in video or image in 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3229
          //burstthumbnail view.      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3230
          if( CurrentViewState() == ECamViewStateBurstThumbnail  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3231
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3232
              StartFileNameCheck();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3233
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3234
          /*
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3235
          * We check if the state of the camera is in the ViaPlayer mode state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3236
          * if so, then we just activate the player view and return after
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3237
          * coming from the background.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3238
          */
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3239
          if ( iViewState == ECamViewStateViaPlayer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3240
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3241
              ActivateLocalViewL ( iViaPlayerUid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3242
              // We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3243
              capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3244
              CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3245
              CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3246
              return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3247
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3248
          else if ( iTargetViewState == ECamViewStatePostCapture  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3249
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3250
              TrySwitchViewL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3251
              // register an interest in new events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3252
              iCoeEnv->RootWin().EnableFocusChangeEvents();   // ignore error
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3253
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3254
#if !defined (__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3255
              // Grab capture keys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3256
              RegisterCaptureKeysL();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3257
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3258
#endif             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3259
              // iPretendExit flag needs to be reset before returning, otherwise
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3260
              // views think we are still in exit state and will not reserve camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3261
              iPretendExit = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3262
              capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3263
              CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3264
              CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3265
              return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3266
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3267
          else if ( SettingsLaunchedFromCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3268
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3269
              if ( iController.InVideocallOrRinging() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3270
                   iController.CurrentOperation() == ECamNoOperation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3271
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3272
                  iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3273
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3274
              else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3275
                  {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3276
                  CCamViewBase *precapView = static_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3277
				  __ASSERT_DEBUG(precapView, CamPanic(ECamPanicNullPointer));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3278
                  if( precapView->IsInStandbyMode() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3279
                	  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3280
                	  iView->HandleCommandL( ECamCmdExitStandby );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3281
                	  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3282
                  iTargetViewState = ECamViewStateSettings;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3283
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3284
              TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3285
              capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3286
              CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3287
              CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3288
              return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3289
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3290
          else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3291
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3292
              // we are now sure that settings plugin is not active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3293
              iReturnedFromPlugin = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3294
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3295
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3296
         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3297
          if ( iLostFocusToNewWindow )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3298
              {            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3299
              if ( ECamViewStateBurstThumbnail != iTargetViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3300
                  { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3301
                  iLostFocusToNewWindow = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3302
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3303
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3304
          if( !uiOverride || ( !iFirstBoot && uiOverride ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3305
              {  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3306
              StartCheckingDefaultAlbumIdL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3307
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3308
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3309
          // Free the needed ram memory if not enough available
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3310
          TInt memError = iMemoryMonitor->CheckAndRequestMemoryL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3311
                           iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3312
                           iController.UiConfigManagerPtr()->RequiredRamMemoryFocusGained(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3313
                           EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3314
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3315
          TInt freeMemory = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3316
          TInt halerror=HAL::Get( HALData::EMemoryRAMFree, freeMemory );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3317
          if( halerror != KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3318
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3319
              User::Leave( halerror );          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3320
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3321
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3322
          if ( memError && freeMemory < iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3323
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3324
              PRINT( _L("Camera <> CCamAppUi::HandleWsEvent ECamEventFocusGained memory too low. Exiting") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3325
              capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3326
              CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3327
              CloseAppL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3328
              PRINT( _L("Camera <= CCamAppUi::HandleWsEvent ECamEventFocusGained memory too low. Exiting") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3329
              return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3330
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3331
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3332
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3333
          iController.SetEndKeyExitWaiting( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3334
          //Don't update task state in case of embedded camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3335
          if ( !iEikonEnv->StartedAsServerApp())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3336
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3337
              HideTaskL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3338
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3339
          // Restart the sensor idle
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3340
          if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3341
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3342
              // Handle sensor api init when we have idle time
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3343
              StartSensorIdleL();      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3344
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3345
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3346
          // the focus can be regained during a SendAs Bluetooth operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3347
          // so don't try to exit the app if SendAs is in progress - the
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3348
          // exit check will be performed once SendAs completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3349
          // The same applies while a sequence capture is being completed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3350
          if ( !iSendAsInProgress && !iController.SequenceCaptureInProgress() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3351
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3352
              PRINT( _L("Camera <> CCamAppUi::HandleWsEventL EEventFocusGained checking exit status") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3353
              // check if exit is required
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3354
              if ( iController.CheckExitStatus() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3355
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3356
                  capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3357
                  CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3358
                  InternalExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3359
                  PRINT( _L("Camera <= CCamAppUi::HandleWsEventL, internal exit") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3360
                  return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3361
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3362
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3363
                        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3364
          // register an interest in new events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3365
          iCoeEnv->RootWin().EnableFocusChangeEvents();   // ignore error
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3366
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3367
    #if !defined (__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3368
          // Grab capture keys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3369
          RegisterCaptureKeysL();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3370
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3371
    #endif             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3372
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3373
          iReturnFromBackground = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3374
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3375
          // When the application gains focus
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3376
          // the memory to use should be re-checked for 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3377
          // availability. If uioverride supported, check
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3378
          // made later since settings not loaded at this point
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3379
          if ( !uiOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3380
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3381
              iController.CheckMemoryToUseL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3382
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3383
                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3384
          iPretendExit = EFalse; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3385
                 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3386
          TCamViewSwitch switchNeeded = ECamViewSwitchNone;               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3387
                                         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3388
          // if a view switch has been waiting for the application to get 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3389
          // the foreground.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3390
          if ( iPendingViewSwitch != EPendingViewSwitchNone && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3391
               !iSendAsInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3392
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3393
              // In case the application is exited from portrait mode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3394
              // and landscape should be used -> orientation switch is required 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3395
              TAppUiOrientation appOrientation = CAknAppUiBase::Orientation();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3396
              if ( EAppUiOrientationPortrait == appOrientation ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3397
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3398
                  SwitchOrientationIfRequiredL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3399
                                 CAknAppUiBase::EAppUiOrientationUnspecified );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3400
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3401
              TBool deactivateFirst = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3402
                   ( iPendingViewSwitch == EPendingViewSwitchDeactivateFirst );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3403
              switchNeeded = ViewSwitchRequired( deactivateFirst );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3404
              iPendingViewSwitch = EPendingViewSwitchNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3405
              TrySwitchViewL( deactivateFirst );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3406
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3407
          else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3408
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3409
              if( iViewFinderStopped )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3410
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3411
                  // don't start VF if EEventFocusGroupChanged is coming later
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3412
                  if( !iLostFocusToNewWindow && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3413
                      iController.CurrentMode() == ECamControllerImage || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3414
                      iController.CurrentMode() == ECamControllerVideo ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3415
                      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3416
                      iController.StartViewFinder(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3417
                      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3418
                  iLostFocusToNewWindow = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3419
                  }           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3420
              }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3421
                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3422
          // force side pane and active palette to update if simulating app 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3423
          // launch this has to be done after the call to TrySwitchViewL() to 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3424
          // ensure that IsBurstEnabled() returns the correct value.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3425
          if ( iReturningFromPretendExit ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3426
              {            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3427
            iCamSidePane->SetCaptureMode( iMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3428
            // The active palette is always switched on when simulating 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3429
            // app launch
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3430
            iPreventActivePaletteDisplay = EFalse;                                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3431
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3432
               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3433
            if ( iView == iVideoCaptureView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3434
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3435
                iVideoCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3436
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3437
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3438
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3439
          if ( uiOverride && ( iReturningFromPretendExit || iFirstBoot ) ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3440
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3441
              SetActivePaletteVisibility( EFalse );               	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3442
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3443
          else if ( !TimeLapseSliderShown() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3444
                    iViewState == ECamViewStatePreCapture && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3445
                    switchNeeded != ECamViewSwitch && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3446
                    !uiOverride )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3447
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3448
              RaisePreCaptureCourtesyUI( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3449
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3450
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3451
          //We hiden toolbar when keylock was set to on in pre-capture view and camera lost focus, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3452
          //so we need to display toolbar when keylock is set to off and camera gain focus again.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3453
          if ( ECamViewStatePreCapture == iViewState &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3454
               ECamPreCapViewfinder == iPreCaptureMode && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3455
               ( !( iSelfTimer && iSelfTimer->IsActive() ) ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3456
               iController.CurrentOperation() != ECamCapturing &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3457
               iController.CurrentOperation() != ECamPaused &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3458
               !iReturningFromPretendExit )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3459
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3460
            SetToolbarVisibility(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3461
            }          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3462
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3463
          // If keylock is set on when recording is starting up but not yet 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3464
          // started, display toolbar when keylock is set off since we are 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3465
          // returning to precapture view, unless capturing is still going on.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3466
          if ( iView == iVideoCaptureView 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3467
              && iController.CurrentOperation() != ECamCapturing 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3468
              && !iController.IsProcessingCapture() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3469
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3470
             if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3471
                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3472
                 CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3473
                 if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3474
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3475
                     if ( iPreCaptureMode == ECamPreCapViewfinder )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3476
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3477
                         toolbar->SetToolbarVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3478
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3479
                     else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3480
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3481
                         toolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3482
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3483
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3484
                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3485
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3486
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3487
          capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3488
          CleanupStack::Pop();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3489
          if (iStartupLogoController && iReturningFromPretendExit)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3490
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3491
              iStartupLogoController->ShowLogo();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3492
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3493
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3494
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3495
        // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3496
        case EEventFocusLost:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3497
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3498
          PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusLost") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3499
          // Stop VF early to reduce load
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3500
          if( AppInBackground( EFalse )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3501
              && iViewState == ECamViewStatePreCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3502
              && iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3503
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3504
              iController.StopViewFinder(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3505
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3506
          //When go to background from video post caputure view, we need to hide the toolbar to avoid icons overlap
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3507
          if( AppInBackground( EFalse )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3508
              && iViewState == ECamViewStatePostCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3509
              && iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3510
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3511
              SubmergeToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3512
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3513
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3514
          //We need hiding the toolbar if keylock is set to on in pre-catpure view, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3515
          //otherwise the toolbar will be displayed when press volume key in keylock on status.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3516
          if ( iController.IsKeyLockOn() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3517
               ECamViewStatePreCapture == iViewState && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3518
               ECamPreCapViewfinder == iPreCaptureMode ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3519
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3520
            SubmergeToolbar(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3521
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3522
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3523
          // focus lost event while videocall active and camera in standby,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3524
          // no notification to views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3525
          if ( iController.InVideocallOrRinging()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3526
            && ECamViewStateStandby == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3527
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3528
            // We call the base class and return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3529
            CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3530
            return;         	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3531
            }	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3532
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3533
          NotifyViews( ECamAppEventFocusLost );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3534
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3535
          if ( iController.UiConfigManagerPtr()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3536
               && iController.UiConfigManagerPtr()->IsOrientationSensorSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3537
          // Shut down the Sensor API object.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3538
          iController.UpdateSensorApiL(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3539
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3540
    #if !defined (__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3541
          // relinquish capture keys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3542
          UnRegisterCaptureKeys();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3543
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3544
          RArray <TInt> halfCaptureKeys;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3545
          CleanupClosePushL( halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3546
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3547
          // now get half key press code to register
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3548
          if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3549
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3550
              iController.UiConfigManagerPtr()->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3551
                          SupportedPrimaryCameraAutoFocusKeyL( halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3552
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3553
          if ( halfCaptureKeys.Count() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3554
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3555
              // Simulate key up event for the half-press key to make
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3556
              // sure autofocus does not get stuck when we lose focus.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3557
              TKeyEvent key;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3558
              key.iRepeats = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3559
              key.iCode = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3560
              key.iScanCode = halfCaptureKeys[0];
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3561
              key.iModifiers = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3562
              iEikonEnv->SimulateKeyEventL( key, EEventKeyUp );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3563
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3564
          CleanupStack::PopAndDestroy( &halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3565
    #endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3566
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3567
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3568
        // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3569
        case KUidValueAknsSkinChangeEvent:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3570
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3571
          if ( iNaviProgressBarModel )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3572
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3573
              iNaviProgressBarModel->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3574
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3575
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3576
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3577
        case EEventPointer:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3578
            PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: EEventPointer") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3579
            // restart idle timer every time screen is touched
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3580
            iController.StartIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3581
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3582
        // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3583
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3584
          PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: unhandled case") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3585
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3586
        // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3587
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3588
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3589
      CAknAppUi::HandleWsEventL( aEvent, aDestination );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3590
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3591
  PRINT( _L("Camera <= CCamAppUi::HandleWsEventL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3592
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3593
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3594
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3595
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3596
// NotifyViews
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3597
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3598
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3599
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3600
CCamAppUi::NotifyViews( const TCamAppEvent& aEvent )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3601
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3602
  PRINT( _L("Camera => CCamAppUi::NotifyViews") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3603
  TUid settingsPluginUid = KNullUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3604
  if ( iPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3605
     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3606
     settingsPluginUid = iPlugin->Id();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3607
     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3608
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3609
  for( TInt i = 0; i < iViews->Count(); i++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3610
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3611
    const TUid& uid( (*iViews)[i]->Id() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3612
    PRINT2( _L("Camera <> View[%2d] uid[%3d]"), i, uid.iUid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3613
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3614
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3615
       if (
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3616
             KGSCamImageSettingsViewId != uid &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3617
             KGSCamVideoSettingsViewId != uid &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3618
             settingsPluginUid != uid &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3619
             ECamViewIdViaPlayerPlayBack != uid.iUid ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3620
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3621
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3622
               static_cast<CCamViewBase*>( (*iViews)[i] )->HandleAppEvent( aEvent );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3623
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3624
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3625
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3626
  PRINT( _L("Camera <= CCamAppUi::NotifyViews") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3627
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3628
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3629
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3630
// CCamAppUi::ConstructPreCaptureViewsL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3631
// Construct the application views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3632
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3633
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3634
void CCamAppUi::ConstructPreCaptureViewsL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3635
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3636
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTPRECAPTUREVIEWSL, "e_CCamAppUi_ConstructPreCaptureViewsL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3637
    PRINT( _L( "Camera => CCamAppUi::ConstructPreCaptureViewsL()" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3638
    PERF_EVENT_START_L2( EPerfEventPreCaptureViewConstruction );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3639
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3640
    // Initialize views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3641
    CCamStillPreCaptureView* stillView =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3642
        CCamStillPreCaptureView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3643
    iStillCaptureView = stillView;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3644
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3645
    AddViewL( stillView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3646
    CleanupStack::Pop( stillView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3647
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3648
    PRINT( _L( "Camera => CCamAppUi::ConstructPreCaptureViewsL() still view complete" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3649
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3650
    CCamVideoPreCaptureView* videoView = CCamVideoPreCaptureView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3651
    iVideoCaptureView = videoView;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3652
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3653
    AddViewL( videoView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3654
    CleanupStack::Pop( videoView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3655
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3656
#if !( defined(__WINS__) || defined(__WINSCW__) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3657
    // Get Central Repository key indicating if product uses volume keys 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3658
    // for zoom. Load the zoom pane orientation value from the Central 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3659
    // Repository
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3660
    if( !iRepository )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3661
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3662
        iRepository = CRepository::NewL( KCRUidCameraappSettings );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3663
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3664
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3665
    TInt val = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3666
    TInt err = iRepository->Get( KCamCrZoomUsingVolumeKeys, val );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3667
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3668
    // If there is an error then assume volume keys not used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3669
    if ( err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3670
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3671
        iZoomUsingVolumeKeys = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3672
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3673
    else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3674
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3675
        iZoomUsingVolumeKeys = val;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3676
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3677
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3678
    if( iZoomUsingVolumeKeys )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3679
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3680
        // Remote controller observe
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3681
        delete iVolumeKeyObserver;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3682
        iVolumeKeyObserver = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3683
        iVolumeKeyObserver = CCamRemConObserver::NewL( *this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3684
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3685
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3686
#else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3687
    iZoomUsingVolumeKeys = EFalse;   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3688
#endif // !( defined(__WINS__) || defined(__WINSCW__) ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3689
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3690
    PERF_EVENT_END_L2( EPerfEventPreCaptureViewConstruction );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3691
    PRINT( _L( "Camera <= CCamAppUi::ConstructPreCaptureViewsL()" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3692
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTPRECAPTUREVIEWSL, "e_CCamAppUi_ConstructPreCaptureViewsL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3693
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3694
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3695
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3696
// CCamAppUi::ConstructPostCaptureViewsL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3697
// Construct the application views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3698
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3699
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3700
void CCamAppUi::ConstructPostCaptureViewsL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3701
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3702
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3703
    PRINT( _L( "Camera => CCamAppUi::ConstructPostCaptureViewsL()" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3704
    if ( iPostCaptureViewsConstructed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3705
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3706
        PRINT( _L( "Camera <= CCamAppUi::ConstructPostCaptureViewsL(,)iPostCaptureViewsConstructed == ETrue" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3707
        OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3708
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3709
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3710
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3711
    PERF_EVENT_START_L2( EPerfEventPostCaptureViewConstruction );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3712
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3713
    ConstructPostCaptureViewIfRequiredL( ECamViewStatePostCapture,    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3714
                                         ECamControllerImage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3715
    ConstructPostCaptureViewIfRequiredL( ECamViewStateBurstThumbnail, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3716
                                         ECamControllerImage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3717
    ConstructPostCaptureViewIfRequiredL( ECamViewStatePostCapture,    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3718
                                         ECamControllerVideo );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3719
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3720
    iPostCaptureViewsConstructed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3721
    PERF_EVENT_END_L2( EPerfEventPostCaptureViewConstruction );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3722
    PRINT( _L( "Camera <= CCamAppUi::ConstructPostCaptureViewsL()" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3723
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3724
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3725
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3726
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3727
// CCamAppUi::ConstructViewIfRequiredL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3728
// Construct the application views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3729
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3730
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3731
void CCamAppUi::ConstructViewIfRequiredL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3732
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3733
    PRINT( _L( "Camera => CCamAppUi::ConstructViewIfRequiredL()" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3734
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3735
  // Initialize views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3736
  CAknView* view( NULL );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3737
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3738
  switch( iTargetViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3739
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3740
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3741
    // Construct one of the postcapture views if needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3742
    case ECamViewStateBurstThumbnail:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3743
    case ECamViewStatePostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3744
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3745
      ConstructPostCaptureViewIfRequiredL( iTargetViewState, iMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3746
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3747
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3748
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3749
    // construct settings views if needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3750
    case ECamViewStateSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3751
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3752
      if( !iPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3753
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3754
        CCamGSInterface* plugin = CCamGSInterface::NewL( KCamGSPluginUid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3755
        CleanupStack::PushL( plugin );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3756
        AddViewL( plugin ); // Transfer ownership to AppUi
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3757
        CleanupStack::Pop( plugin );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3758
        iPlugin = plugin;        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3759
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3760
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3761
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3762
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3763
    // construct user scene setup view if needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3764
    case ECamViewStateUserSceneSetup:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3765
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3766
      if( !iUserSceneSetupViewConstructed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3767
        {           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3768
        view = CCamStillUserSceneSetupView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3769
        AddViewL( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3770
        CleanupStack::Pop( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3771
        iUserSceneSetupViewConstructed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3772
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3773
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3774
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3775
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3776
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3777
    default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3778
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3779
      // no action
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3780
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3781
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3782
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3783
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3784
  PRINT( _L( "Camera <= CCamAppUi::ConstructViewIfRequiredL" ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3785
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3786
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3787
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3788
// CCamAppUi::ConstructNaviPaneL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3789
// Construct the navi pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3790
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3791
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3792
void CCamAppUi::ConstructNaviPaneL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3793
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3794
     OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTNAVIPANEL, "e_CCamAppUi_ConstructNaviPaneL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3795
     // Navi pane indicators
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3796
    iNaviPaneCounterControl = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3797
                            CCamNaviCounterControl::NewL( *iNaviCounterModel );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3798
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3799
    iDecoratedNaviPaneCounter = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3800
        CAknNavigationDecorator::NewL( NaviPaneL(), iNaviPaneCounterControl );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3801
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3802
    iDecoratedNaviPaneCounter->SetContainerWindowL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3803
            *(StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3804
    iNaviPaneCounterControl->SetContainerWindowL( *iDecoratedNaviPaneCounter );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3805
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3806
    iNaviPaneProgressBarControl = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3807
                    CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3808
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3809
    iDecoratedNaviPaneProgressBar = CAknNavigationDecorator::NewL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3810
                                    NaviPaneL(), iNaviPaneProgressBarControl );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3811
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3812
    iDecoratedNaviPaneProgressBar->SetContainerWindowL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3813
            *(StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3814
    iNaviPaneProgressBarControl->SetContainerWindowL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3815
                                              *iDecoratedNaviPaneProgressBar );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3816
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTNAVIPANEL, "e_CCamAppUi_ConstructNaviPaneL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3817
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3818
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3819
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3820
// CCamAppUi::DoPostCaptureTimeoutL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3821
// Implementation function for post capture view timeout
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3822
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3823
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3824
TInt CCamAppUi::DoPostCaptureTimeoutL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3825
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3826
    // If burst mode is active, switch to thumbnail view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3827
    if ( iViewState == ECamViewStatePostCapture &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3828
         iImageMode == ECamImageCaptureBurst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3829
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3830
        iTargetViewState = ECamViewStateBurstThumbnail ;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3831
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3832
    // otherwise, return to pre-capture view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3833
    else if (iCamOrientation == ECamOrientationPortrait) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3834
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3835
      iTargetViewState = ECamViewStatePrePortraitCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3836
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3837
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3838
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3839
      iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3840
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3841
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3842
    TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3843
    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3844
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3845
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3846
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3847
// CCamAppUi::TrySwitchViewL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3848
// Try to switch active view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3849
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3850
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3851
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3852
CCamAppUi::TrySwitchViewL( TBool aDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3853
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3854
  PRINT2(_L("Camera => CCamAppUi::TrySwitchViewL, iTargetViewState = %d, iViewState = %d"), iTargetViewState, iViewState);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3855
  PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, iTargetMode = %d, iMode = %d"), iTargetMode, iMode);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3856
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3857
  //Sometimes current view and target view are same. For example switching from main camera to secondary camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3858
  //always sets target mode to precaptrueview and current view could already be in precapture view. This is fine
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3859
  //but In some postcaptureview cases current view and targetview is postcapture.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3860
  //In those cases view switching is not needed unless current mode also changes.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3861
  if( (iViewState==iTargetViewState) && ( iViewState==ECamViewStatePostCapture) && (iMode==iTargetMode) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3862
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3863
      PRINT(_L("Camera <= CCamAppUi::TrySwitchViewL, CALLED WITHOUT PURPOSE"));      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3864
      return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3865
      }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3866
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3867
  if( iZoomUsingVolumeKeys && !iVolumeKeyObserver &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3868
      ECamViewStatePreCapture == iTargetViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3869
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3870
    // Volumekeyobserver has been removed due to activating an external
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3871
    // view. Volume keys are only needed for zooming in precapture, so we
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3872
    // re-create the observer during next switch to precap (=now)  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3873
    iVolumeKeyObserver = CCamRemConObserver::NewL( *this );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3874
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3875
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3876
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3877
    //if burst capture stopped for usb inserted, iTargetViewState is ECamViewStatePreCapture, it need to stop sequence capture too.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3878
    if ( iViewState == ECamViewStatePreCapture && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3879
          ( iTargetViewState == ECamViewStateBurstThumbnail || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3880
          ( ( iTargetViewState == ECamViewStatePreCapture ) && iController.IsCaptureStoppedForUsb() ) ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3881
       iController.SequenceCaptureInProgress() )       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3882
	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3883
	iController.StopSequenceCaptureL();	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3884
	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3885
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3886
  // some views are only constructed when they are first used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3887
  TRAPD( err, ConstructViewIfRequiredL() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3888
  PRINT1( _L( "Camera <> view constrcuction status:%d"), err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3889
  // if the view construction failed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3890
  if ( err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3891
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3892
    iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3893
    User::Leave( err );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3894
    } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3895
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3896
  // if the application is in the background the view switch will happen 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3897
  // when we get the foreground again. This stops the app coming back to
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3898
  // the foreground when the view switch occurs.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3899
  // If keylock is enabled, view switching is allowed in order to avoid 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3900
  // flickering
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3901
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3902
  if ( iPretendExit || ( AppInBackground( ETrue ) && ECamViewStateStandby != iTargetViewState ) )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3903
    {          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3904
    PRINT( _L("Camera <> app in background set pending view switch") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3905
    if ( aDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3906
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3907
      PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchDeactivateFirst") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3908
      iPendingViewSwitch = EPendingViewSwitchDeactivateFirst;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3909
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3910
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3911
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3912
      // If a deactivate first view switch has already been requested 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3913
      // then don't overwrite it
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3914
      if ( iPendingViewSwitch != EPendingViewSwitchDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3915
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3916
        PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchNormal") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3917
        iPendingViewSwitch = EPendingViewSwitchNormal;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3918
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3919
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3920
    PRINT( _L("Camera TrySwitchViewL returning without switch") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3921
    return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3922
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3923
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3924
  if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3925
       iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3926
       !iUiConstructionComplete )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3927
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3928
    iPendingViewSwitch = EPendingViewSwitchNormal;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3929
    PRINT( _L("Camera <= CCamAppUi::TrySwitchViewL setting EPendingViewSwitchNormal, return") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3930
    return;   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3931
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3932
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3933
  TCamViewSwitch switchNeeded = ViewSwitchRequired( aDeactivateFirst );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3934
  PRINT( _L("Camera TrySwitchViewL C") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3935
  if ( iTargetViewState == ECamViewStatePreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3936
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3937
    PRINT( _L("Camera TrySwitchViewL D") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3938
    // if going back to precapture view in timelapse mode then the array
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3939
    // of timelapse filenames can now be deleted
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3940
    if ( iImageMode == ECamImageCaptureTimeLapse )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3941
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3942
      iController.ResetTimelapseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3943
      }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3944
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3945
    // If exiting a post capture view, release the capture array
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3946
    if ( iViewState == ECamViewStatePostCapture ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3947
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3948
      iController.ReleaseArray();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3949
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3950
    else if( iViewState == ECamViewStateBurstThumbnail )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3951
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3952
      iController.ReleaseArray( ETrue );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3953
      }
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  3954
    if ( iPreCaptureMode != ECamPreCapTimeLapseSlider )
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3955
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3956
      iPreCaptureMode = ECamPreCapViewfinder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3957
      }       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3958
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3959
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3960
  if ( iTargetViewState == ECamViewStatePostCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3961
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3962
    // If going to post capture, make sure the AP is displayed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3963
    iPreventActivePaletteDisplay = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3964
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3965
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3966
  // If no switches are required
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3967
  if ( switchNeeded == ECamViewSwitchNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3968
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3969
    PRINT( _L("Camera TrySwitchViewL no VS") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3970
    if ( IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3971
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3972
      TRAP_IGNORE(HandleCommandL( ECamCmdRedrawScreen ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3973
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3974
    return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3975
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3976
  // If a full view switch is required, activate new view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3977
  if ( switchNeeded == ECamViewSwitch )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3978
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3979
    PRINT( _L("Camera <> CCamAppUi::TrySwitchViewL: Stop VF for full view switch") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3980
    // this skip VF stopping if DV is active and camera is in standby mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3981
    // possible if screensaver delay is short and startup takes long enough
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3982
    if ( ECamViewStateStandby == iViewState && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3983
    // DSVF active or in bitmap mode in any active camera (no need to stop VF)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3984
          ( IsDirectViewfinderActive() || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3985
            ( ECamActiveCameraSecondary == ActiveCamera() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3986
              !iController.UiConfigManagerPtr()->IsDSAViewFinderSupported( EFalse ) ) ||      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3987
            ( ECamActiveCameraPrimary == ActiveCamera() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3988
              !iController.UiConfigManagerPtr()->IsDSAViewFinderSupported( ETrue ) ) ) )    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3989
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3990
      PRINT( _L("Camera <> CCamAppUi::TrySwitchViewL: !!! No stopviewfinder in Standby !!!") )	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3991
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3992
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3993
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3994
      SetViewFinderInTransit(ETrue);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3995
      iController.StopViewFinder();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3996
      if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3997
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3998
        TUid viewId = iView->Id();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3999
        if(viewId == TUid::Uid( ECamViewIdStillPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4000
           || viewId == TUid::Uid( ECamViewIdVideoPreCapture ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4001
           {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4002
           CCamViewBase* view = static_cast<CCamViewBase*>(iView);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4003
           CCamContainerBase* container = view->Container(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4004
           container->DrawNow();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4005
           }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4006
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4007
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4008
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4009
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4010
    PRINT( _L("Camera TrySwitchViewL E") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4011
    TUid uid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4012
    TUid messageUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4013
    TBool validView = ViewId( iTargetViewState, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4014
                              iTargetMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4015
                              iTargetImageMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4016
                              uid, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4017
                              messageUid, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4018
                              aDeactivateFirst );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4019
    PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, iTargetViewState = %d, iViewState = %d"), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4020
                                                    iTargetViewState, iViewState);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4021
    PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, uid = %d, messageUid = %d"), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4022
                                                    uid.iUid, messageUid.iUid);  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4023
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4024
    __ASSERT_DEBUG( validView, CamPanic( ECamPanicInvalidView ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4025
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4026
    if ( validView )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4027
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4028
        PRINT( _L("Camera TrySwitchViewL f") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4029
        // the cba is reset when the view is activated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4030
        iCbaIsDisabled = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4031
        ActivateLocalViewL( uid, messageUid, KNullDesC8 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4032
        // If self timer mode is enabled and we are switching views, we need to 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4033
        // disable Self Timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4034
        if ( iInSelfTimerMode != ECamSelfTimerDisabled)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4035
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4036
            SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4037
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4038
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4039
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4040
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4041
  // Mode only switches are handled here
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4042
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4043
  // ...if we are switching to/from the video/photo views then
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4044
  // ...reset the dynamic settings.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4045
  if ( (  ( iMode != ECamControllerVideo ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4046
          ( iTargetMode == ECamControllerVideo ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4047
      ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4048
      (   ( iMode == ECamControllerVideo ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4049
          ( iTargetMode != ECamControllerVideo ) ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4050
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4051
#ifdef RESET_DYNAMIC_SETTINGS_WHEN_SWITCH_MODE
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4052
    iController.SetDynamicSettingsToDefaults();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4053
#endif // RESET_DYNAMIC_SETTINGS_WHEN_SWITCH_MODE
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4054
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4055
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4056
  if ( iController.UiConfigManagerPtr() && iDSASupported )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4057
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4058
      // ...check if we are moving to BurstCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4059
      // 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4060
      if ( // If entering burst mode...
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4061
          ( ( iTargetImageMode == ECamImageCaptureBurst     ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4062
              iTargetImageMode == ECamImageCaptureTimeLapse ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4063
              iImageMode       == ECamImageCaptureSingle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4064
             // ...or leaving burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4065
           || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4066
            ( ( iImageMode       == ECamImageCaptureBurst     || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4067
                iImageMode       == ECamImageCaptureTimeLapse ) &&     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4068
                iTargetImageMode == ECamImageCaptureSingle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4069
           )     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4070
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4071
        // Stop the viewfinder (using the current state)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4072
        PRINT( _L("Camera TrySwitchViewL burst stop VF") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4073
        iController.StopViewFinder();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4074
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4075
        // Update AppUi internal state 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4076
        iViewState = iTargetViewState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4077
        iMode      = iTargetMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4078
        iImageMode = iTargetImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4079
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4080
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4081
      else        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4082
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4083
        // Not entering/leaving burst mode, so just update the state 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4084
        iViewState = iTargetViewState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4085
        iMode      = iTargetMode;          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4086
        iImageMode = iTargetImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4087
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4088
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4089
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4090
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4091
      // ...set the current capture mode and view state to the targets.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4092
      iViewState = iTargetViewState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4093
      iMode      = iTargetMode;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4094
      iImageMode = iTargetImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4095
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4096
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4097
  PRINT(_L("Camera <= CCamAppUi::TrySwitchViewL"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4098
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4099
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4100
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4101
// CCamAppUi::ViewSwitchRequired
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4102
// Is a switch of the active view necessary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4103
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4104
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4105
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4106
CCamAppUi::TCamViewSwitch 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4107
CCamAppUi::ViewSwitchRequired( TBool aDeactivateFirst ) const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4108
  {   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4109
  CCamAppUi::TCamViewSwitch vSwitch = ECamViewSwitchNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4110
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4111
  if ( aDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4112
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4113
    // View switch required
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4114
    vSwitch = ECamViewSwitch;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4115
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4116
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4117
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4118
    // Post <=> Pre and/or Video <=> Image always require view switch
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4119
    if ( iTargetViewState == iViewState 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4120
      && iTargetMode      == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4121
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4122
      // single / burst / timelapse
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4123
      if( iTargetImageMode == iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4124
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4125
        // Completely same mode already
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4126
        vSwitch = ECamViewSwitchNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4127
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4128
      else  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4129
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4130
        // No view switch is required for changing between these modes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4131
        vSwitch = ECamViewSwitchModeOnly;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4132
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4133
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4134
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4135
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4136
      // View switch required 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4137
      vSwitch = ECamViewSwitch;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4138
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4139
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4140
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4141
  return vSwitch;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4142
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4143
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4144
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4145
// CCamAppUi::ViewId
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4146
// Get uid of view with requested state and mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4147
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4148
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4149
TBool CCamAppUi::ViewId( TCamViewState        aState, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4150
                         TCamCameraMode       aMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4151
                         TCamImageCaptureMode aImageMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4152
                         TUid&                aUid, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4153
                         TUid&                aMessageUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4154
                         TBool                aDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4155
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4156
  aMessageUid.iUid = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4157
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4158
  TBool found = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4159
  switch ( aState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4160
    {       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4161
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4162
    case ECamViewStateStandby:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4163
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4164
      // Custom message to pass to the view, is to initiate standby
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4165
      aMessageUid.iUid = ECamViewMessageStandby;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4166
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4167
    //lint -fallthrough 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4168
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4169
    case ECamViewStatePreCapture: // fallthrough
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4170
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4171
      if ( aDeactivateFirst )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4172
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4173
        aMessageUid.iUid = ECamViewMessageDeactivateFirst;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4174
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4175
      if ( aMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4176
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4177
        aUid.iUid = ECamViewIdVideoPreCapture;               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4178
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4179
      else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4180
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4181
        aUid.iUid = ECamViewIdStillPreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4182
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4183
      found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4184
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4185
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4186
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4187
    case ECamViewStateSceneSettingList:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4188
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4189
      // Ensure the view starts with the capture setup menu displayed.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4190
      aMessageUid.iUid = ECamViewMessageSceneSettingList;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4191
      if ( aMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4192
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4193
        aUid.iUid = ECamViewIdVideoPreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4194
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4195
      else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4196
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4197
        aUid.iUid = ECamViewIdStillPreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4198
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4199
      found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4200
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4201
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4202
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4203
    case ECamViewStatePostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4204
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4205
      if ( aMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4206
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4207
        aUid.iUid = ECamViewIdVideoPostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4208
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4209
      else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4210
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4211
        aUid.iUid = ECamViewIdStillPostCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4212
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4213
      found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4214
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4215
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4216
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4217
    case ECamViewStateBurstThumbnail:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4218
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4219
      if ( ECamControllerImage   == aMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4220
        && ECamImageCaptureBurst == aImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4221
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4222
        aUid.iUid = ECamViewIdBurstThumbnail;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4223
        // We have view id for multi capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4224
        found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4225
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4226
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4227
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4228
        // No valid view id
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4229
        found = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4230
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4231
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4232
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4233
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4234
    case ECamViewStateSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4235
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4236
      TUid viewUid = KNullUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4237
      aMessageUid = KNullUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4238
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4239
      if ( ECamControllerVideo == aMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4240
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4241
          if ( IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4242
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4243
              aMessageUid = TUid::Uid( KGSSecondaryCameraVideoSettingsView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4244
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4245
          viewUid = KGSCamVideoSettingsViewId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4246
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4247
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4248
          { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4249
          if ( IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4250
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4251
              aMessageUid = TUid::Uid( KGSSecondaryCameraPhotoSettingsView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4252
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4253
          viewUid = KGSCamImageSettingsViewId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4254
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4255
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4256
      if ( iPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4257
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4258
          aUid = viewUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4259
          found = ETrue;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4260
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4261
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4262
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4263
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4264
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4265
    case ECamViewStateUserSceneSetup:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4266
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4267
      if ( aMode != ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4268
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4269
        aUid.iUid = ECamViewIdPhotoUserSceneSetup;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4270
        // We have a photo user scene setup view id
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4271
        found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4272
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4273
      else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4274
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4275
        found = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4276
        }           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4277
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4278
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4279
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4280
    default:                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4281
      break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4282
    // -----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4283
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4284
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4285
  return found;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4286
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4287
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4288
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4289
// CCamAppUi::NaviPaneL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4290
// Return a pointer to the status pane's navi control container
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4291
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4292
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4293
CAknNavigationControlContainer* CCamAppUi::NaviPaneL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4294
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4295
    return static_cast<CAknNavigationControlContainer*>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4296
                StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4297
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4298
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4299
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4300
// CCamAppUi::UpdateCba
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4301
// Update softkeys to reflect current state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4302
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4303
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4304
void CCamAppUi::UpdateCba()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4305
    {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4306
    CCamViewBase* view = static_cast<CCamViewBase*>( iView );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4307
    TRAP_IGNORE( view->UpdateCbaL() );             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4308
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4309
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4310
// Added back, but modified the note string resource
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4311
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4312
// CCamAppUi::DisplayWaitDialogL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4313
// Displays the wait dialog when saving video
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4314
// ----------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4315
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4316
void CCamAppUi::DisplayWaitDialogL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4317
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4318
//    __ASSERT_DEBUG( iWaitDialog == NULL, CamPanic( ECamPanicUi ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4319
    if ( iWaitDialog == NULL )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4320
       {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4321
        // Display saving video wait note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4322
        // The wait note has its initial delay disabled. This is because the call
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4323
        // to the engine to stop recording does not return until the video save 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4324
        // etc. has completed. This does not give the wait dialog a chance to 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4325
        // receive its timer call back and display itself. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4326
        iWaitDialog = new( ELeave ) CCamWaitDialog(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4327
                reinterpret_cast<CEikDialog**>( &iWaitDialog ), ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4328
        iWaitDialog->ExecuteLD( R_CAM_SAVING_VIDEO_WAIT_NOTE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4329
        // From base class CEikDialog to prevent S60 style CBAs from showing 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4330
        // unnecessarily
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4331
        iWaitDialog->ButtonGroupContainer().MakeVisible(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4332
       }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4333
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4334
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4335
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4336
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4337
// CCamAppUi::StartupMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4338
// Get startup capture mode from settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4339
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4340
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4341
TCamStartupMode CCamAppUi::StartupMode() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4342
  {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4343
  __ASSERT_DEBUG( iRepository, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4344
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4345
  TInt value = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4346
  TInt err = iRepository->Get( KCamCrDefaultCaptureMode, value );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4347
  TCamStartupMode setting = static_cast<TCamStartupMode>( value );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4348
  if ( err == KErrAbort ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4349
       err == KErrPermissionDenied ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4350
       err == KErrNotFound ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4351
       err == KErrArgument )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4352
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4353
    PRINT1( _L("Camera <> CCamAppUi::StartupMode err=%d"), err );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4354
    CamPanic( ECamPanicDefaultNotFoundInIniFile );      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4355
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4356
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4357
  return setting;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4358
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4359
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4360
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4361
// CCamAppUi::SaveCaptureMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4362
// Save current capture mode to settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4363
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4364
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4365
void CCamAppUi::SaveCaptureMode()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4366
    { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4367
    // Since this function can be called from the destructor, it is neccesary 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4368
    // to check that iRepository is not null prior to use
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4369
    if ( iRepository && !IsEmbedded() )    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4370
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4371
        switch ( iMode )         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4372
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4373
            case ECamControllerImage:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4374
                // Ignore errors
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4375
                iRepository->Set( KCamCrDefaultCaptureMode, ECamStillCapture );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4376
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4377
            case ECamControllerVideo:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4378
                // Ignore errors
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4379
                iRepository->Set( KCamCrDefaultCaptureMode, ECamVideoCapture );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4380
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4381
            default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4382
               break;            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4383
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4384
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4385
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4386
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4387
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4388
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4389
// CCamAppUi::SaveCourtesyUiState
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4390
// Save whether or not the UI should always be drawn.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4391
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4392
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4393
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4394
void CCamAppUi::SaveCourtesyUiState()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4395
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4396
  // Since this function can be called from the destructor, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4397
  // it is neccesary to check that iRepository is not null prior to use    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4398
  if ( iRepository )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4399
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4400
    iRepository->Set( KCamCrAlwaysDrawCourtesyUi, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4401
                      iAlwaysDrawPreCaptureCourtesyUI );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4402
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4403
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4404
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4405
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4406
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4407
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4408
// CCamAppUi::InitCaptureCountL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4409
// Sets up the number of images to be captured
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4410
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4411
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4412
void CCamAppUi::InitCaptureCountL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4413
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4414
    PRINT( _L("Camera => CCamAppUi::InitCaptureCountL" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4415
    // If video mode is active, capture count is not used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4416
    if ( iMode == ECamControllerImage )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4417
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4418
        TInt imageCount = 1;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4419
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4420
        switch( iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4421
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4422
            case ECamImageCaptureBurst:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4423
                // Capture count initially set to 6 for short burst.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4424
                // Once long burst is determined we adjust the burst count.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4425
                // This approach keeps short burst as fast as possible.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4426
                imageCount = KShortBurstCount;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4427
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4428
            case ECamImageCaptureTimeLapse:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4429
                // In timelapse mode set the limit as high as possible,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4430
                // unless self-timer is used. In that case only 6 images
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4431
                // will be captured.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4432
                if ( ECamSelfTimerDisabled != iInSelfTimerMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4433
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4434
                    imageCount = KShortBurstCount;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4435
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4436
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4437
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4438
                    imageCount = iMaxBurstCaptureNum;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4439
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4440
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4441
            default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4442
                // Single capture mode. Keep 1 as limit.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4443
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4444
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4445
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4446
        iController.SetCaptureLimitL( imageCount );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4447
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4448
    PRINT( _L("Camera <= CCamAppUi::InitCaptureCountL" ))  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4449
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4450
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4451
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4452
// CCamAppUi::SetCaptureMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4453
// Set the current capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4454
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4455
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4456
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4457
CCamAppUi::SetCaptureMode( TCamCameraMode       aMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4458
                           TCamImageCaptureMode aImageMode /*= ECamImageCaptureNone*/)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4459
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4460
    iMode = aMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4461
    iImageMode = aImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4462
    iTargetMode = aMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4463
    iTargetImageMode = aImageMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4464
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4465
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4466
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4467
// CCamAppUi::SetTitleEmbeddedL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4468
// Set title to  the name of embedding application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4469
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4470
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4471
void CCamAppUi::SetTitleEmbeddedL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4472
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4473
    if (iParentAppName != NULL )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4474
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4475
        SetTitleL ( *iParentAppName );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4476
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4477
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4478
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4479
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4480
// CCamAppUi::CheckMemoryL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4481
// Checks if there is sufficient space available for capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4482
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4483
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4484
TBool 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4485
CCamAppUi::CheckMemoryL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4486
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4487
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CHECKMEMORYL, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4488
    			"e_CCamAppUi_CheckMemoryL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4489
    PRINT( _L("Camera => CCamAppUi::CheckMemoryL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4490
    TBool capture = ETrue;
62
f0c0788c4de2 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 57
diff changeset
  4491
    if ( ( ECamControllerImage == iController.CurrentMode() ) &&  
f0c0788c4de2 Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 57
diff changeset
  4492
            IsMemoryAvailableForCapturing() )
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4493
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4494
        capture = ETrue; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4495
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4496
    else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4497
        {   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4498
        TCamMediaStorage  storeToCheck = ECamMediaStorageCurrent;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4499
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4500
        if ( ECamControllerVideo == iController.CurrentMode() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4501
            ECamMediaStorageCard == iController.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4502
                IntegerSettingValue( ECamSettingItemVideoMediaStorage ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4503
            IsMemoryFullOrUnavailable( ECamMediaStorageCard ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4504
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4505
            storeToCheck =  ECamMediaStorageCard; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4506
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4507
        if(AllMemoriesFullOrUnavailable())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4508
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4509
            HBufC* text = StringLoader::LoadLC(R_NOTE_TEXT_ALLMEMORY_FULL);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4510
            TInt ret = ShowOOMNoteL( *text, EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4511
            capture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4512
            CleanupStack::PopAndDestroy(text);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4513
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4514
        else if(IsMemoryFullOrUnavailable( storeToCheck ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4515
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4516
            HBufC* text = StringLoader::LoadLC(R_NOTE_TEXT_MEMORY_FULL);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4517
            iMemoryNote = new( ELeave ) CAknStaticNoteDialog;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4518
            iMemoryNote->PrepareLC( R_CAM_OOM_NOTE_OK_CANCEL);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4519
            iMemoryNote->SetTextL( *text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4520
            iController.StopIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4521
            TInt ret = iMemoryNote->RunDlgLD();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4522
            iMemoryNote = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4523
            CleanupStack::PopAndDestroy( text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4524
            if(EAknSoftkeyOk == ret)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4525
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4526
                //when memoryDialog showed, redraw background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4527
                if ( IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4528
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4529
                    TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4530
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4531
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4532
                TInt supportedMemTypes = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4533
                TCamMediaStorage currentLocation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4534
                TInt key = ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4535
                        ? ECamSettingItemVideoMediaStorage
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4536
                        : ECamSettingItemPhotoMediaStorage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4537
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4538
                if ( iMMCRemoveNoteRequiredOnCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4539
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4540
                    iMMCRemoveNoteRequiredOnCapture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4541
                    currentLocation = static_cast<TCamMediaStorage>( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4542
                                        iController.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4543
                                        IntegerSettingValueUnfiltered( key ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4544
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4545
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4546
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4547
                    currentLocation = static_cast<TCamMediaStorage>( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4548
                                iController.IntegerSettingValue( key ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4549
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4550
                if(currentLocation != ECamMediaStoragePhone && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4551
				!IsMemoryFullOrUnavailable(ECamMediaStoragePhone) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4552
				!iController.IntegerSettingValue( ECamSettingItemRemovePhoneMemoryUsage ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4553
				{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4554
				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypePhone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4555
				}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4556
			if(currentLocation != ECamMediaStorageCard && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4557
				!IsMemoryFullOrUnavailable(ECamMediaStorageCard))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4558
				{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4559
				supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4560
				}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4561
			if(currentLocation != ECamMediaStorageMassStorage && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4562
				!IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4563
				{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4564
                    supportedMemTypes |= 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4565
                        AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4566
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4567
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4568
                CAknMemorySelectionDialogMultiDrive* memoryDialog = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4569
                        CAknMemorySelectionDialogMultiDrive::NewL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4570
                                                ECFDDialogTypeSelect,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4571
                                                R_CAM_MEMORY_SELECT_DIALOG,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4572
                                                EFalse,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4573
                                                supportedMemTypes );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4574
                CleanupStack::PushL(memoryDialog);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4575
                TDriveNumber driveNumber = static_cast<TDriveNumber>(KErrNotFound);    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4576
                CAknCommonDialogsBase::TReturnKey result = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4577
                                memoryDialog->ExecuteL( driveNumber );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4578
                CleanupStack::PopAndDestroy(memoryDialog);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4579
                if ( result != CAknCommonDialogsBase::TReturnKey(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4580
                                CAknCommonDialogsBase::ERightSoftkey) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4581
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4582
                    DriveInfo::TDefaultDrives memVal = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4583
                        static_cast<DriveInfo::TDefaultDrives>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4584
                        CamUtility::GetDriveTypeFromDriveNumber(driveNumber));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4585
                    TInt settingValue = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4586
                        CamUtility::MapFromSettingsListMemory( memVal );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4587
                    iController.SetIntegerSettingValueL(key,settingValue);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4588
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4589
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4590
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4591
                    //No impl.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4592
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4593
                capture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4594
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4595
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4596
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4597
                capture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4598
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4599
                iController.StartIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4600
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4601
            UpdateCba(); // Make sure that softkeys are visible.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4602
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4603
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4604
    PRINT1( _L("Camera <= CCamAppUi::CheckMemoryL, capture ok: %d"), capture );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4605
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CHECKMEMORYL, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4606
    			"e_CCamAppUi_CheckMemoryL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4607
    return capture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4608
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4609
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4610
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4611
// CCamAppUi::ShowErrorNoteL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4612
// Display error note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4613
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4614
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4615
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4616
CCamAppUi::ShowErrorNoteL( TCamMemoryStatus aStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4617
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4618
    PRINT( _L("Camera => CCamAppUi::ShowErrorNoteL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4619
    TInt resourceId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4620
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4621
    TCamMediaStorage currentLocation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4622
    if ( iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4623
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4624
        currentLocation = static_cast<TCamMediaStorage> 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4625
                    ( iController.IntegerSettingValueUnfiltered( ECamSettingItemVideoMediaStorage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4626
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4627
    else // photo or burst mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4628
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4629
        currentLocation = static_cast<TCamMediaStorage> 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4630
                    ( iController.IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4631
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4632
    TInt NumberOfParameters = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4633
    TInt drive;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4634
    TFileName path;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4635
    TInt DriveError = KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4636
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4637
    // load text from resource
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4638
    switch ( aStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4639
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4640
        case ECamMemoryStatusMassStorageFull:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4641
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4642
            // internal and card both full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4643
            resourceId = R_NOTE_TEXT_MASSMEMORY_FULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4644
            // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4645
            DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4646
            DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4647
            if ( DriveError == KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4648
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4649
                // %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4650
                NumberOfParameters = 1;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4651
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4652
            else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4653
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4654
                // no %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4655
                NumberOfParameters = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4656
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4657
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4658
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4659
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4660
        case ECamMemoryStatusFull:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4661
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4662
            if ( currentLocation == ECamMediaStorageMassStorage ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4663
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4664
                // internal mass storage full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4665
                resourceId = R_NOTE_TEXT_MASSMEMORY_FULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4666
                // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4667
                DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4668
                DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4669
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4670
            else if ( currentLocation == ECamMediaStoragePhone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4671
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4672
                // internal phone memory full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4673
                resourceId = R_NOTE_TEXT_NOT_ENOUGH_DEVICE_MEMORY;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4674
                // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4675
                DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4676
                DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4677
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4678
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4679
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4680
                // memory card full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4681
                resourceId = R_NOTE_TEXT_NOT_ENOUGH_MEMORY_CARD_DEFAULTNAME;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4682
                // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4683
                DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4684
                DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4685
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4686
            if ( DriveError == KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4687
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4688
                // %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4689
                NumberOfParameters = 1;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4690
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4691
            else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4692
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4693
                // no %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4694
                NumberOfParameters = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4695
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4696
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4697
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4698
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4699
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4700
        case ECamMemoryStatusInternalFull:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4701
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4702
            if ( currentLocation == ECamMediaStorageMassStorage ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4703
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4704
                // internal space full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4705
                resourceId = R_NOTE_TEXT_MASSMEMORY_FULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4706
                // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4707
                DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4708
                DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4709
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4710
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4711
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4712
                // internal space full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4713
                resourceId = R_NOTE_TEXT_NOT_ENOUGH_DEVICE_MEMORY;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4714
                // Get the root path of the memory.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4715
                DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4716
                DriveError = PathInfo::GetRootPath( path, drive );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4717
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4718
            if ( DriveError == KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4719
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4720
                // %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4721
                NumberOfParameters = 1;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4722
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4723
            else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4724
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4725
                // no %U  parameter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4726
                NumberOfParameters = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4727
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4728
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4729
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4730
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4731
        case ECamMemoryStatusCardNotInserted: // fallthrough
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4732
        case ECamMemoryStatusCardLocked:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4733
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4734
            // card not present or corrupt or locked
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4735
            resourceId = R_NOTE_TEXT_CARD_NOT_INSERTED;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4736
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4737
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4738
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4739
        case ECamMemoryStatusCardReadOnly:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4740
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4741
            // card read-only
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4742
            resourceId = R_NOTE_TEXT_CARD_READ_ONLY;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4743
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4744
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4745
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4746
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4747
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4748
            // invalid status - don't show note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4749
            return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4750
            }            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4751
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4752
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4753
    // prevent timeout to standby - stop standby timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4754
    iController.StopIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4755
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4756
    if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4757
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4758
        // Precapture view is visible... Enable the non-fading flag here to keep
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4759
        // viewfinder visible under the note. The non-fading flag is reset when
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4760
        // getting the EEventFocusGained event
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4761
        CCoeControl* container = static_cast<CCamViewBase*>( iView )->Container();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4762
        if ( container )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4763
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4764
            RDrawableWindow* window = container->DrawableWindow();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4765
            if ( window )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4766
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4767
                window->SetNonFading( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4768
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4769
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4770
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4771
    if ( NumberOfParameters == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4772
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4773
        // set error note text
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4774
        HBufC* text = StringLoader::LoadLC( resourceId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4775
        // show error note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4776
        CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4777
        note->PrepareLC( R_CAM_ERROR_NOTE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4778
        note->SetTextL( *text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4779
        note->RunDlgLD();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4780
        CleanupStack::PopAndDestroy( text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4781
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4782
    else if ( NumberOfParameters == 1 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4783
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4784
        // set error note text
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4785
        HBufC* text = StringLoader::LoadLC( resourceId, path, iEikonEnv );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4786
        // show error note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4787
        CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4788
        note->PrepareLC( R_CAM_ERROR_NOTE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4789
        note->SetTextL( *text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4790
        note->RunDlgLD();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4791
        CleanupStack::PopAndDestroy( text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4792
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4793
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4794
    // restart standby timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4795
    iController.StartIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4796
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4797
    PRINT( _L("Camera <= CCamAppUi::ShowErrorNoteL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4798
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4799
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4800
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4801
// CCamAppUi::ShowOOMNoteL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4802
// Display error note for OOM condition
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4803
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4804
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4805
TInt CCamAppUi::ShowOOMNoteL( TDesC& aLabel, TBool aWithCancel )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4806
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4807
    // prevent timeout to standby - stop standby timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4808
    iController.StopIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4809
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4810
    // show OOM note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4811
    CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4812
    if(aWithCancel)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4813
    	note->PrepareLC( R_CAM_OOM_NOTE_OK_CANCEL);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4814
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4815
    	note->PrepareLC( R_CAM_OOM_NOTE_OK_EMPTY);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4816
    note->SetTextL( aLabel );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4817
    TInt ret = note->RunDlgLD();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4818
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4819
    // restart standby timer
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4820
    iController.StartIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4821
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4822
    return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4823
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4824
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4825
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4826
// CCamAppUi::ShowMMCRemovalNoteIfRequiredL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4827
// Shows the mmc removal note if it is required
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4828
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4829
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4830
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4831
CCamAppUi::ShowMMCRemovalNoteIfRequiredL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4832
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4833
    PRINT( _L("Camera => CCamAppUi::ShowMMCRemovalNoteIfRequiredL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4834
    // If we have detected a removal and not shown the note.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4835
    if ( iViewState != ECamViewStateStandby && iMMCRemoveNoteRequired )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4836
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4837
        PRINT( _L("Camera <> Need to show note") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4838
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4839
        iMMCRemoveNoteRequired = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4840
        // Show the card not inserted note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4841
        if( !iSendAsInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4842
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4843
            PRINT( _L("Camera <> showing note..") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4844
            ShowErrorNoteL( ECamMemoryStatusCardNotInserted );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4845
            PRINT( _L("Camera <> ..done") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4846
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4847
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4848
    if ( IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4849
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4850
        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4851
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4852
    PRINT( _L("Camera <= CCamAppUi::ShowMMCRemovalNoteIfRequiredL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4853
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4854
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4855
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4856
// CCamAppUi::CheckMemoryCard
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4857
// Check status of the memory card
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4858
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4859
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4860
void CCamAppUi::CheckMemoryCard( TBool& aFull,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4861
                                TCamMemoryStatus& aStatus, TCamMediaStorage aCurrentLocation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4862
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4863
    // check if memory card is full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4864
    aFull = MemoryFull( ECamMediaStorageCard, aCurrentLocation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4865
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4866
    // get status of card
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4867
    TCamMemoryCardStatus cardStatus = CamUtility::MemoryCardStatus();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4868
    switch ( cardStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4869
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4870
        case ECamMemoryCardLocked:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4871
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4872
            // card is locked
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4873
            aStatus = ECamMemoryStatusCardLocked;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4874
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4875
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4876
        case ECamMemoryCardInserted:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4877
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4878
            aStatus = ECamMemoryStatusOK;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4879
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4880
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4881
        case ECamMemoryCardNotInserted:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4882
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4883
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4884
            aStatus = ECamMemoryStatusCardNotInserted;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4885
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4886
            break;        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4887
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4888
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4889
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4890
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4891
// CCamAppUi::MemoryFull
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4892
// Check if the memory location (phone or card) is full
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4893
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4894
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4895
TBool 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4896
CCamAppUi::MemoryFull( TCamMediaStorage aStorage, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4897
                       TCamMediaStorage aCurrentLocation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4898
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4899
    PRINT( _L("Camera => CCamAppUi::MemoryFull") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4900
    TBool cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4901
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4902
    if ( iMode != ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4903
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4904
        // check there is space for image(s)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4905
        TInt numImages = iController.ImagesRemaining( aStorage, IsBurstEnabled() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4906
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4907
        // at least 1 image for still capture and 2 for sequence capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4908
        if ( ( iImageMode == ECamImageCaptureSingle && numImages > 0 ) ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4909
                numImages > 1 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4910
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4911
            cardFull = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4912
            }            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4913
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4914
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4915
            cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4916
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4917
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4918
    else // capture mode is video
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4919
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4920
        // If we want to know the remaining time at the current storage location
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4921
        // we can obtain this from the engine.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4922
        if ( aStorage == aCurrentLocation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4923
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4924
            TTimeIntervalMicroSeconds timeRemaining = iController.RecordTimeRemaining();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4925
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4926
            // Check that enough rec time available
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4927
            // or that we are recording short (MMS) video
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4928
            if ( timeRemaining >= KMemoryFullVideoRemaining )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4929
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4930
                PRINT( _L("Camera <> not full 1") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4931
                cardFull = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4932
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4933
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4934
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4935
                PRINT( _L("Camera <> full 1") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4936
                cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4937
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4938
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4939
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4940
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4941
            // We want to know how much remaining time is available on the
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4942
            // storage location not currently in use.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4943
            // We don't have a reliable way of estimating this, so we will
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4944
            // assume that if there is more space available than on the current
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4945
            // storage location, then the memory is not full.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4946
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4947
            TTimeIntervalMicroSeconds phoneMemoryFree = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4948
            CamUtility::MemoryFree( DriveInfo::EDefaultPhoneMemory );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4949
            TTimeIntervalMicroSeconds cardMemoryFree =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4950
            CamUtility::MemoryFree( DriveInfo::EDefaultRemovableMassStorage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4951
            TTimeIntervalMicroSeconds MassMemoryFree =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4952
            CamUtility::MemoryFree( DriveInfo::EDefaultMassStorage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4953
            if ( aCurrentLocation == ECamMediaStoragePhone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4954
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4955
                if ( phoneMemoryFree > cardMemoryFree
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4956
                     && phoneMemoryFree > MassMemoryFree
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4957
                )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4958
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4959
                    PRINT( _L("Camera <> full 2") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4960
                    cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4961
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4962
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4963
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4964
                    PRINT( _L("Camera <> not full 2") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4965
                    cardFull = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4966
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4967
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4968
            else if ( aCurrentLocation == ECamMediaStorageMassStorage )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4969
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4970
                if ( MassMemoryFree > cardMemoryFree
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4971
                        && MassMemoryFree > phoneMemoryFree )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4972
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4973
                    PRINT( _L("Camera <> full 3") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4974
                    cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4975
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4976
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4977
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4978
                    PRINT( _L("Camera <> not full 3") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4979
                    cardFull = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4980
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4981
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4982
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4983
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4984
                if ( cardMemoryFree > phoneMemoryFree 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4985
                     && cardMemoryFree > MassMemoryFree )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4986
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4987
                    PRINT( _L("Camera <> full 4") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4988
                    cardFull = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4989
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4990
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4991
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4992
                    PRINT( _L("Camera <> not full 4") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4993
                    cardFull = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4994
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4995
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4996
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4997
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4998
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4999
    PRINT1( _L("Camera <= CCamAppUi::MemoryFull, full:%d"), cardFull );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5000
    return cardFull;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5001
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5002
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5003
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5004
// CCamAppUi::StartCaptureL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5005
// Starts the video/photo capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5006
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5007
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5008
TKeyResponse 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5009
CCamAppUi::StartCaptureL( const TKeyEvent& /*aKeyEvent*/ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5010
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5011
    PRINT( _L("Camera => CCamAppUi::StartCaptureL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5012
    iLensCoverExit = EFalse; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5013
    iSelfTimedCapture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5014
    if ( iMode != ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5015
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5016
        // Check for active viewfinder before proceeding with capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5017
        if ( !iController.IsViewFinding() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5018
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5019
          // VF not active - stop capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5020
          PRINT( _L("Camera <= CCamAppUi::StartCaptureL, not vf") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5021
          return EKeyWasNotConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5022
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5023
        // If the view is in self-timer mode, pressing of the shutter
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5024
        // button initiates the timer...
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5025
        if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5026
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5027
            __ASSERT_DEBUG( iSelfTimer, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5028
            // Will start timer if not already started.  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5029
            // If already started, forces capture NOW.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5030
            /*iSelfTimer->StartSelfTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5031
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5032
            // Change CBA to be SK1 (Blank) SK2 (Cancel)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5033
            UpdateCba();*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5034
            HandleCommandL(ECamCmdSelfTimerActivate);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5035
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5036
        else // Not in SelfTimer mode so just take the photo.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5037
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5038
            if ( iController.IsProcessingCapture() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5039
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5040
                PRINT( _L("Camera <= CCamAppUi::StartCaptureL - already processing - ignored capture key") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5041
                return EKeyWasNotConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5042
                }
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5043
            else if( iController.ActiveCamera() == ECamActiveCameraSecondary &&
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5044
                    iController.IsRotationActive() )
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5045
                {
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5046
                PRINT( _L("Camera <= CCamAppUi::StartCaptureL - rotation in processing - ignored capture key") );
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5047
                return EKeyWasNotConsumed;                
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  5048
                }
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5049
            // Start capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5050
            iController.Capture();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5051
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5052
            // Ensure softkeys are correct for sequence
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5053
            if ( IsBurstEnabled() )            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5054
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5055
                if( ECamImageCaptureBurst == iImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5056
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5057
                    //Disable cancel autofocus and capture functionality from now on until burst is finished.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5058
                    PRINT( _L("Camera <> CCamAppUi::StartCaptureL, SetNoBurstCancel( ETrue )") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5059
	                  iController.SetKeyUp();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5060
                    iController.SetNoBurstCancel( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5061
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5062
                // Make sure cancel softkey is displayed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5063
                iPreventActivePaletteDisplay = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5064
                static_cast<CCamViewBase*>( iView )->UnsetCourtesySoftKeysL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5065
                // Change CBA to be SK1 (Blank) SK2 (Cancel)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5066
                UpdateCba();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5067
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5068
                // disable timeout to standby during burst capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5069
                iController.StopIdleTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5070
                }            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5071
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5072
        // Shutter key - full press -> perform capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5073
        PRINT( _L("Camera <= CCamAppUi::StartCaptureL, image capture requested") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5074
        return EKeyWasConsumed;           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5075
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5076
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5077
    // video capture mode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5078
    else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5079
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5080
        // check for available space before proceeding with capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5081
        TInt callType( EPSCTsyCallTypeUninitialized );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5082
        RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5083
        // video call or no memory available - stop capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5084
        if ( callType == EPSCTsyCallTypeH324Multimedia || !iController.IsViewFinding() || !CheckMemoryL() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5085
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5086
            PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video no memory") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5087
            return EKeyWasNotConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5088
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5089
        else if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5090
                iController.IsHdmiCableConnected() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5091
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5092
            iController.SetPendingHdmiEvent( ECamHdmiCableConnectedBeforeRecording );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5093
            PRINT( _L("Camera <= CCamAppUi::StartCaptureL, HDMI Cable connected") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5094
            return EKeyWasNotConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5095
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5096
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5097
        PERF_EVENT_END_L1( EPerfEventKeyToCapture );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5098
        PERF_EVENT_START_L1( EPerfEventStartVideoRecording );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5099
        static_cast<CCamViewBase*>( iView )->UnsetCourtesySoftKeysL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5100
        iController.StartVideoRecordingL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5101
        PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video capture requested") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5102
        return EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5103
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5104
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5105
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5106
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5107
// CCamAppUi::EndCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5108
// Stops the capture of video
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5109
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5110
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5111
void CCamAppUi::EndCapture()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5112
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5113
    PRINT( _L("Camera => CCamAppUi::EndCapture") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5114
    if ( ECamControllerVideo == iMode && !iController.IsDemandKeyRelease() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5115
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5116
        TCamCaptureOperation operation = iController.CurrentOperation();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5117
        // if in video recording or paused state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5118
        if ( ECamCapturing == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5119
                || ECamPaused    == operation )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5120
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5121
            // if already requested to stop the recording
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5122
            // but the operation hasn't completed yet
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5123
            // then just return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5124
            if ( iWaitTimer->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5125
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5126
                return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5127
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5128
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5129
            ZoomPane()->StopZoom();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5130
            ZoomPane()->MakeVisible( EFalse, ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5131
            // ignore any errors (eg out of memory)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5132
            TRAP_IGNORE( SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5133
            TRAP_IGNORE( DisplayWaitDialogL() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5134
            // give the wait dialog a chance to display itself
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5135
            iWaitTimer->Start( 0, 0,  TCallBack( StopVideoRecording, this ) );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5136
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5137
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5138
    PRINT( _L("Camera <= CCamAppUi::EndCapture") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5139
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5140
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5141
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5142
// CCamAppUi::SwitchOrientationIfRequiredL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5143
// Change to the new orientation if necessary
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5144
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5145
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5146
void CCamAppUi::SwitchOrientationIfRequiredL( TInt aNewOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5147
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5148
    TInt error = KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5149
    // No orientation specified, find the default orientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5150
    if ( aNewOrientation == EAppUiOrientationUnspecified )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5151
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5152
        if ( iController.UiConfigManagerPtr()->IsSecondaryCameraSupported() ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5153
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5154
            // Default orientation is determined by current active camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5155
            if ( IsSecondCameraEnabled() && !IsQwerty2ndCamera() )   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5156
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5157
                error = CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, aNewOrientation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5158
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5159
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5160
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5161
                error = CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, aNewOrientation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5162
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5163
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5164
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5165
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5166
            error = CamUtility::GetPsiInt( ECamPsiOrientation, aNewOrientation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5167
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5168
        }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5169
    TAppUiOrientation currentOrientation = Orientation();        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5170
    if ( !error && ( aNewOrientation != currentOrientation ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5171
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5172
        PRINT( _L("Camera => CCamAppUi::SwitchOrientationIfRequiredL set orient" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5173
        SetOrientationL( static_cast<TAppUiOrientation>( aNewOrientation ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5174
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5175
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5176
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5177
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5178
// CCamAppUi::HandleScreenDeviceChangedL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5179
// Handle change of orientation etc.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5180
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5181
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5182
void CCamAppUi::HandleScreenDeviceChangedL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5183
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5184
    PRINT( _L("Camera => CCamAppUi::HandleScreenDeviceChangedL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5185
    CAknAppUiBase::HandleScreenDeviceChangedL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5186
    if ( iEngineConstructionDelayed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5187
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5188
        PRINT( _L("CCamAppUi::HandleScreenDeviceChangedL continuing engine construction") );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5189
        iEngineConstructionDelayed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5190
        iController.CompleteConstructionL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5191
        // Don't set the target mode here. If the application is not embedded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5192
        // the mode will already be correct. If embedded, the target mode is set
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5193
        // when the HandleNewFileL function is called.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5194
        iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5195
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5196
        // pre-construct side-pane & zoom pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5197
        // get whether we overlay sidepane over view-finder
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5198
        TBool overlayViewFinder = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5199
        User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5200
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5201
        iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5202
        User::LeaveIfError(iResourceLoaders.Append(iCamSidePane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5203
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5204
        iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5205
        User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5206
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5207
        // Exit standby mode now 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5208
        // (unless still waiting for HandleNewFileL command - embedded only)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5209
        if ( IsConstructionComplete() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5210
            {   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5211
            // make sure standby exits as this may not actually result in 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5212
            // a view switch if the correct view is already activated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5213
            if( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5214
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5215
                iView->HandleCommandL( ECamCmdExitStandby ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5216
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5217
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5218
            iViewState = ECamViewStatePreCapture;      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5219
            TrySwitchViewL();                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5220
            } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5221
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5222
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5223
    if ( iController.UiConfigManagerPtr()->IsSecondaryCameraSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5224
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5225
        if ( iCameraSwitchDelayed )       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5226
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5227
            PRINT( _L("CCamAppUi::HandleScreenDeviceChangedL restarting switch camera") );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5228
            iCameraSwitchDelayed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5229
            iController.SwitchCameraL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5230
            // The keys will have been blanked - update them
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5231
            static_cast<CCamViewBase*>( iView )->UpdateCbaL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5232
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5233
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5234
    PRINT( _L("Camera <= CCamAppUi::HandleScreenDeviceChangedL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5235
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5236
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5237
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5238
// CCamAppUi::StopVideoRecording
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5239
// Stops the video recording
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5240
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5241
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5242
TInt CCamAppUi::StopVideoRecording( TAny* aAny )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5243
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5244
    PRINT( _L("Camera => CCamAppUi::StopVideoRecording") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5245
    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5246
    __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5247
    appui->iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5248
    appui->iController.StopVideoRecordingAsync();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5249
    PRINT( _L("Camera <= CCamAppUi::StopVideoRecording") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5250
    return KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5251
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5252
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5253
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5254
// CCamAppUi::CallExit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5255
// Exit the application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5256
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5257
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5258
TInt CCamAppUi::CallExit( TAny* aAny )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5259
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5260
    PRINT( _L("Camera => CCamAppUi::CallExit") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5261
    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5262
    __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5263
    appui->iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5264
    appui->Exit();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5265
    return KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5266
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5267
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5268
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5269
// CCamAppUi::CloseAppL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5270
// Exit the application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5271
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5272
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5273
void CCamAppUi::CloseAppL()  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5274
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5275
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5276
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5277
    PRINT( _L("Camera => CCamAppUi::CloseAppL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5278
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5279
    // Special considerations needed for secondary camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5280
    // regarding scene mode and face tracking state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5281
    if ( IsSecondCameraEnabled() && !IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5282
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5283
        // This includes storing the face tracking value
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5284
        iController.HandleSecondaryCameraExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5285
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5286
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5287
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5288
        iController.StoreFaceTrackingValue(); // store the current FT setting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5289
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5290
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5291
    // cancel the self timer if active - can be active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5292
    // if closing the slide while counting down
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5293
    if ( iInSelfTimerMode != ECamSelfTimerDisabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5294
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5295
        SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5296
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5297
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5298
    // if we are exiting cam app, we dont need any updates
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5299
    // for the navipane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5300
    if ( NULL != iNaviCounterControl && NULL != iNaviPaneCounterControl && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5301
         NULL != iNaviProgressBarControl && NULL != iNaviPaneProgressBarControl )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5302
        { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5303
        UpdateNaviModelsL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5304
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5305
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5306
    if ( iEikonEnv->StartedAsServerApp() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5307
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5308
        TCamCaptureOperation operation( iController.CurrentOperation() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5309
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5310
        // If recording a video, ensure exit after video recording process has completed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5311
        if( ECamControllerVideo == iMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5312
                && ( ECamCapturing == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5313
                  || ECamPausing   == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5314
                  || ECamPaused    == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5315
                  || ECamResuming  == operation ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5316
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5317
            iController.EnterShutdownMode( EFalse );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5318
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5319
        // Otherwise, close application immediately.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5320
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5321
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5322
            iController.EnterShutdownMode( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5323
            Exit();            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5324
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5325
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5326
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5327
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5328
        // this will exit when any current process completes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5329
        iController.EnterShutdownMode( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5330
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5331
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5332
    if( iController.IntegerSettingValue( ECamSettingItemPhotoMediaStorage ) == ECamMediaStorageNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5333
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5334
        iController.SetIntegerSettingValueL(ECamSettingItemPhotoMediaStorage, iInternalStorage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5335
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5336
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5337
    if( iController.IntegerSettingValue( ECamSettingItemVideoMediaStorage ) == ECamMediaStorageNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5338
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5339
        iController.SetIntegerSettingValueL(ECamSettingItemVideoMediaStorage, iInternalStorage );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5340
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5341
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5342
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5343
    PRINT( _L("Camera <= CCamAppUi::CloseAppL") )        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5344
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP_CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5345
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5346
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5347
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5348
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5349
// CCamAppUi::InternalExitL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5350
// Exit the application from an internal call - this often means
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5351
// just going to the background and resetting the settings/modes
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5352
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5353
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5354
void CCamAppUi::InternalExitL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5355
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5356
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_INTERNALEXITL, "e_CCamAppUi_InternalExitL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5357
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5358
    PRINT( _L("Camera => CCamAppUi::InternalExitL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5359
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5360
    iController.StoreFaceTrackingValue(); // store the current FT setting
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5361
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5362
    if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5363
         iController.UiConfigManagerPtr()->IsLocationSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5364
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5365
        // If record location setting is on, stop location trail
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5366
        if ( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5367
          	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5368
          	// The parameter ETrue for also closing the session to location utility server
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5369
          	// when exiting camera.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5370
          	iController.StopLocationTrail( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5371
          	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5372
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5373
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5374
    if( !iController.IsSavingInProgress() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5375
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5376
        iController.ReleaseArray(ETrue);  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5377
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5378
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5379
    if ( iEikonEnv->StartedAsServerApp() || !iController.AlwaysOnSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5380
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5381
        CloseAppL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5382
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5383
    else if ( SettingsLaunchedFromCamera() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5384
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5385
        //If internal exit was called from settings, we need to set the camera to
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5386
        //background before closing it to prevent view switch and that way ensuring
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5387
        //that all the camera resources are released in exit.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5388
        SendCameraAppToBackgroundL();                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5389
        CloseAppL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5390
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5391
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5392
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5393
        // if UI orientetion override is supported or lens cover is not and 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5394
		// exiting 2ndary camera, set cameraswitch to main camera since 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5395
		// always starting in maincamera stillmode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5396
        if ( iController.UiConfigManagerPtr() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5397
             ( iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5398
               !iController.UiConfigManagerPtr()->IsLensCoverSupported() ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5399
             IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5400
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5401
            iController.SetCameraSwitchRequired( ESwitchSecondaryToPrimary );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5402
            }       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5403
        else if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5404
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5405
            PRINT( _L("Camera <> SetCameraSwitchRequired -> ESwitchToUnknown") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5406
            iController.SetCameraSwitchRequired( ESwitchToUnknown );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5407
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5408
        // cancel the self timer if active - can be active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5409
        // if closing the slide while counting down
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5410
        if ( iInSelfTimerMode != ECamSelfTimerDisabled)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5411
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5412
            SelfTimerEnableL( ECamSelfTimerDisabled );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5413
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5414
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5415
        if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5416
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5417
            iController.SliderCloseEventActioned();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5418
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5419
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5420
        iController.SetEndKeyExitWaiting( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5421
        PRINT( _L("Camera CCamAppUi::InternalExitL - setting zoom reset pending") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5422
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5423
        iCamZoomPane->ResetToDefaultAfterPrepare( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5424
        SendCameraAppToBackgroundL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5425
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5426
        // if faster startup feature is supported, always start in stillmode after exit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5427
        if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5428
             iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5429
             iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5430
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5431
            PRINT( _L("Camera <> InternalExitL - switching to still precapture") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5432
            iTargetMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5433
            iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5434
            TrySwitchViewL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5435
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5436
        else if ( iView && iViewState != ECamViewStatePreCapture && iReturnedFromPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5437
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5438
            PRINT( _L("Camera: CCamAppUi::InternalExitL - switching to precapture mode") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5439
            iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5440
            TrySwitchViewL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5441
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5442
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5443
        // If the application is already in the background but has not released
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5444
        // the resources (e.g. it was behind an eikon server window and had not yet set 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5445
        // the iPretendExit flag) then the view needs to know that the resources should 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5446
        // be released now.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5447
        // This situation occurs when the application is 'pretending' to exit after a
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5448
        // slider closed event, but the keypad lock note appeared (but only if it was
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5449
        // in the middle of capturing a sequence as the exit is delayed for the sequence 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5450
        // to complete).
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5451
        // HandleFocusLoss() releases the resources in situations where the app was
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5452
        // 'continuing in the background'. This release of resources will only occur
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5453
        // once as the iContinueInBackground flag is reset as soon as the resources are 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5454
        // released.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5455
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5456
        if ( iView && iReturnedFromPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5457
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5458
            PRINT( _L("Camera InternalExitL calling iView->HandleFocusLossL()") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5459
            static_cast<CCamViewBase*>( iView )->HandleFocusLossL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5460
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5461
        // Reset active palette position. As this is done before pretended exit,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5462
        // no AP update is needed when the application is returned to foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5463
        if( iActivePaletteHandler && iReturnedFromPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5464
            {            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5465
            iActivePaletteHandler->ResetToDefaultItem();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5466
            // Ensure AP visibility on camera startup (also for 2ndary camera)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5467
            // unless UI orientation override is used
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5468
            if ( iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5469
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5470
                iActivePaletteHandler->SetVisibility( EFalse );	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5471
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5472
            else    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5473
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5474
                iActivePaletteHandler->SetVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5475
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5476
        if( ECamViewStatePreCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5477
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5478
            iDrawPreCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5479
            if ( !iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5480
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5481
                RaisePreCaptureCourtesyUI(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5482
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5483
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5484
            if ( IsSecondCameraEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5485
                 && !IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5486
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5487
                if ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5488
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5489
                    SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5490
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5491
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5492
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5493
                    SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY );      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5494
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5495
                // Special considerations needed for secondary camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5496
                // regarding scene mode and face tracking state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5497
                iController.HandleSecondaryCameraExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5498
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5499
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5500
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5501
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5502
        // Cancel delayed sensor initialization, in case it's still pending when 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5503
        // internal exit is requested.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5504
        if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5505
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5506
            CancelSensorIdle();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5507
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5508
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5509
        if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5510
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5511
            // Reset the flash error status
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5512
            iController.FlashStatus()->SetFlashError( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5513
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5514
/*#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5515
        if ( iSendFileInCall )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5516
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5517
            // bring phone app to fore ground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5518
            BringPhoneAppToForeGroundL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5519
            }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5520
#endif // __WINS__   */
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5521
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5522
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5523
    if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5524
            && ShowPostCaptureView() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5525
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5526
        SetAssumePostCaptureView( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5527
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5528
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5529
    if( iController.IsViewFinding() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5530
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5531
        iController.StopViewFinder();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5532
        iViewFinderStopped = ETrue;        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5533
        } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5534
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5535
    if ( iStartupLogoController )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5536
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5537
        iStartupLogoController->ShowLogo();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5538
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5539
    SubmergeToolbar(); //For preventing toolbar to show up when starting camera again.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5540
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5541
    PRINT( _L("Camera <= CCamAppUi::InternalExitL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5542
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP_CCAMAPPUI_INTERNALEXITL, "e_CCamAppUi_InternalExitL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5543
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5544
    } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5545
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5546
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5547
// CCamAppUi::CallSwitch
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5548
// Switch view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5549
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5550
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5551
TInt CCamAppUi::CallSwitch( TAny* aAny )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5552
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5553
    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5554
    __ASSERT_DEBUG( appui != NULL, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5555
    appui->iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5556
    TRAP_IGNORE( appui->TrySwitchViewL() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5557
    return KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5558
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5559
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5560
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5561
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5562
// CCamAppUi::AppInBackground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5563
// Whether or not the app is in the background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5564
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5565
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5566
TBool CCamAppUi::AppInBackground( TBool aIncludeNotifier ) const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5567
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5568
    PRINT1( _L("Camera => CCamAppUi::AppInBackground( %d )" ), aIncludeNotifier );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5569
    TBool aBackground = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5570
    // Gets the window group id of the app coming in foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5571
    TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5572
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5573
    PRINT1( _L("Camera    CCamAppUi::AppInBackground windowGroupId=%d" ), windowGroupId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5574
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5575
    // Check if the window group moving to the front is the AknCapServer.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5576
    // This often happens when OOM or out of disk space notes are shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5577
    TBool capServerGroup = CamUtility::IdMatchesName( windowGroupId, KAknCapServer );     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5578
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5579
    // AknNotifyServer notifies e.g. Location related events.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5580
    TBool nfyServerGroup = CamUtility::IdMatchesName( windowGroupId, KAknNotifyServer );     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5581
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5582
	// KPbkSever - Contacts App; Assign to contacts scenario
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5583
	TBool pbkServerGroup = CamUtility::IdMatchesName( windowGroupId, KPbkServer );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5584
    PRINT1( _L("Camera    CCamAppUi::AppInBackground iMyWgId=%d" ), iMyWgId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5585
    // if the foreground app is not this app
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5586
    if ( windowGroupId != iMyWgId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5587
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5588
        // if another app has the foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5589
        if ( !capServerGroup 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5590
          && !nfyServerGroup
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5591
		  && !pbkServerGroup
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5592
          &&  windowGroupId != iEikonServerWindowGroupId 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5593
          &&  windowGroupId != iBTServerWindowGroupId 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5594
           )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5595
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5596
            PRINT(_L("Camera    CCamAppUi::AppInBackground non-AKN, non-EIK serv has focus"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5597
            aBackground = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5598
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5599
        // if the eikon server has the foreground and we're classing that as
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5600
        // putting us in the background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5601
        else if ( aIncludeNotifier )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5602
            {           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5603
            // Check whether the new foreground window is an Eikon window
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5604
            if ( windowGroupId == iEikonServerWindowGroupId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5605
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5606
                PRINT(_L("Camera <> CCamAppUi::AppInBackground EIK SERV HAS FOCUS"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5607
                aBackground = ETrue;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5608
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5609
            // Check if AknCapServer is in the foreground (includes other notes)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5610
            else if ( capServerGroup )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5611
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5612
                PRINT(_L("Camera <> CCamAppUi::AppInBackground CAP SERV HAS FOCUS"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5613
                aBackground = ETrue;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5614
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5615
            else if( nfyServerGroup )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5616
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5617
                PRINT(_L("Camera <> CCamAppUi::AppInBackground Avkon notify server has focus"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5618
                aBackground = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5619
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5620
            else if ( windowGroupId == iBTServerWindowGroupId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5621
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5622
                PRINT(_L("Camera <> CCamAppUi::AppInBackground BT SERV HAS FOCUS"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5623
                aBackground = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5624
                }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5625
            else // empty statement for lint
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5626
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5627
                }                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5628
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5629
        else // empty statement for lint
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5630
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5631
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5632
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5633
    PRINT1( _L("Camera <= CCamAppUi::AppInBackground return(%d)" ), aBackground );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5634
    return aBackground;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5635
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5636
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5637
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5638
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5639
// CCamAppUi::LaunchHelpL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5640
// Launch the context sensitive help application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5641
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5642
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5643
void CCamAppUi::LaunchHelpL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5644
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5645
    PRINT( _L("Camera => CCamAppUi::LaunchHelpL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5646
    TCoeHelpContext helpContext;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5647
    helpContext.iMajor = TUid::Uid( KCameraappUID );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5648
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5649
    // Check which view is active to obtain the help context
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5650
    TVwsViewId currentViewId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5651
    TInt err = GetActiveViewId( currentViewId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5652
    if ( err == KErrNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5653
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5654
        switch ( currentViewId.iViewUid.iUid )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5655
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5656
            case ECamViewIdStillPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5657
                // Still precapture can have multiple modes. We must ask it
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5658
                // for the current context.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5659
                iStillCaptureView->GetHelpContext( helpContext );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5660
                break;            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5661
            case ECamViewIdStillPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5662
                helpContext.iContext = KLCAM_HLP_POST_PHOTO;                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5663
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5664
            case ECamViewIdVideoPreCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5665
                // Video precapture can have multiple modes. We must ask it
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5666
                // for the current context.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5667
                iVideoCaptureView->GetHelpContext( helpContext );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5668
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5669
            case ECamViewIdVideoPostCapture:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5670
                helpContext.iContext = KLCAM_HLP_POST_VIDEO;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5671
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5672
            case ECamViewIdBurstThumbnail:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5673
                helpContext.iContext = KLCAM_HLP_POST_SEQ;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5674
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5675
            case ECamViewIdVideoSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5676
                helpContext.iContext = KLCAM_HLP_SETTINGS_VIDEO;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5677
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5678
            case ECamViewIdPhotoSettings:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5679
                helpContext.iContext = KLCAM_HLP_SETTINGS_PHOTO;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5680
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5681
            case ECamViewIdPhotoUserSceneSetup:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5682
                helpContext.iContext = KLCAM_HLP_SETTINGS_PHOUSER;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5683
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5684
            default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5685
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5686
            }                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5687
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5688
    else if ( err == KErrNotFound && iPreCaptureMode == ECamPreCapStandby )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5689
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5690
        // This is a work-around for the problem of GetActiveViewId()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5691
        // returning -1 when in the Standby view.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5692
        if ( IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5693
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5694
            helpContext.iContext = KLCAM_HLP_STANDYBY_EM;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5695
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5696
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5697
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5698
            helpContext.iContext = KLCAM_HLP_STANDYBY_EM;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5699
            }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5700
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5701
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5702
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5703
        User::Leave( err );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5704
        }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5705
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5706
    PRINT1( _L("Camera <> CCamAppUi::LaunchHelpL, help context: %S"), &(helpContext.iContext) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5707
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5708
    // Create the context array and append the single context item
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5709
    CArrayFix<TCoeHelpContext>* contextArray = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5710
        new ( ELeave ) CArrayFixFlat<TCoeHelpContext> ( 1 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5711
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5712
    CleanupStack::PushL( contextArray );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5713
    contextArray->AppendL( helpContext );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5714
    CleanupStack::Pop( contextArray );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5715
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5716
    //Launch help - takes ownership of context array
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5717
    HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5718
                                         contextArray );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5719
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5720
    PRINT( _L("Camera <= CCamAppUi::LaunchHelpL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5721
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5722
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5723
#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5724
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5725
// CCamAppUi::ProcessCommandParametersL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5726
// Allow Camera application to respond to request for in-call send
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5727
// functionality from Phone application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5728
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5729
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5730
TBool CCamAppUi::ProcessCommandParametersL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5731
    TApaCommand aCommand,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5732
    TFileName& aDocumentName,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5733
    const TDesC8& /*aTail*/ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5734
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5735
    PRINT( _L("CCamAppUi::ProcessCommandParametersL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5736
    // Check if we should start in SFI mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5737
/*    if ( aCommand == EApaCommandOpen && aDocumentName == KSFITrailing )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5738
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5739
        if ( !SFIUtility() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5740
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5741
            PRINT( _L("CCamAppUi::ProcessCommandParametersL !!") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5742
            return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5743
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5744
        SFIUtility()->IsCLIValidL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5745
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5746
        iSendFileInCall = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5747
        PRINT( _L("CCamAppUi::ProcessCommandParametersL iSendFileInCall = ETrue") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5748
        // Make sure that the static settings are loaded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5749
        iController.LoadStaticSettingsL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5750
        }*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5751
    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5752
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5753
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5754
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5755
// CCamAppUi::HandleMessageL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5756
// Bring Camera app to foreground in response to request for in-call send
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5757
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5758
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5759
MCoeMessageObserver::TMessageResponse CCamAppUi::HandleMessageL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5760
    TUint32 aClientHandleOfTargetWindowGroup,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5761
    TUid aMessageUid,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5762
    const TDesC8& aMessageParameters )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5763
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5764
    PRINT( _L("CCamAppUi::HandleMessageL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5765
    // Go to SFI mode at run-time if requested by SFIUtils
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5766
    // using a window server message.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5767
    if ( aMessageUid.iUid == 0 && aMessageParameters.Length() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5768
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5769
        TInt lengthInCharacters = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5770
            ( aMessageParameters.Length() * sizeof( TUint8 ) ) /
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5771
            sizeof( TUint16 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5772
        TPtrC message(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5773
            reinterpret_cast<const TUint16*>( aMessageParameters.Ptr() ),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5774
            lengthInCharacters );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5775
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5776
        /*if ( message == KSFITrailing )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5777
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5778
            if ( !SFIUtility() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5779
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5780
                // Jump to foreground anyway, even if SFI mode cannot
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5781
                // be activated.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5782
                iEikonEnv->RootWin().SetOrdinalPosition( 0, 0 ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5783
                return CAknAppUi::HandleMessageL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5784
                    aClientHandleOfTargetWindowGroup, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5785
                    aMessageUid, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5786
                    aMessageParameters );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5787
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5788
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5789
            SFIUtility()->IsCLIValidL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5790
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5791
            iSendFileInCall = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5792
            PRINT( _L("CCamAppUi::HandleMessageL iSendFileInCall = ETrue") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5793
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5794
            // Jump to foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5795
            iEikonEnv->RootWin().SetOrdinalPosition( 0, 0 ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5796
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5797
            // load embedded static settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5798
            iController.LoadStaticSettingsL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5799
            }*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5800
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5801
    return CAknAppUi::HandleMessageL( aClientHandleOfTargetWindowGroup, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5802
        aMessageUid, aMessageParameters);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5803
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5804
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5805
#endif // HANDLE_TRANSITIONAL_UI    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5806
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5807
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5808
// CCamAppUi::SidePane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5809
// Return reference to side-pane object
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5810
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5811
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5812
CCamSidePane* CCamAppUi::SidePane()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5813
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5814
    return iCamSidePane;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5815
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5816
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5817
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5818
// CCamAppUi::ZoomPane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5819
// Return reference to zoom-pane object
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5820
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5821
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5822
CCamZoomPane* CCamAppUi::ZoomPane()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5823
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5824
    return iCamZoomPane;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5825
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5826
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5827
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5828
// CCamAppUi::CurrentViewState
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5829
// Return current view state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5830
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5831
//        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5832
TCamViewState CCamAppUi::CurrentViewState() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5833
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5834
    return iViewState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5835
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5836
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5837
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5838
// CCamAppUi::TargetViewState
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5839
// Returns target view state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5840
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5841
//        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5842
TCamViewState CCamAppUi::TargetViewState()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5843
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5844
    return iTargetViewState;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5845
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5846
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5847
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5848
// CCamAppUi::TargetMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5849
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5850
//  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5851
TCamCameraMode CCamAppUi::TargetMode() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5852
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5853
    return iTargetMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5854
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5855
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5856
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5857
// CCamAppUi::HandleShutterKeyL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5858
// Handles the shutter key press
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5859
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5860
//   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5861
void CCamAppUi::HandleShutterKeyL( TBool aPressed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5862
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5863
    // only handle the shutter key if the app is
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5864
    // in the foreground and view finder is active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5865
    if ( !AppInBackground( ETrue ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5866
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5867
        RArray<TInt> captureKeys;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5868
        CleanupClosePushL( captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5869
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5870
        if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5871
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5872
            iController.UiConfigManagerPtr()->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5873
                 SupportedPrimaryCameraCaptureKeyL( captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5874
            if ( captureKeys.Count() <= 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5875
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5876
                User::Leave( KErrNotSupported );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5877
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5878
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5879
        TKeyEvent keyEvent;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5880
        keyEvent.iScanCode = captureKeys[0];//EProductKeyCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5881
        keyEvent.iModifiers = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5882
        keyEvent.iRepeats = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5883
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5884
        CleanupStack::PopAndDestroy( &captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5885
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5886
        // check we have a currently active view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5887
        if( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5888
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5889
            CCoeControl* container = static_cast<CCamViewBase*>( iView )->Container();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5890
            if ( container )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5891
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5892
                if ( aPressed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5893
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5894
                    container->OfferKeyEventL( keyEvent, EEventKeyDown ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5895
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5896
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5897
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5898
                    container->OfferKeyEventL( keyEvent, EEventKeyUp ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5899
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5900
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5901
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5902
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5903
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5904
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5905
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5906
// CCamAppUi::IsHeadsetConnected
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5907
// Return whether headset is connected
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5908
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5909
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5910
TBool CCamAppUi::IsHeadsetConnected() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5911
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5912
    TBool connected( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5913
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5914
    TRAP_IGNORE(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5915
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5916
        CAccMonitor* monitor = CAccMonitor::NewLC();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5917
        RConnectedAccessories accessories;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5918
        CleanupClosePushL( accessories );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5919
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5920
        TAccMonCapability device = KAccMonNoDevice;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5921
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5922
        monitor->GetConnectedAccessoriesL( accessories );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5923
        TInt count = accessories.Count();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5924
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5925
        // loop through connected accessories
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5926
        for ( TInt i = 0; i != count; i++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5927
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5928
            device = accessories[i]->AccDeviceType();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5929
            // headset device type
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5930
            if ( device == KAccMonHeadset )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5931
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5932
                connected = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5933
                break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5934
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5935
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5936
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5937
        CleanupStack::PopAndDestroy( &accessories );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5938
        CleanupStack::PopAndDestroy( monitor );     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5939
        });
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5940
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5941
    return connected;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5942
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5943
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5944
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5945
// CCamAppUi::HandleVolumeKeyEvent
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5946
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5947
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5948
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5949
void CCamAppUi::HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5950
                                  TRemConCoreApiButtonAction aButtonAct )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5951
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5952
    PRINT2( _L("Camera => CCamAppUi::HandleVolumeKeyEvent op (%d) act (%d)"), aOperationId, aButtonAct )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5953
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5954
    if ( !iZoomUsingVolumeKeys || IsHeadsetConnected() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5955
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5956
        PRINT( _L("Camera <= CCamAppUi::HandleVolumeKeyEvent NOT zooming with volume keys") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5957
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5958
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5959
    // only handle the shutter key if the app is
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5960
    // in the foreground and view finder is active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5961
    if ( !AppInBackground( ETrue ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5962
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5963
        PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent yes"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5964
        // check we have a currently active view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5965
        if( iView && ( iCamOrientation == ECamOrientationCamcorder
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5966
                || iCamOrientation == ECamOrientationCamcorderLeft) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5967
                ECamViewStatePreCapture == iViewState ) // Zoom only needed in precap
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5968
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5969
            CCoeControl* container = static_cast<CCamViewBase*>( iView )->Container();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5970
            if ( container )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5971
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5972
                PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent cont"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5973
                TKeyEvent keyEvent;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5974
                keyEvent.iModifiers = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5975
                keyEvent.iRepeats = 0; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5976
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5977
                // map up/down to appropriate zoom key
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5978
                if( aOperationId == ERemConCoreApiVolumeUp )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5979
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5980
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent up"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5981
                    keyEvent.iScanCode = EStdKeyIncVolume;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5982
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5983
                else if( aOperationId == ERemConCoreApiVolumeDown )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5984
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5985
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent down"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5986
                    keyEvent.iScanCode = EStdKeyDecVolume;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5987
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5988
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5989
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5990
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent ??"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5991
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5992
                // map event type
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5993
                if ( aButtonAct == ERemConCoreApiButtonPress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5994
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5995
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent press"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5996
                    TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventKeyDown ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5997
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5998
                else if( aButtonAct == ERemConCoreApiButtonRelease )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5999
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6000
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent release"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6001
                    TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventKeyUp ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6002
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6003
                else if( aButtonAct == ERemConCoreApiButtonClick )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6004
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6005
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent click"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6006
                    TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventUser ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6007
                    }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6008
                else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6009
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6010
                    PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent unhandled volume keypress"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6011
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6012
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6013
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6014
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6015
    PRINT( _L("Camera <= CCamAppUi::HandleVolumeKeyEvent"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6016
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6017
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6018
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6019
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6020
// CCamAppUi::SetEmbedding
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6021
// Sets embedding flag
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6022
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6023
//  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6024
void CCamAppUi::SetEmbedding( TBool aEmbedding )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6025
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6026
    PRINT1( _L("Camera => CCamAppUi::SetEmbedding %d"), aEmbedding )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6027
    iEmbedding = aEmbedding;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6028
    PRINT( _L("Camera <= CCamAppUi::SetEmbedding") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6029
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6030
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6031
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6032
// CCamAppUi::Embedding
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6033
// Returns embedding flag
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6034
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6035
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6036
TBool CCamAppUi::Embedding() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6037
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6038
    PRINT1( _L("Camera => CCamAppUi::Embedding %d"), iEmbedding )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6039
    PRINT( _L("Camera <= CCamAppUi::Embedding") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6040
    return iEmbedding;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6041
    }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6042
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6043
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6044
// CCamAppUi::SetSendAsInProgressL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6045
// Sets the SendAs flag
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6046
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6047
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6048
void CCamAppUi::SetSendAsInProgressL( TBool aSendAsInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6049
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6050
    PRINT1( _L("Camera => CCamAppUi::SetSendAsInProgressL %d"), aSendAsInProgress );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6051
    // Check before updating embedding status.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6052
    TBool exitStatus = iController.CheckExitStatus();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6053
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6054
    iSendAsInProgress = aSendAsInProgress;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6055
    SetEmbedding( aSendAsInProgress );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6056
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6057
    if ( !iSendAsInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6058
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6059
        PRINT( _L("Camera <> CCamAppUi::SetSendAsInProgressL - checking exit status..") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6060
        // Exit not wanted when embedding / embedded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6061
        // Check if camera switch is required.        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6062
        if ( exitStatus )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6063
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6064
            InternalExitL();   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6065
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6066
        else if ( iPendingViewSwitch != EPendingViewSwitchNone )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6067
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6068
            iPendingViewSwitch = EPendingViewSwitchNone;        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6069
            iWaitTimer->Start( 0, 0,  TCallBack( CallSwitch, this ) ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6070
            }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6071
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6072
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6073
            // Do nothing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6074
            }                   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6075
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6076
    PRINT( _L("Camera <= CCamAppUi::SetSendAsInProgressL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6077
    }     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6078
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6079
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6080
// CCamAppUi::SendAsInProgressL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6081
// Get the SendAs flag value
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6082
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6083
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6084
TBool CCamAppUi::SendAsInProgress() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6085
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6086
    return iSendAsInProgress;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6087
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6088
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6089
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6090
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6091
// CCamAppUi::IsMMCRemoveNotePending
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6092
// Return whether an MMC removal note is pending
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6093
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6094
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6095
TBool CCamAppUi::IsMMCRemovedNotePending() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6096
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6097
    if ( iMMCRemoveNoteRequired || iMMCRemoveNoteRequiredOnCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6098
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6099
        return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6100
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6101
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6102
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6103
        return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6104
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6105
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6106
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6107
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6108
// CCamAppUi::HandleCameraErrorL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6109
// Display an error note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6110
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6111
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6112
void CCamAppUi::HandleCameraErrorL( TInt aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6113
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6114
    if( aError == KErrNoMemory )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6115
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6116
        PRINT( _L( "Camera => CCamAppUi::HandleCameraErrorL KErrNoMemory" ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6117
        HBufC* text = StringLoader::LoadLC( R_CAM_MEMLO_NOT_ENOUGH_MEMORY );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6118
        // Display an error note 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6119
        CAknErrorNote* dlg = new (ELeave) CAknErrorNote( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6120
        dlg->ExecuteLD( *text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6121
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6122
        CleanupStack::PopAndDestroy( text );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6123
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6124
    else if ( aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6125
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6126
        PRINT1( _L( "Camera => CCamAppUi::HandleCameraErrorL (%d)" ), aError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6127
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6128
        // Resolve the error text with no context or separator
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6129
        TPtrC buf;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6130
        buf.Set( iTextResolver->ResolveErrorString( aError, CTextResolver::ECtxNoCtxNoSeparator ) );             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6131
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6132
        // Display an error note 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6133
        CAknErrorNote* dlg = new (ELeave) CAknErrorNote( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6134
        dlg->ExecuteLD( buf );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6135
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6136
        PRINT( _L( "Camera <= CCamAppUi::HandleCameraErrorL" ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6137
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6138
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6139
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6140
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6141
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6142
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6143
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6144
// CCamAppUi::TextResolver
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6145
// Offers a reference to appui's TextResolver instance
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6146
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6147
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6148
CTextResolver* CCamAppUi::TextResolver()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6149
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6150
    return iTextResolver;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6151
    } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6152
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6153
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6154
#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6155
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6156
// CCamAppUi::SFIUtility
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6157
// Return pointer to in-call send utility object
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6158
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6159
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6160
/*CSFIUtilsAppInterface* CCamAppUi::SFIUtility() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6161
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6162
    return iSFIUtils;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6163
    }*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6164
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6165
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6166
// CCamAppUi::IsInCallSend
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6167
// Return whether in in-call send mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6168
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6169
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6170
/*TBool CCamAppUi::IsInCallSend() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6171
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6172
    return iSendFileInCall;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6173
    }*/
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6174
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6175
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6176
// CCamAppUi::DoInCallSendL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6177
// Handle send to caller functionality
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6178
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6179
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6180
/*void CCamAppUi::DoInCallSendL() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6181
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6182
    PRINT( _L("CCamAppUi::DoInCallSendL in") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6183
    if ( iSFIUtils && iSFIUtils->IsCLIValidL() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6184
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6185
        PRINT( _L("CCamAppUi::DoInCallSendL send") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6186
        iSFIUtils->SendMediaFileL( iController.CurrentFullFileName() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6187
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6188
    PRINT( _L("CCamAppUi::DoInCallSendL out") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6189
    }  */
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6190
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6191
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6192
// CCamAppUi::BringPhoneAppToForeGroundL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6193
// Bring phone application to foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6194
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6195
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6196
void CCamAppUi::BringPhoneAppToForeGroundL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6197
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6198
    PRINT( _L("CCamAppUi::BringPhoneAppToForeGroundL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6199
    TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6200
    TApaTask apaTask = apaTaskList.FindApp( KPhoneAppUid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6201
    if ( apaTask.Exists() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6202
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6203
        apaTask.BringToForeground();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6204
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6205
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6206
    // load non-embedded static settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6207
    iController.LoadStaticSettingsL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6208
    // no longer in SFI state
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6209
//    iSendFileInCall = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6210
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6211
    // set us back to pre-capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6212
    iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6213
	// when camera is used again, TrySwitchViewL() will be called
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6214
    iPendingViewSwitch = EPendingViewSwitchDeactivateFirst; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6215
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6216
    PRINT( _L("CCamAppUi::BringPhoneAppToForeGroundL iSendFileInCall = EFalse") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6217
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6218
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6219
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6220
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6221
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6222
// CCamAppUi::IsInPretendExit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6223
// Indicates whether or not the application is in a simulated exit situation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6224
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6225
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6226
TBool CCamAppUi::IsInPretendExit() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6227
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6228
    return iPretendExit;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6229
    }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6230
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6231
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6232
// CCamAppUi::ReturningFromPretendExit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6233
// Indicates whether or not the application was in a simulated exit situation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6234
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6235
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6236
TBool CCamAppUi::ReturningFromPretendExit() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6237
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6238
    return iReturningFromPretendExit;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6239
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6240
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6241
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6242
// CCamAppUi::IsFirstBoot
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6243
// Indicates whether or not the application started the first time
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6244
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6245
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6246
TBool CCamAppUi::IsFirstBoot() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6247
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6248
    return iFirstBoot;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6249
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6250
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6251
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6252
// CCamAppUi::SendCameraAppToBackgroundL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6253
// Sends the camera application to the background, to pretend we're closing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6254
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6255
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6256
void CCamAppUi::SendCameraAppToBackgroundL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6257
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6258
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_SENDCAMERAAPPTOBACKGROUNDL, "e_CCamAppUi_SendCameraAppToBackgroundL 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6259
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6260
    PRINT( _L("Camera => CCamAppUi::SendCameraAppToBackgroundL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6261
    // Pretend we're closing, so reset the dynamic settings.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6262
    iController.SetDynamicSettingsToDefaults();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6263
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6264
    // stop listening mmc dismount notifications
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6265
    iController.CancelDismountMonitoring();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6266
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6267
    // Switch sequence capture off if the app is going to pretend to close
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6268
    if ( IsBurstEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6269
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6270
        PRINT( _L("CCamAppUi::SendCameraAppToBackgroundL calling ToggleMulti") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6271
        SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6272
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6273
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6274
    // Send the task with the given WgId to the background 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6275
    CAknSgcClient::MoveApp( iMyWgId, ESgcMoveAppToBackground );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6276
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6277
    // Hide from task list/FSW and send to background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6278
    HideTaskL( ETrue );    		
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6279
    iPretendExit = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6280
    iFirstVFStart = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6281
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6282
    PRINT( _L("Camera <= CCamAppUi::SendCameraAppToBackgroundL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6283
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_SENDCAMERAAPPTOBACKGROUNDL, "e_CCamAppUi_SendCameraAppToBackgroundL 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6284
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6285
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6286
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6287
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6288
// CCamAppUi::HideTaskL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6289
// Hides or shows the Camera app task in the tasklist
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6290
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6291
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6292
void CCamAppUi::HideTaskL(TBool aHide)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6293
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6294
    // HideApplicationFromFSW also hides running status from menu grid
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6295
   	HideApplicationFromFSW( aHide );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6296
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6297
	// The following ensures that the task is hidden even if an embedded camera app is also running    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6298
    RWsSession session = iEikonEnv->WsSession();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6299
    CApaWindowGroupName* wgName = CApaWindowGroupName::NewL( session, iMyWgId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6300
    wgName->SetHidden( aHide );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6301
    wgName->SetWindowGroupName( iEikonEnv->RootWin() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6302
    delete wgName;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6303
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6304
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6305
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6306
// CCamAppUi::StartAsServerAppL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6307
// Start application as file server application
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6308
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6309
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6310
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6311
CCamAppUi::StartAsServerAppL( MCamEmbeddedObserver* aEmbeddedObserver, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6312
                              TInt                  aMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6313
    {       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6314
    PRINT1( _L("Camera => CCamAppUi::StartAsServerAppL mode:%d"), aMode );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6315
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6316
    __ASSERT_ALWAYS( aMode == ECamControllerVideo || aMode == ECamControllerImage, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6317
            CamPanic( ECamPanicNotSupported ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6318
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6319
    // start the ui construct timer to speed up the starting in embedded mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6320
    if ( iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6321
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6322
        if ( iWaitTimer->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6323
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6324
            PRINT( _L( "Camera <> timer already active" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6325
            iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6326
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6327
        PRINT( _L( "Camera <> start the appui construct timer" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6328
        iWaitTimer->Start( 0, 0,  TCallBack( AppUIConstructCallbackL, this ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6329
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6330
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6331
    // Load Embedded Settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6332
    iController.LoadStaticSettingsL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6333
    iEmbeddedViewSet = ETrue;     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6334
    iEmbeddedObserver = aEmbeddedObserver; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6335
    iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6336
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6337
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6338
    if ( aMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6339
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6340
        iTargetMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6341
        iMode = ECamControllerVideo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6342
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6343
    else if ( aMode == ECamControllerImage )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6344
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6345
        iTargetMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6346
        iMode = ECamControllerImage;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6347
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6348
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6349
    // Find the parent app's name:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6350
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6351
    RWsSession ws = iEikonEnv->WsSession();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6352
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6353
    // Get a list of the names and IDs of the all the window groups
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6354
    RArray<RWsSession::TWindowGroupChainInfo> windowList;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6355
    CleanupClosePushL(windowList);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6356
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6357
    // Get a list of window group IDs
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6358
    User::LeaveIfError(ws.WindowGroupList(&windowList));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6359
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6360
    // Find our window group ID
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6361
    RThread thread;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6362
    TInt cameraWindowGroup = ws.FindWindowGroupIdentifier(0, thread.Id());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6363
    thread.Close();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6364
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6365
    TInt parentID = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6366
    TBool found = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6367
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6368
    // Find our window ID in the list, to look up the parent ID
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6369
    for( TInt i = 0; !found && i < windowList.Count(); i++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6370
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6371
        RWsSession::TWindowGroupChainInfo windowInfo = windowList[i];
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6372
        if ( windowInfo.iId == cameraWindowGroup )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6373
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6374
            parentID = windowInfo.iParentId;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6375
            found = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6376
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6377
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6378
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6379
    CleanupStack::PopAndDestroy(&windowList);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6380
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6381
    if ( found )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6382
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6383
        TBuf<100> windowName;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6384
        ws.GetWindowGroupNameFromIdentifier( parentID, windowName );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6385
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6386
        // The format of windowName is:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6387
        // [number][zero-char][UID of app][zero-char][Title of window][zero-char]
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6388
        // We want to discard everything up to the window title:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6389
        for ( TInt t = 0; t  < 2; t++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6390
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6391
            TInt zeroPos = windowName.Locate(0);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6392
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6393
            if ( zeroPos != KErrNotFound 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6394
                    && zeroPos < windowName.Length() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6395
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6396
                windowName.Delete(0, zeroPos + 1);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6397
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6398
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6399
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6400
        // And the final zero-char
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6401
        if ( windowName.Length() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6402
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6403
            if ( windowName[windowName.Length() - 1] == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6404
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6405
                windowName.Delete(windowName.Length() - 1, 1);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6406
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6407
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6408
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6409
        if ( windowName.Length() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6410
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6411
            iParentAppName = HBufC::NewL(windowName.Length());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6412
            iParentAppName->Des().Copy(windowName);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6413
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6414
            SetTitleL(windowName);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6415
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6416
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6417
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6418
            // Something's wrong - act as if we haven't found it
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6419
            found = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6420
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6421
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6422
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6423
    // We were unable to find the parent app's name, so fall back on our own app title        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6424
    if( !found )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6425
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6426
        iParentAppName = StringLoader::LoadL(R_CAM_GENERIC_TITLE_NAME);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6427
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6428
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6429
    // make sure standby exits as this may not actually result in 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6430
    // a view switch if the correct view is already activated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6431
    if( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6432
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6433
        iView->HandleCommandL( ECamCmdExitStandby );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6434
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6435
    iViewState = ECamViewStatePreCapture;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6436
  iTargetViewState = ECamViewStatePreCapture;   	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6437
    TrySwitchViewL();                                      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6438
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6439
    // Start reserve-poweron sequence
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6440
    iController.EmbeddedStartupSequence();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6441
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6442
    PRINT( _L("Camera <= CCamAppUi::StartAsServerAppL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6443
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6444
           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6445
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6446
// CCamAppUi::SetEmbeddedObserver
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6447
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6448
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6449
void CCamAppUi::SetEmbeddedObserver( MCamEmbeddedObserver* aEmbeddedObserver )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6450
    {       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6451
    PRINT1( _L("Camera <> CCamAppUi::SetEmbeddedObserver %x"), aEmbeddedObserver );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6452
    iEmbeddedObserver = aEmbeddedObserver;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6453
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6454
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6455
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6456
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6457
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6458
// CCamAppUi::CamOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6459
// Returns the current orientation of the app
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6460
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6461
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6462
TCamOrientation CCamAppUi::CamOrientation()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6463
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6464
    return iCamOrientation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6465
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6466
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6467
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6468
// CCamAppUi::SetCamOrientationToLandscape()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6469
// Set the current orientation as landscape
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6470
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6471
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6472
void CCamAppUi::SetCamOrientationToLandscape()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6473
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6474
    iCamOrientation = (ECamHandLeft == iSoftkeyPosition ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6475
                    ? ECamOrientationCamcorderLeft 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6476
                    : ECamOrientationCamcorder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6477
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6478
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6479
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6480
// CCamAppUi::AppUiOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6481
// Returns the AppUi orientation (e.g. Portrait or Landscape) for the given product-specific orientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6482
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6483
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6484
CAknAppUiBase::TAppUiOrientation CCamAppUi::AppUiOrientation(TCamOrientation aCamOrientation)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6485
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6486
    switch ( aCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6487
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6488
        case ECamOrientationCamcorder: // fallthrough
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6489
        case ECamOrientationCamcorderLeft:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6490
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6491
            return CAknAppUiBase::EAppUiOrientationLandscape;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6492
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6493
        case ECamOrientationViewMode:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6494
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6495
            return CAknAppUiBase::EAppUiOrientationLandscape;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6496
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6497
        case ECamOrientationPortrait:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6498
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6499
            return CAknAppUiBase::EAppUiOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6500
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6501
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6502
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6503
            return CAknAppUiBase::EAppUiOrientationUnspecified;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6504
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6505
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6506
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6507
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6508
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6509
// CCamAppUi::LayoutStateToOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6510
// Returns the camera orientation based on the layout state set by the phone
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6511
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6512
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6513
TCamOrientation CCamAppUi::LayoutStateToOrientation( TInt aLayoutState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6514
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6515
    TCamOrientation orientation = ECamOrientationDefault;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6516
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6517
#ifdef __WINS__  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6518
    switch(aLayoutState)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6519
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6520
        // Emulator numbers
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6521
        case 2:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6522
            orientation = ECamOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6523
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6524
        case 6:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6525
            if( iSoftkeyPosition == ECamHandLeft )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6526
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6527
                orientation = ECamOrientationCamcorderLeft;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6528
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6529
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6530
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6531
                orientation = ECamOrientationCamcorder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6532
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6533
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6534
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6535
#else // !__WINS__  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6536
    switch(aLayoutState)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6537
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6538
        // Magic number alert!
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6539
        // These numbers come from AknPriv.rss, where they are currently hardcoded
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6540
        case 0:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6541
            orientation = ECamOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6542
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6543
        case 1:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6544
            if( iSoftkeyPosition == ECamHandLeft )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6545
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6546
                orientation = ECamOrientationCamcorderLeft;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6547
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6548
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6549
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6550
                orientation = ECamOrientationCamcorder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6551
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6552
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6553
        case 2:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6554
            orientation = ECamOrientationViewMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6555
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6556
        case 3:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6557
            orientation = ECamOrientationPortrait;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6558
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6559
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6560
            orientation = ECamOrientationDefault;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6561
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6562
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6563
#endif // __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6564
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6565
    return orientation;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6566
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6567
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6568
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6569
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6570
// CCamAppUi::ReadCurrentDeviceOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6571
// Returns the camera orientation based on the layout state set by the phone
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6572
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6573
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6574
TCamOrientation CCamAppUi::ReadCurrentDeviceOrientation()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6575
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6576
    PRINT( _L("Camera <> CCamAppUi::ReadCurrentDeviceOrientation") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6577
    return ECamOrientationDefault;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6578
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6579
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6580
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6581
// CCamAppUi::ActivePalette
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6582
// Return handle to Active Palette
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6583
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6584
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6585
MActivePalette2UI* CCamAppUi::ActivePalette() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6586
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6587
    return iActivePaletteHandler->ActivePalette();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6588
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6589
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6590
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6591
// CCamAppUi::APHandler
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6592
// Returns pointer to Active Palette handler
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6593
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6594
//   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6595
CCamActivePaletteHandler* CCamAppUi::APHandler() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6596
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6597
    return iActivePaletteHandler;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6598
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6599
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6600
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6601
// CCamAppUi::DrawPreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6602
// Returns whether the optional precapture UI should be currently shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6603
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6604
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6605
TBool CCamAppUi::DrawPreCaptureCourtesyUI() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6606
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6607
  if ( CourtesyUiApplies() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6608
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6609
    return iDrawPreCaptureCourtesyUI;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6610
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6611
  else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6612
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6613
    // Otherwise always draw the UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6614
    return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6615
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6616
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6617
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6618
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6619
// CCamAppUi::DrawPostCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6620
// Returns whether the optional postcapture UI should be currently shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6621
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6622
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6623
TBool CCamAppUi::DrawPostCaptureCourtesyUI() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6624
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6625
    if ( CourtesyUiApplies() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6626
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6627
        return iDrawPostCaptureCourtesyUI;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6628
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6629
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6630
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6631
        // Otherwise always draw the UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6632
        return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6633
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6634
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6635
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6636
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6637
// CCamAppUi::AlwaysDrawPreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6638
// Returns whether the optional precapture UI should always be shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6639
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6640
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6641
TBool CCamAppUi::AlwaysDrawPreCaptureCourtesyUI() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6642
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6643
    return iAlwaysDrawPreCaptureCourtesyUI;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6644
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6645
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6646
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6647
// CCamAppUi::AlwaysDrawPostCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6648
// Returns whether the optional postcapture UI should always be shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6649
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6650
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6651
TBool CCamAppUi::AlwaysDrawPostCaptureCourtesyUI() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6652
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6653
    return iAlwaysDrawPostCaptureCourtesyUI;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6654
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6655
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6656
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6657
// CCamAppUi::SetAlwaysDrawPreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6658
// Set whether the optional precapture UI should always be shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6659
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6660
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6661
void  CCamAppUi::SetAlwaysDrawPreCaptureCourtesyUI( TBool aNewSetting )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6662
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6663
    iAlwaysDrawPreCaptureCourtesyUI = aNewSetting;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6664
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6665
    if ( aNewSetting )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6666
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6667
        RaisePreCaptureCourtesyUI(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6668
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6669
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6670
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6671
        SubmergePreCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6672
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6673
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6674
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6675
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6676
// CCamAppUi::SetAlwaysDrawPostCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6677
// Set whether the optional postcapture UI should always be shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6678
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6679
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6680
void  CCamAppUi::SetAlwaysDrawPostCaptureCourtesyUI(TBool aNewSetting)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6681
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6682
    iAlwaysDrawPostCaptureCourtesyUI = aNewSetting;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6683
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6684
    if ( aNewSetting )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6685
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6686
        RaisePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6687
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6688
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6689
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6690
        SubmergePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6691
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6692
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6693
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6694
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6695
// CCamAppUi::CourtesyTimeout
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6696
// Called after 15 seconds of key inactivity
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6697
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6698
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6699
TInt CCamAppUi::CourtesyTimeout( TAny* aPtr )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6700
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6701
    return static_cast<CCamAppUi*>( aPtr )->DoCourtesyTimeout();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6702
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6703
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6704
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6705
// CCamAppUi::DoCourtesyTimeoutL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6706
// Called after 15 seconds of key inactivity
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6707
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6708
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6709
TInt CCamAppUi::DoCourtesyTimeout()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6710
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6711
    if ( iCourtesyTimerInPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6712
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6713
        if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6714
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6715
            CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6716
            if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6717
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6718
                CAknToolbarExtension* toolbarextension =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6719
                    toolbar->ToolbarExtension();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6720
                if ( toolbarextension && toolbarextension->IsShown() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6721
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6722
                    // Do not hide courtesy UI when toolbar extension is open
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6723
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6724
                    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6725
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6726
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6727
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6728
        iDrawPreCaptureCourtesyUI = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6729
        SubmergePreCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6730
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6731
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6732
    iCourtesyTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6733
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6734
    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6735
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6736
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6737
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6738
// CCamAppUi::CheckCourtesyKeyEventL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6739
// Check whether the current key event should raise the optional UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6740
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6741
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6742
TKeyResponse CCamAppUi::CheckCourtesyKeyEventL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6743
            const TKeyEvent aKeyEvent, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6744
            TEventCode aType, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6745
            TBool aInPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6746
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6747
    PRINT(_L("Camera => CheckCourtesyKeyEventL"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6748
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6749
    TKeyResponse retVal = EKeyWasNotConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6750
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6751
    if ( CourtesyUiApplies() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6752
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6753
        // Always reset the timer on any key event, if appropriate
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6754
        if(    (   (  aInPreCapture && !iAlwaysDrawPreCaptureCourtesyUI  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6755
               ||  ( !aInPreCapture && !iAlwaysDrawPostCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6756
               )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6757
           &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6758
               (   ( aInPreCapture && iDrawPreCaptureCourtesyUI  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6759
               ||  (!aInPreCapture && iDrawPostCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6760
               )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6761
          )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6762
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6763
            iCourtesyTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6764
            iCourtesyTimer->StartTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6765
            iCourtesyTimerInPreCapture = aInPreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6766
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6767
        // Here we check if the LSK key is pressed by using the scan code
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6768
        // We do this, to show the active tool bar when LSK is pressed when 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6769
        // the AP tool bar is hidden AND Pressing "RSK" shall have to return
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6770
        // to PreCaptureView (Image/Video mode)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6771
        // LSK  --> Left Softkey 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6772
        // RSK  --> Right Softkey        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6773
        if ( aType == EEventKeyDown && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6774
             aKeyEvent.iScanCode == EStdKeyDevice0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6775
        	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6776
        	iLeftSoftKeyPressed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6777
        	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6778
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6779
        	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6780
        	iLeftSoftKeyPressed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6781
        	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6782
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6783
        if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6784
             !iController.UiConfigManagerPtr()->IsLocationSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6785
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6786
			if ( aType == EEventKey && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6787
           	  	aKeyEvent.iScanCode == EStdKeyNo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6788
        		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6789
        		iEndKeyPressed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6790
        		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6791
        	else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6792
        		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6793
        		iEndKeyPressed = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6794
        		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6795
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6796
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6797
        const TCamCaptureOperation operation( iController.CurrentOperation() );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6798
        if ( aType == EEventKey )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6799
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6800
            if ( EStdKeyRightArrow == aKeyEvent.iScanCode && !iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6801
                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6802
                 if( aInPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6803
                     { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6804
                     // during sequence capturing, Navi-Right is inactive to affect CourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6805
                     if ( !( IsBurstEnabled() && ( ECamCapturing == operation || ECamCompleting == operation ) )  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6806
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6807
                         iDrawPreCaptureCourtesyUI = EFalse;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6808
                         if ( !IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6809
                             {                         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6810
                             SubmergePreCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6811
                             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6812
                         else if ( !IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6813
                             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6814
                             SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6815
                             if ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6816
                                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6817
                                 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_TXT );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6818
                                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6819
                             else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6820
                                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6821
                                 SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_TXT );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6822
                                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6823
                             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6824
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6825
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6826
                 else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6827
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6828
                     iDrawPostCaptureCourtesyUI = EFalse;	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6829
                     if ( !IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6830
                         {                                              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6831
                         SubmergePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6832
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6833
                     else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6834
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6835
                         SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6836
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6837
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6838
                 return EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6839
                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6840
                 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6841
             else if ( (  EStdKeyLeftArrow == aKeyEvent.iScanCode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6842
                     || (!aInPreCapture && EStdKeyDevice3 == aKeyEvent.iScanCode && !IsToolBarVisible() ) ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6843
                     && !iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6844
                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6845
                 iRotatedKeyEvent = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6846
                 if( aInPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6847
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6848
                     // during sequence capturing, Navi-Left is inactive to affect CourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6849
                     if ( !( IsBurstEnabled() && ( ECamCapturing == operation || ECamCompleting == operation ) )  )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6850
                         {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6851
                         iDrawPreCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6852
                         RaisePreCaptureCourtesyUI(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6853
                         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6854
                         if ( /*IsSecondCameraEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6855
                                &&*/ !IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6856
                             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6857
                             if ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6858
                                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6859
                             IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY ):
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6860
                             SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6861
                                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6862
                             else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6863
                                 {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6864
                                  IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ):
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6865
                                                          SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6866
                                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6867
                             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6868
                         }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6869
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6870
                 else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6871
                     {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6872
                     iDrawPostCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6873
                     RaisePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6874
                     }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6875
                 return EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6876
                 }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6877
            // Only check if the user has turned the UI off
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6878
            if(   (  aInPreCapture && !iAlwaysDrawPreCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6879
               || ( !aInPreCapture && !iAlwaysDrawPostCaptureCourtesyUI ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6880
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6881
                // Decide whether to turn the UI back on        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6882
                if(    ( aInPreCapture && !iDrawPreCaptureCourtesyUI)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6883
                    || (!aInPreCapture && !iDrawPostCaptureCourtesyUI))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6884
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6885
                    if (   aKeyEvent.iScanCode == EStdKeyUpArrow 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6886
                        || aKeyEvent.iScanCode ==  EStdKeyDownArrow
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6887
                        || aKeyEvent.iScanCode ==  EStdKeyDevice3 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6888
                        // Navikey select
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6889
                       )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6890
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6891
                        if ( aInPreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6892
                            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6893
                            RaisePreCaptureCourtesyUI(EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6894
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6895
                        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6896
                            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6897
                            RaisePostCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6898
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6899
                        retVal = EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6900
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6901
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6902
#ifndef __WINS__
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6903
                RArray <TInt> halfCaptureKeys;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6904
                CleanupClosePushL( halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6905
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6906
                // now get half key press code to register
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6907
                if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6908
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6909
                    iController.UiConfigManagerPtr()->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6910
                                SupportedPrimaryCameraAutoFocusKeyL( halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6911
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6912
                if ( halfCaptureKeys.Count() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6913
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6914
                    if ( aInPreCapture && aKeyEvent.iScanCode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6915
                        == halfCaptureKeys[0] )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6916
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6917
                        SubmergePreCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6918
                        retVal = EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6919
                        }                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6920
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6921
                CleanupStack::PopAndDestroy( &halfCaptureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6922
#else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6923
                if ( aInPreCapture && aKeyEvent.iScanCode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6924
                    == EProductKeyCaptureHalf )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6925
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6926
                    SubmergePreCaptureCourtesyUI();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6927
                    retVal = EKeyWasConsumed;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6928
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6929
#endif 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6930
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6931
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6932
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6933
    PRINT(_L("Camera <= CheckCourtesyKeyEvent"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6934
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6935
    return retVal;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6936
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6937
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6938
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6939
// CCamAppUi::RaisePreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6940
// Shows the optional precapture UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6941
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6942
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6943
void CCamAppUi::RaisePreCaptureCourtesyUI(TBool aShowZoomBar)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6944
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6945
    PRINT1(_L("Camera => CCamAppUi::RaisePreCaptureCourtesyUI \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6946
         aShowZoomBar = %d"), aShowZoomBar);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6947
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6948
    if ( CourtesyUiApplies() && iDrawPreCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6949
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6950
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6951
        iDrawPreCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6952
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6953
        if ( iCamZoomPane && aShowZoomBar && !iCamZoomPane->IsZoomAtMinimum() )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6954
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6955
            PRINT(_L("Camera == CCamAppUi::RaisePreCaptureCourtesyUI \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6956
                Showing zoom pane"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6957
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6958
            CCamViewBase* view = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6959
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6960
            if ( iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6961
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6962
                view = iVideoCaptureView;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6963
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6964
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6965
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6966
                view = iStillCaptureView;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6967
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6968
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6969
            if ( view )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6970
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6971
                CCamContainerBase* container = view->Container();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6972
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6973
                if ( container )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6974
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6975
                    container->ShowZoomPaneWithTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6976
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6977
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6978
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6979
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6980
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6981
            if ( iZoomPaneShown && iRotatedKeyEvent )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6982
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6983
                HideZoomPane(ETrue);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6984
                iRotatedKeyEvent = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6985
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6986
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6987
        PRINT(_L("Camera == CCamAppUi::RaisePreCaptureCourtesyUI Showing AP"));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6988
        SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6989
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6990
        TUid settingsPluginUid = KNullUid;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6991
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6992
  		  if ( iPlugin )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6993
    		    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6994
    		    settingsPluginUid = iPlugin->Id();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6995
    		    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6996
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6997
        if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6998
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  6999
            const TUid uid1( iView->Id() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7000
            const TInt uid( uid1.iUid );          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7001
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7002
        if( !iController.InVideocallOrRinging() &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7003
          ( ECamViewIdStillPreCapture  == uid ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7004
            ECamViewIdStillPostCapture == uid || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7005
            ECamViewIdVideoPreCapture  == uid || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7006
            ECamViewIdVideoPostCapture == uid ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7007
            ECamViewIdBurstThumbnail   == uid )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7008
          )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7009
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7010
                TRAP_IGNORE( static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7011
                     ( iView )->UnsetCourtesySoftKeysL() );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7012
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7013
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7014
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7015
        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7016
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7017
        iCourtesyTimerInPreCapture = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7018
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7019
        if ( iCourtesyTimer )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7020
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7021
            iCourtesyTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7022
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7023
            if ( !iAlwaysDrawPreCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7024
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7025
                iCourtesyTimer->StartTimer();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7026
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7027
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7028
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7029
    PRINT(_L("Camera <= CCamAppUi::RaisePreCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7030
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7031
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7032
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7033
// CCamAppUi::RaisePostCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7034
// Shows the optional postcapture UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7035
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7036
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7037
void CCamAppUi::RaisePostCaptureCourtesyUI()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7038
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7039
    PRINT(_L("Camera => CCamAppUi::RaisePostCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7040
    if ( CourtesyUiApplies() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7041
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7042
        iDrawPostCaptureCourtesyUI = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7043
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7044
        SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7045
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7046
        if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7047
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7048
            TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7049
                 (iView)->UnsetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7050
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7051
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7052
        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7053
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7054
        iCourtesyTimerInPreCapture = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7055
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7056
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7057
    PRINT(_L("Camera <= CCamAppUi::RaisePostCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7058
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7059
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7060
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7061
// CCamAppUi::SubmergePreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7062
// Hides the optional precapture UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7063
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7064
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7065
void CCamAppUi::SubmergePreCaptureCourtesyUI()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7066
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7067
    PRINT(_L("Camera => CCamAppUi::SubmergePreCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7068
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7069
    const TCamCaptureOperation operation( iController.CurrentOperation() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7070
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7071
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7072
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7073
    if ( ( CourtesyUiApplies() && !iDrawPreCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7074
        && !SelfTimerEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7075
        && ECamViewStatePreCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7076
           // and if we are burst capturing 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7077
           // then do not remove the cancel softkey
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7078
           && !( IsBurstEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7079
              && (ECamCapturing  == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7080
                ||ECamCompleting == operation ) ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7081
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7082
        if ( FullScreenViewfinderEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7083
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7084
            // Don't submerge if we're capturing time-lapse photos
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7085
            if ( !(ECamImageCaptureTimeLapse == CurrentBurstMode()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7086
                && iController.SequenceCaptureInProgress()) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7087
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7088
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7089
                if ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7090
                	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7091
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7092
	                SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7093
	                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7094
	                if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7095
	                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7096
	                    // Enable fixed toolbar
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7097
	                    CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7098
	                    if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7099
	                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7100
	                        toolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7101
	                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7102
	                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7103
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7104
	                if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7105
	                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7106
	                    if(!iController.IsTouchScreenSupported())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7107
	                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7108
	                    TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7109
	                        (iView)->SetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7110
	                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7111
	                    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7112
	                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7113
	                        TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7114
	                            (iView)->UnsetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7115
	                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7116
	                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7117
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7118
                	} // end if ( iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7119
		        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7120
		        	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7121
		        	// in still mode toolbar and softkeys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7122
		        	// are not to be hidden as part of courtesy ui
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7123
		        	// imode: ECamControllerIdle, ECamControllerImage,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7124
		        	// or ECamControllerShutdown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7125
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7126
		        	SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7127
		        	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7128
	                if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7129
	                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7130
	                    if(!iController.IsTouchScreenSupported())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7131
	                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7132
	                        TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7133
	                            (iView)->SetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7134
	                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7135
	                    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7136
	                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7137
	                        TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7138
	                             (iView)->UnsetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7139
	                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7140
	                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7141
		        	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7142
		        	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7143
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7144
                TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7145
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7146
	            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7147
            } // if ( FullScreenViewfinderEnabled() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7148
        }               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7149
    PRINT(_L("Camera <= CCamAppUi::SubmergePreCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7150
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7151
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7152
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7153
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7154
// CCamAppUi::SubmergePostCaptureCourtesyUI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7155
// Hides the optional postcapture UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7156
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7157
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7158
void CCamAppUi::SubmergePostCaptureCourtesyUI()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7159
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7160
    PRINT(_L("Camera => CCamAppUi::SubmergePostCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7161
    if ( CourtesyUiApplies() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7162
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7163
         && ECamViewStatePostCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7164
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7165
        iDrawPostCaptureCourtesyUI = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7166
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7167
        SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7168
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7169
        if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7170
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7171
            TRAP_IGNORE(static_cast<CCamViewBase*>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7172
                 (iView)->SetCourtesySoftKeysL());
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7173
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7174
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7175
    TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7176
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7177
    PRINT(_L("Camera <= CCamAppUi::SubmergePostCaptureCourtesyUI"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7178
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7179
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7180
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7181
// CCamAppUi::ShowZoomPane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7182
// Needed to show or update the zoom pane in direct viewfinder mode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7183
// or where the active toolbar is used.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7184
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7185
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7186
void CCamAppUi::ShowZoomPane(TBool aRedraw)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7187
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7188
    PRINT( _L("Camera => CCamAppUi::ShowZoomPane" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7189
    iZoomPaneShown = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7190
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7191
  if ( aRedraw && IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7192
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7193
        TRAP_IGNORE(HandleCommandL(ECamCmdRedrawZoom));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7194
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7195
  PRINT( _L("Camera <= CCamAppUi::ShowZoomPane" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7196
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7197
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7198
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7199
// CCamAppUi::HideZoomPane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7200
// Needed to hide the zoom pane in direct viewfinder mode,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7201
// or where the active toolbar is used.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7202
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7203
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7204
void CCamAppUi::HideZoomPane( TBool aRedraw )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7205
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7206
    PRINT( _L("Camera => CCamAppUi::HideZoomPane" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7207
    iZoomPaneShown = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7208
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7209
    if ( iDrawPreCaptureCourtesyUI && iController.IsViewFinding() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7210
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7211
        if ( iViewState == ECamViewStatePreCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7212
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7213
            SetActivePaletteVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7214
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7215
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7216
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7217
  if ( aRedraw && IsDirectViewfinderActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7218
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7219
        TRAP_IGNORE( HandleCommandL(ECamCmdRedrawZoom ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7220
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7221
  PRINT( _L("Camera <= CCamAppUi::HideZoomPane" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7222
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7223
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7224
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7225
// CCamAppUi::SetActivePaletteVisibility
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7226
// Displays or hides the active palette, depending on some inbuilt restraints
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7227
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7228
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7229
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7230
void CCamAppUi::SetActivePaletteVisibility( TBool aShown )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7231
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7232
  PRINT1( _L("Camera => CCamAppUi::SetActivePaletteVisibility %d" ), aShown )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7233
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7234
  if ( !iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7235
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7236
      if ( ECamOrientationCamcorder     == iCamOrientation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7237
        || ECamOrientationCamcorderLeft == iCamOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7238
        || ECamOrientationPortrait == iCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7239
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7240
        TCamCaptureOperation operation = iController.CurrentOperation();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7241
     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7242
        // Does the current video mode prevent showing.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7243
        //    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7244
        TBool videoOperationPrevents = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7245
             ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7246
          && ( ECamCapturing == operation || ECamPaused == operation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7247
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7248
        TBool imageOperationPrevents = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7249
              ( ECamControllerImage == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7250
           && ( ECamCapturing == operation || ECamCompleting == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7251
                || ECamFocusing == operation || ECamFocused == operation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7252
                || ECamFocusFailed == operation );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7253
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7254
        if (  (!aShown )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7255
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7256
           || ( aShown && !iPreventActivePaletteDisplay
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7257
                       && !TimeLapseSliderShown()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7258
                       && ( iViewState == ECamViewStatePostCapture 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7259
                            || FullScreenViewfinderEnabled()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7260
                            || IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7261
                       && !videoOperationPrevents
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7262
                       && !imageOperationPrevents
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7263
                       && ((iDrawPreCaptureCourtesyUI && iViewState == ECamViewStatePreCapture) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7264
                       || (iDrawPostCaptureCourtesyUI && iViewState == ECamViewStatePostCapture) ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7265
           )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7266
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7267
          if ( iActivePaletteHandler )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7268
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7269
            PRINT1(_L("Precapture mode is %d"),iPreCaptureMode)                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7270
            PRINT(_L("Setting Active Palette Visibility"))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7271
            iActivePaletteHandler->SetVisibility( aShown );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7272
            if ( ( !IsEmbedded() && IsSecondCameraEnabled() ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7273
                    || !IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7274
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7275
                iToolbarVisibility = aShown;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7276
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7277
            else if ( IsEmbedded() && IsSecondCameraEnabled() ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7278
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7279
                iToolbarVisibility = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7280
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7281
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7282
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7283
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7284
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7285
  PRINT( _L("Camera <= CCamAppUi::SetActivePaletteVisibility" ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7286
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7287
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7288
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7289
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7290
// CCamAppUi::IsDirectViewfinderActive
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7291
// Detects whether the direct viewfinder is in use or not
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7292
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7293
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7294
TBool CCamAppUi::IsDirectViewfinderActive() 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7295
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7296
    if ( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7297
       ( ( iDSASupported  && iCamOrientation == ECamOrientationCamcorder  || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7298
           iCamOrientation == ECamOrientationCamcorderLeft ) || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7299
         ( iController.IsDirectScreenVFSupported( EFalse ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7300
           iCamOrientation == ECamOrientationPortrait ) ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7301
           !( IsBurstEnabled() && iController.SequenceCaptureInProgress() ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7302
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7303
        return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7304
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7305
    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7306
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7307
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7308
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7309
// CCamAppUi::UpdateNaviModelsL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7310
// Called to set the correct navicounter / naviprogress controls to "active"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7311
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7312
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7313
void CCamAppUi::UpdateNaviModelsL( const TBool aUpdateNavi )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7314
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7315
    iNaviCounterControl->SetActiveL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7316
    iNaviPaneCounterControl->SetActiveL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7317
    iNaviProgressBarControl->SetActiveL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7318
    iNaviPaneProgressBarControl->SetActiveL( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7319
    if ( !aUpdateNavi )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7320
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7321
        // We are immediately closing the app or in Pretend Exit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7322
        // No need to update NaviPane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7323
        return;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7324
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7325
    else if ( ECamOrientationCamcorder == iCamOrientation 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7326
        || ECamOrientationCamcorderLeft == iCamOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7327
        || ECamOrientationPortrait == iCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7328
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7329
        iNaviCounterControl->SetExtentToWholeScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7330
        iNaviCounterControl->SetActiveL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7331
        iNaviProgressBarControl->SetExtentToWholeScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7332
        iNaviProgressBarControl->SetActiveL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7333
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7334
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7335
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7336
        iNaviPaneCounterControl->SetActiveL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7337
        iNaviPaneProgressBarControl->SetActiveL( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7338
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7339
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7340
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7341
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7342
// CCamAppUi::AppController
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7343
// Returns the app controller
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7344
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7345
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7346
MCamAppController& CCamAppUi::AppController()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7347
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7348
    return iController;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7349
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7350
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7351
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7352
// CCamAppUi::ForegroundAppIsPhoneApp
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7353
// Whether or not the phone app is in the foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7354
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7355
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7356
TBool CCamAppUi::ForegroundAppIsPhoneApp() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7357
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7358
    TBool phoneInForeground = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7359
    // Gets the window group id of the app coming in foreground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7360
    TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7361
    if ( windowGroupId == iPhoneAppWindowGroupId )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7362
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7363
        phoneInForeground = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7364
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7365
    return phoneInForeground;         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7366
    }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7367
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7368
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7369
// CCamAppUi::SwitchStillCaptureModeL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7370
// Change the still capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7371
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7372
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7373
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7374
CCamAppUi::SwitchStillCaptureModeL( TCamImageCaptureMode aImageMode, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7375
                                    TBool                aReprepare,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7376
                                    TBool                aUpdateUi /*=ETrue*/)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7377
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7378
  PRINT( _L( "Camera => CCamAppUi::SwitchStillCaptureModeL" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7379
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7380
  iTargetImageMode = aImageMode;   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7381
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7382
  if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7383
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7384
      switch( iTargetImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7385
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7386
        case ECamImageCaptureSingle:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7387
        case ECamImageCaptureTimeLapse:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7388
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7389
          // Switching from burst mode to single/timelapse mode. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7390
          // Restore previous original flash setting.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7391
          iController.RestoreFlashMode();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7392
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7393
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7394
        case ECamImageCaptureBurst:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7395
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7396
          if( iImageMode != iTargetImageMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7397
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7398
            // Switching from single/timelapse capture to burst mode. 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7399
            // Save current flash mode, and disable flash.  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7400
            iController.SaveFlashMode();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7401
            }           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7402
          iController.SetIntegerSettingValueL( ECamSettingItemDynamicPhotoFlash,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7403
              ECamFlashOff );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7404
          break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7405
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7406
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7407
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7408
 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7409
  TBool burstEnabled = ( ECamImageCaptureBurst     == aImageMode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7410
                      || ECamImageCaptureTimeLapse == aImageMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7411
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7412
  if ( iController.TimeLapseSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7413
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7414
    // if burst has been disabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7415
    // then make sure the timelapse interval has been
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7416
    // set back to 0 in the controller.    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7417
    if ( !burstEnabled )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7418
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7419
      iController.SetTimeLapseInterval( TInt64(0) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7420
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7421
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7422
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7423
  if ( iImageMode != iTargetImageMode )    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7424
    {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7425
    // Inform any observers that burst mode has been changed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7426
    TInt count = iBurstModeObservers.Count();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7427
    TInt i;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7428
    for ( i = 0; i < count; i++ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7429
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7430
      iBurstModeObservers[i]->BurstModeActiveL( burstEnabled, aReprepare );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7431
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7432
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7433
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7434
  if( aUpdateUi )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7435
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7436
    TrySwitchViewL(); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7437
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7438
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7439
  iController.BurstModeActiveL( burstEnabled, aReprepare );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7440
     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7441
  if( aUpdateUi )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7442
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7443
    iNaviCounterModel->SetCaptureModeL( iMode, iImageMode );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7444
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7445
    if ( aReprepare )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7446
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7447
      PRINT( _L( "Camera <> CCamAppUi::SwitchStillCaptureModeL: update AP.." ))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7448
      iActivePaletteHandler->UpdateActivePaletteL();    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7449
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7450
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7451
  PRINT( _L("Camera <= CCamAppUi::SwitchStillCaptureModeL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7452
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7453
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7454
#if !defined(__WINSCW__)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7455
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7456
// CCamAppUi::RegisterCaptureKeysL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7457
// Register to capture half and full shutter press key events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7458
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7459
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7460
void CCamAppUi::RegisterCaptureKeysL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7461
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7462
  RArray<TInt> captureKeys;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7463
  CleanupClosePushL( captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7464
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7465
  if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7466
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7467
      iController.UiConfigManagerPtr()->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7468
           SupportedPrimaryCameraCaptureKeyL( captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7469
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7470
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7471
  if( iCameraKeyHandle == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7472
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7473
  	iCameraKeyHandle = iCoeEnv->RootWin().CaptureKey( EKeyCamera, 0, 0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7474
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7475
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7476
  if( iFullShutterUpDownHandle == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7477
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7478
    if ( captureKeys.Count() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7479
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7480
        //EProductKeyCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7481
        iFullShutterUpDownHandle = iCoeEnv->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7482
            RootWin().CaptureKeyUpAndDowns( captureKeys[0] , 0, 0 );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7483
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7484
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7485
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7486
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7487
  if( iFullShutterPressHandle == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7488
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7489
    if ( captureKeys.Count() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7490
        {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7491
        iFullShutterPressHandle = iCoeEnv->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7492
            RootWin().CaptureKey( captureKeys[0], 0, 0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7493
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7494
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7495
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7496
  if( iHalfShutterPressHandle == 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7497
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7498
    captureKeys.Reset();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7499
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7500
    // now get half key press code to register
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7501
    if ( iController.UiConfigManagerPtr() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7502
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7503
        iController.UiConfigManagerPtr()->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7504
        SupportedPrimaryCameraAutoFocusKeyL( captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7505
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7506
    if ( captureKeys.Count() > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7507
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7508
        iHalfShutterPressHandle = iCoeEnv->
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7509
            RootWin().CaptureKey( captureKeys[0], 0, 0 );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7510
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7511
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7512
  CleanupStack::PopAndDestroy( &captureKeys );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7513
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7514
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7515
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7516
// CCamAppUi::UnRegisterCaptureKeys
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7517
// Release capture of half and full shutter press key events
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7518
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7519
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7520
void CCamAppUi::UnRegisterCaptureKeys()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7521
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7522
  //Since this function can be called from the destructor, we should
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7523
  //check that iCoeEnv isn't null prior to using it.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7524
  if( iCoeEnv )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7525
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7526
      if ( iCameraKeyHandle > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7527
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7528
            iCoeEnv->RootWin().CancelCaptureKey( iCameraKeyHandle );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7529
            iCameraKeyHandle = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7530
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7531
      if ( iFullShutterPressHandle > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7532
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7533
            iCoeEnv->RootWin().CancelCaptureKey( iFullShutterPressHandle );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7534
            iFullShutterPressHandle = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7535
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7536
        if ( iHalfShutterPressHandle > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7537
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7538
            iCoeEnv->RootWin().CancelCaptureKey( iHalfShutterPressHandle );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7539
            iHalfShutterPressHandle = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7540
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7541
            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7542
        if ( iFullShutterUpDownHandle > 0 )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7543
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7544
            iCoeEnv->RootWin().CancelCaptureKey( iFullShutterUpDownHandle );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7545
            iFullShutterUpDownHandle = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7546
            }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7547
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7548
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7549
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7550
#endif
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7551
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7552
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7553
// CCamAppUi::SetSoftKeysL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7554
// Sets the softkeys to the specified Resource ID
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7555
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7556
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7557
void CCamAppUi::SetSoftKeysL( TInt aResource )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7558
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7559
  PRINT1( _L("Camera => CCamAppUi::SetSoftKeysL resource:%x"), aResource );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7560
  if ( iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7561
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7562
    static_cast<CCamViewBase*>(iView)->SetSoftKeysL(aResource);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7563
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7564
  PRINT( _L("Camera <= CCamAppUi::SetSoftKeysL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7565
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7566
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7567
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7568
// CCamAppUi::TimeLapseSliderShown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7569
// Returns whether time lapse slider is currently shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7570
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7571
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7572
TBool CCamAppUi::TimeLapseSliderShown() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7573
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7574
    return ECamPreCapTimeLapseSlider == iPreCaptureMode;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7575
    }     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7576
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7577
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7578
// CCamAppUi::FullScreenViewfinderEnabled
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7579
// Returns whether or not the full screen viewfinder is being shown
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7580
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7581
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7582
TBool CCamAppUi::FullScreenViewfinderEnabled() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7583
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7584
    TBool retVal = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7585
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7586
    if ( ECamViewStatePreCapture == iViewState
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7587
        && ( ECamOrientationCamcorder == iCamOrientation
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7588
            || ECamOrientationCamcorderLeft == iCamOrientation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7589
        && ECamPreCapViewfinder == iPreCaptureMode)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7590
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7591
        retVal = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7592
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7593
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7594
    return retVal;        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7595
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7596
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7597
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7598
// CCamAppUi::SetPreCaptureModeL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7599
// Sets the current pre-capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7600
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7601
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7602
void CCamAppUi::SetPreCaptureModeL(TCamPreCaptureMode aMode)  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7603
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7604
    PRINT1(_L("Camera=>CCamAppUi::SetPreCaptureMode aMode=%d"), aMode);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7605
    iPreCaptureMode = aMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7606
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7607
    CCamViewBase* precapView = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7608
    if ( iView == iStillCaptureView ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7609
         iView == iVideoCaptureView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7610
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7611
        precapView = static_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7612
		__ASSERT_DEBUG( precapView, CamPanic( ECamPanicNullPointer ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7613
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7614
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7615
    if ( ECamPreCapViewfinder == iPreCaptureMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7616
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7617
        if ( !( iController.UiConfigManagerPtr() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7618
                iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7619
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7620
            RaisePreCaptureCourtesyUI(ETrue);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7621
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7622
        if ( precapView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7623
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7624
            if ( iView == iStillCaptureView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7625
	            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7626
	            // fixed toolbar is used only with touch devices
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7627
	            if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7628
	                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7629
                    if ( IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7630
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7631
                        TInt resourceId = IsQwerty2ndCamera()? 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7632
                                      R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7633
                                      R_CAM_STILL_PRECAPTURE_TOOLBAR_PORTRAIT; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7634
                        precapView->CreateAndSetToolbarL( resourceId );		
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7635
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7636
                    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7637
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7638
                        precapView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7639
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7640
                    CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7641
                    fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7642
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7643
                    if ( !IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7644
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7645
                        iStillCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7646
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7647
	                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7648
	                fixedToolbar->SetToolbarObserver( iStillCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7649
	                SetToolbarVisibility();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7650
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7651
	                // Make sure toolbar extension button has no background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7652
	                CAknButton* extensionButton = static_cast<CAknButton*>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7653
	                    fixedToolbar->ControlOrNull( ECamCmdToolbarExtension ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7654
	                if ( extensionButton )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7655
	                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7656
	                    extensionButton->SetButtonFlags(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7657
	                       // Set KAknButtonNoFrame flag for extension buttons      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7658
	                       extensionButton->ButtonFlags() | KAknButtonNoFrame );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7659
	                    }   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7660
	                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7661
    	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7662
            else if ( iView == iVideoCaptureView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7663
        	    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7664
        	    // fixed toolbar is used only with touch devices
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7665
        	    if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7666
        	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7667
                    if ( IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7668
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7669
                        TInt resourceId = IsQwerty2ndCamera()? 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7670
                                      R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7671
                                      R_CAM_VIDEO_PRECAPTURE_TOOLBAR_PORTRAIT; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7672
                        precapView->CreateAndSetToolbarL( resourceId );	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7673
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7674
                    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7675
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7676
                        if(iController.UiConfigManagerPtr()->IsXenonFlashSupported())
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7677
                            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7678
                            precapView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7679
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7680
                        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7681
                            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7682
                            precapView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7683
                            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7684
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7685
                    CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7686
                    fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7687
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7688
                    if ( !IsSecondCameraEnabled() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7689
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7690
                        iVideoCaptureView->UpdateToolbarIconsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7691
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7692
                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7693
                    fixedToolbar->SetToolbarObserver( iVideoCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7694
                    SetToolbarVisibility();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7695
                       
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7696
                    // Make sure toolbar extension button has no background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7697
                    CAknButton* extensionButton = static_cast<CAknButton*>(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7698
                      fixedToolbar->ControlOrNull( ECamCmdToolbarExtension ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7699
                    if ( extensionButton )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7700
                        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7701
                        extensionButton->SetButtonFlags(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7702
                        // Set KAknButtonNoFrame flag for extension buttons      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7703
                        extensionButton->ButtonFlags() | KAknButtonNoFrame );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7704
                        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7705
        	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7706
        	    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7707
            	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7708
            if( !IsSecondCameraEnabled() || IsQwerty2ndCamera() )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7709
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7710
                EikSoftkeyPostingTransparency::MakeTransparent(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7711
                        *precapView->ViewCba(), ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7712
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7713
                if( iDrawPreCaptureCourtesyUI )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7714
                    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7715
                    precapView->ViewCba()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7716
                    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7717
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7718
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7719
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7720
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7721
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7722
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7723
        if ( precapView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7724
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7725
            precapView->ViewCba()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7726
            // fixed toolbar is used only with touch devices
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7727
            if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7728
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7729
                precapView->CreateAndSetToolbarL( R_CAM_EMPTY_FIXED_TOOLBAR );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7730
                SetToolbarVisibility();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7731
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7732
            EikSoftkeyPostingTransparency::MakeTransparent(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7733
                *precapView->ViewCba(), EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7734
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7735
        SetActivePaletteVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7736
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7737
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7738
    if ( iViewState != ECamViewStateUserSceneSetup )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7739
        {
67
756ad29ed18e Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 62
diff changeset
  7740
	    if ( CamUtility::IsNhdDevice() ) 
54
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7741
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7742
	        StatusPane()->MakeVisible( aMode == ECamPreCapStandby || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7743
	                                   IsSecondCameraEnabled() && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7744
	                                   !IsQwerty2ndCamera() ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7745
	                                   SettingsLaunchedFromCamera() ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7746
	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7747
	    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7748
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7749
	        // Settings, launched via toolbar, have a visible statuspane in 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7750
	        // Non-touch device 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7751
	        StatusPane()->MakeVisible( !precapView ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7752
	                                   aMode != ECamPreCapViewfinder &&      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7753
	                                   aMode != ECamPreCapTimeLapseSlider || 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7754
	                                   IsSecondCameraEnabled() ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7755
	                                   SettingsLaunchedFromCamera() );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7756
	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7757
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7758
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7759
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7760
    PRINT(_L("Camera<=CCamAppUi::SetPreCaptureMode"))        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7761
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7762
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7763
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7764
// CCamAppUi::SetPreCaptureMode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7765
// Sets the current pre-capture mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7766
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7767
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7768
void CCamAppUi::SetPreCaptureMode( TCamPreCaptureMode aMode )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7769
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7770
    TRAPD(err, SetPreCaptureModeL( aMode ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7771
    if ( err )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7772
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7773
        PRINT1(_L("Camera<=CCamAppUi::SetPreCaptureModeL Leave=%d"), err)   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7774
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7775
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7776
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7777
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7778
// CCamAppUi::ShowPostCaptureView
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7779
// Whether to show the post capture view in current mode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7780
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7781
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7782
TBool CCamAppUi::ShowPostCaptureView() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7783
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7784
  TInt settingId( ( ECamControllerVideo == iMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7785
                  ? ECamSettingItemVideoShowCapturedVideo
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7786
                  : ECamSettingItemShowCapturedPhoto      );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7787
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7788
  return ( ECamSettOn == iController.IntegerSettingValue( settingId ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7789
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7790
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7791
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7792
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7793
// CCamAppUi::SuppressUIRiseOnViewfinderStart
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7794
// Whether the automatic UI-rise should be suppressed on
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7795
// next viewfinder start event
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7796
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7797
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7798
TBool 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7799
CCamAppUi::SuppressUIRiseOnViewfinderStart() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7800
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7801
  return iSuppressUIRise;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7802
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7803
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7804
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7805
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7806
// CCamAppUi::SetSuppressUIRiseOnViewfinderStart
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7807
// Sets whether the automatic UI-rise should be suppressed on
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7808
// next viewfinder start event
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7809
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7810
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7811
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7812
CCamAppUi::SetSuppressUIRiseOnViewfinderStart(TBool aSuppress) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7813
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7814
  iSuppressUIRise = aSuppress;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7815
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7816
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7817
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7818
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7819
// CCamAppUi::SelectViewFinderGridSettingL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7820
// Select the viewfinder grid setting.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7821
// Currently only sets the grid ON or OFF.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7822
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7823
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7824
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7825
CCamAppUi::SelectViewFinderGridSettingL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7826
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7827
  PRINT( _L("Camera => CCamAppUi::SelectViewFinderGridSettingL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7828
  PRINT1( _L("Camera <> ECamSettingItemViewfinderGrid == (%d)"), 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7829
      ECamSettingItemViewfinderGrid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7830
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7831
  TInt current = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7832
  TInt invert  = (current == ECamViewfinderGridOn) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7833
               ? ECamViewfinderGridOff 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7834
               : ECamViewfinderGridOn;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7835
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7836
  // Switch the value.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7837
  iController.SetIntegerSettingValueL( ECamSettingItemViewfinderGrid, invert );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7838
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7839
  // We'll get a HandleControllerEventL callback 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7840
  // from iController when the value has been set.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7841
  PRINT( _L("Camera <= CCamAppUi::SelectViewFinderGridSettingL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7842
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7843
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7844
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7845
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7846
// CCamAppUi::ConstructPostCaptureViewIfRequiredL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7847
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7848
// Construct a postcapture view if not already constructed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7849
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7850
// The following parameter combinations can be used:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7851
//      * Still postcapture view: aViewState = ECamViewStatePostCapture, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7852
//                                aMode      = ECamControllerImage
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7853
//      * Burst thumbnail view:   aViewState = ECamViewStateBurstThumbnail
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7854
//                                aMode      = << ignored >>
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7855
//      * Video postcapture view: aViewState = ECamViewStatePostCapture, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7856
//                                aMode      = ECamControllerVideo
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7857
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7858
//   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7859
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7860
CCamAppUi::ConstructPostCaptureViewIfRequiredL( TCamViewState aViewState,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7861
                                                TCamCameraMode aCaptureMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7862
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7863
    CAknView* view;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7864
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7865
    if( ECamViewStateBurstThumbnail == aViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7866
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7867
        // Burst thumbnail view        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7868
        if( !iBurstThumbnailViewConstructed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7869
            {    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7870
            PRINT( _L("Camera => CCamAppUi::\
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7871
                ConstructPostCaptureViewIfRequiredL - BurstThumbnail") );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7872
            view = CCamBurstThumbnailView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7873
            AddViewL( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7874
            CleanupStack::Pop( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7875
            iBurstThumbnailViewConstructed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7876
            PRINT( _L("Camera <= CCamAppUi::\
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7877
                ConstructPostCaptureViewIfRequiredL - BurstThumbnail") );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7878
            }                        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7879
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7880
    else if( ECamViewStatePostCapture == aViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7881
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7882
        if( ECamControllerVideo == aCaptureMode )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7883
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7884
            // Video postcapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7885
            if( !iVideoPostCaptureViewConstructed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7886
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7887
                PRINT( _L("Camera => \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7888
                    CCamAppUi::ConstructPostCaptureViewIfRequiredL \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7889
                    - VideoPostCapture") );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7890
                view = CCamVideoPostCaptureView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7891
                AddViewL( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7892
                CleanupStack::Pop( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7893
                iVideoPostCaptureViewConstructed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7894
                PRINT( _L("Camera <= \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7895
                    CCamAppUi::ConstructPostCaptureViewIfRequiredL \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7896
                    - VideoPostCapture") );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7897
                }            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7898
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7899
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7900
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7901
            // Still postcapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7902
            if( !iStillPostCaptureViewConstructed )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7903
                {                         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7904
                PRINT( _L("Camera => \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7905
                    CCamAppUi::ConstructPostCaptureViewIfRequiredL \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7906
                    - StillPostCapture") );                             
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7907
                view = CCamStillPostCaptureView::NewLC( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7908
                AddViewL( view );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7909
                CleanupStack::Pop( view );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7910
                iStillPostCaptureViewConstructed = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7911
                PRINT( _L("Camera <= \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7912
                    CCamAppUi::ConstructPostCaptureViewIfRequiredL \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7913
                     - StillPostCapture") );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7914
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7915
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7916
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7917
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7918
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7919
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7920
#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7921
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7922
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7923
// CCamAppUi::StartPostCapIdleL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7924
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7925
// Starts calls to PostCapIdleCallBack during processor idle time. The calls
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7926
// are continued until PostCapIdleCallBack is done.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7927
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7928
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7929
void CCamAppUi::StartPostCapIdleL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7930
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7931
    if( !iPostCapIdle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7932
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7933
        iPostCapIdle = CIdle::NewL( CActive::EPriorityIdle );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7934
        iPostCapProgress = ECamConstructStillPostCap;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7935
        iPostCapIdle->Start( TCallBack( PostCapIdleCallBack, this ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7936
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7937
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7938
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7939
        // iPostCapIdle already exists.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7940
        // Do nothing - the views have already been constructed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7941
        }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7942
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7943
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7944
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7945
// CCamAppUi::PostCapIdleCallBack
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7946
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7947
// Handles postcapture view construction so that each call to this function
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7948
// constructs one postcapture view. Returns ETrue if there are still more views
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7949
// to construct, EFalse if all are finished and no further calls are required.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7950
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7951
// ---------------------------------------------------------------------------    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7952
TInt CCamAppUi::PostCapIdleCallBack( TAny* aSelf )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7953
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7954
    PRINT( _L("Camera => CCamAppUi::PostCapIdleCallBack") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7955
    TInt ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7956
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7957
    CCamAppUi* self = static_cast<CCamAppUi*>( aSelf );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7958
    if( self )    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7959
        {  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7960
        if( ECamConstructStillPostCap == self->iPostCapProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7961
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7962
            TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7963
                ECamViewStatePostCapture, ECamControllerImage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7964
            self->iPostCapProgress = ECamConstructBurstPostCap;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7965
            ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7966
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7967
        else if( ECamConstructBurstPostCap == self->iPostCapProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7968
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7969
            TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7970
                ECamViewStateBurstThumbnail, ECamControllerImage ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7971
            self->iPostCapProgress = ECamConstructVideoPostCap;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7972
            ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7973
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7974
        else if( ECamConstructVideoPostCap == self->iPostCapProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7975
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7976
            TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7977
                ECamViewStatePostCapture, ECamControllerVideo ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7978
            self->iPostCapProgress = ECamPostCapsDone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7979
            // Complete
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7980
            ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7981
            }                                  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7982
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7983
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7984
    PRINT( _L("Camera <= CCamAppUi::PostCapIdleCallBack") );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7985
    return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7986
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7987
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7988
#endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7989
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7990
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7991
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7992
// CCamAppUi::StartSensorIdleL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7993
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7994
// Initiates a call to SensorIdleCallback during processor idle time
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7995
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7996
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7997
void CCamAppUi::StartSensorIdleL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7998
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  7999
    if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8000
    	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8001
	    if( iSensorIdleRunning )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8002
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8003
	        // Delayed sensor initialization is already in progress  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8004
	        return;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8005
	        }  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8006
	      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8007
	    if( !iSensorIdle )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8008
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8009
	        // Instantiate new CIdle  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8010
	        iSensorIdle = CIdle::NewL( CActive::EPriorityIdle );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8011
	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8012
	    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8013
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8014
	        // Cancel existing the existing request, just in case
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8015
	        iSensorIdle->Cancel();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8016
	        }     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8017
	     
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8018
	    // Initialize the idle callback   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8019
	    iSensorIdle->Start( TCallBack( SensorIdleCallBack, this ) );                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8020
	    iSensorIdleRunning = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8021
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8022
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8023
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8024
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8025
// CCamAppUi::CancelSensorIdle
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8026
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8027
// Cancels the (possibly) pending call to SensorIdleCallBack
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8028
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8029
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8030
void CCamAppUi::CancelSensorIdle()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8031
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8032
		if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8033
			{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8034
	    if( iSensorIdle && iSensorIdleRunning )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8035
	        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8036
	        iSensorIdle->Cancel();  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8037
	        iSensorIdleRunning = EFalse;  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8038
	        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8039
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8040
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8041
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8042
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8043
// CCamAppUi::SensorIdleCallBack
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8044
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8045
// Calls iControler.UpdateSensorApiL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8046
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8047
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8048
TInt CCamAppUi::SensorIdleCallBack( TAny* aSelf )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8049
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8050
    CCamAppUi* self = static_cast<CCamAppUi*>( aSelf );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8051
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8052
    if( self ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8053
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8054
        TRAP_IGNORE( self->iController.UpdateSensorApiL( ETrue ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8055
        self->iSensorIdleRunning = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8056
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8057
    return EFalse; // No more calls needed
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8058
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8059
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8060
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8061
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8062
// CCamAppUi::IsSelfTimedCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8063
// Whether the latest capture was selftimer initiated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8064
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8065
//         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8066
TBool CCamAppUi::IsSelfTimedCapture() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8067
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8068
    return iSelfTimedCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8069
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8070
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8071
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8072
// CCamAppUi::DismissMemoryNoteL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8073
// Dismisses out of memory / memory card removed note, if active.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8074
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8075
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8076
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8077
CCamAppUi::DismissMemoryNoteL()  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8078
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8079
  if( iMemoryNote )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8080
    {         
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8081
    if( iMemoryNote->IsFocused() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8082
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8083
      // For some reason, the note's softkeys are displayed in standby mode,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8084
      // even though the note itself has been dismissed (=deleted)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8085
      // HACK:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8086
      // If the note is focused, we know that also its softkeys are in use,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8087
      // so we can simulate key events to emulate user closing the note
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8088
      // using left softkey.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8089
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8090
      TKeyEvent key;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8091
      key.iRepeats = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8092
      key.iCode = EKeyDevice0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8093
      key.iModifiers = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8094
      iEikonEnv->SimulateKeyEventL( key, EEventKeyDown );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8095
      CEikButtonGroupContainer::Current()->OfferKeyEventL( key, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8096
          EEventKeyDown );            
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8097
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8098
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8099
    // Make sure the note closes even if it wasn't focused.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8100
    delete iMemoryNote;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8101
    iMemoryNote = NULL;                           
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8102
    }               
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8103
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8104
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8105
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8106
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8107
// Starts Gallery Application command line
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8108
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8109
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8110
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8111
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8112
void
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8113
CCamAppUi::StartAppCmdLineL( const TDes8& aData )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8114
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8115
    // MM not running yet - use Command Line Tail
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8116
    RApaLsSession appArcSession;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8117
    CleanupClosePushL( appArcSession );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8118
    User::LeaveIfError( appArcSession.Connect() );      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8119
    TApaAppInfo appInfo;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8120
    User::LeaveIfError( appArcSession.GetAppInfo( appInfo,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8121
           TUid::Uid( KGlxGalleryApplicationUid) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8122
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8123
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8124
    cmdLine->SetExecutableNameL( appInfo.iFullName );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8125
    cmdLine->SetCommandL( EApaCommandRun );   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8126
    cmdLine->SetTailEndL( aData );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8127
   
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8128
    User::LeaveIfError( appArcSession.StartApp( *cmdLine ) );      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8129
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8130
    CleanupStack::PopAndDestroy( cmdLine );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8131
    CleanupStack::PopAndDestroy( &appArcSession ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8132
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8133
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8134
// CCamAppUi::StartCheckingDefaultAlbumIdL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8135
// We start check operation to see if "Default Album exists"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8136
// Usecase: Whenever the camera returns from background/startup we first start
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8137
// checking the default album which is set, if any, to make sure that album 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8138
// really exists. If not, then we set back the value of setting item "Add to 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8139
// album" to "No" in Image/Video setting image settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8140
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8141
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8142
void CCamAppUi::StartCheckingDefaultAlbumIdL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8143
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8144
    TBool checkAlbum = ( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8145
            iController.IntegerSettingValue( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8146
                            ECamSettingItemPhotoStoreInAlbum ) == ECamSettYes ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8147
            iController.IntegerSettingValue( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8148
                            ECamSettingItemVideoStoreInAlbum ) == ECamSettYes );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8149
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8150
    if ( !iCheckOperationInProgress && checkAlbum )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8151
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8152
        TUint32 defaultAlbumId = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8153
        static_cast<TUint32> ( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8154
                iController.IntegerSettingValue( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8155
                        ECamSettingItemDefaultAlbumId ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8156
        if ( iCollectionManager )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8157
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8158
            iCheckOperationInProgress = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8159
            iCollectionManager->CheckForAlbumExistenceL( defaultAlbumId );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8160
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8161
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8162
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8163
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8164
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8165
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8166
// CCamAppUi::CheckAlbumIdOperationCompleteL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8167
// Call back method, which is called once the check operation is complete
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8168
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8169
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8170
void CCamAppUi::CheckAlbumIdOperationCompleteL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8171
    TBool aAlbumExists, const TDesC& /*aAlbumTitle*/ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8172
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8173
    PRINT( _L("CCamAppUi::CheckAlbumIdOperationCompleteL --> ENTERS") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8174
    if ( iController.UiConfigManagerPtr()->IsPhotosSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8175
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8176
        if ( iCheckOperationInProgress )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8177
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8178
            PRINT( _L("CheckAlbumIdOperationCompleteL \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8179
                iCheckOperationInProgress: ETRUE") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8180
            iCheckOperationInProgress = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8181
            if ( !aAlbumExists )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8182
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8183
                // Reset all the values to the default ones, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8184
                // if the default album doesnt exist, when returned from background
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8185
                iController.SetIntegerSettingValueL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8186
                                     ECamSettingItemPhotoStoreInAlbum,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8187
                                     ECamSettNo );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8188
                iController.SetIntegerSettingValueL( 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8189
                                     ECamSettingItemVideoStoreInAlbum,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8190
                                     ECamSettNo );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8191
                // reseting the album id to the default value "0"
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8192
                iController.SetIntegerSettingValueL(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8193
                                     ECamSettingItemDefaultAlbumId,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8194
                                     0 );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8195
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8196
            }        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8197
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8198
    PRINT( _L("CCamAppUi::CheckAlbumIdOperationCompleteL <-- EXITS") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8199
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8200
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8201
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8202
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8203
// CCamAppUi::SettingsLaunchedFromCamera()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8204
// We keep track of plugin event launched from camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8205
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8206
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8207
TBool CCamAppUi::SettingsLaunchedFromCamera() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8208
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8209
    return iSettingsPluginLaunched;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8210
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8211
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8212
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8213
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8214
// CCamAppUi::SettingsPluginExitedL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8215
// We handle the case when settings plugin exists
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8216
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8217
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8218
void CCamAppUi::SettingsPluginExitedL( TCamSettingsPluginExitMessage aType )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8219
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8220
    iSettingsPluginLaunched =  EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8221
    iTargetViewState = ECamViewStatePreCapture;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8222
    TrySwitchViewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8223
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8224
    switch ( aType )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8225
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8226
        case ECameraPluginExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8227
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8228
            // we exit the plugin and switch to pre-capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8229
            iReturnedFromPlugin = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8230
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8231
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8232
        case ECameraInternalExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8233
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8234
             // Internal Exit from Plugin -> Options -> Exit
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8235
             iReturnedFromPlugin = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8236
             InternalExitL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8237
             break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8238
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8239
        case ECameraCompleteExit:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8240
             {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8241
             // Plugiin -> End Key or "c" key
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8242
             iReturnedFromPlugin = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8243
             break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8244
             }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8245
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8246
    PRINT( _L("Camera <= CCamAppUi::SettingsPluginExitedL") );	    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8247
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8248
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8249
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8250
// CCamAppUi::StaticSettingsModel()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8251
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8252
// Gets the handle to the settings model, which is used inturn by the
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8253
// plugin to call the interfaces for performing needed actions.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8254
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8255
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8256
MCamStaticSettings& 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8257
CCamAppUi::StaticSettingsModel()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8258
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8259
    return iController.StaticSettingsModel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8260
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8261
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8262
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8263
// CCamAppUi::CreateNaviBitmapsL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8264
// Draw the counter to the bitmap used in the navi pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8265
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8266
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8267
void 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8268
CCamAppUi::CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8269
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8270
    if ( iNaviCounterModel )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8271
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8272
	    iNaviCounterModel->CreateNaviBitmapsL( aDrawStorageIconAndCounter );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8273
	    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8274
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8275
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8276
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8277
// CCamAppUi::ReadyToDraw
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8278
// Checks whether its safe to draw controls
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8279
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8280
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8281
TBool CCamAppUi::ReadyToDraw() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8282
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8283
    if ( AppInBackground( ETrue ) || !iView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8284
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8285
        return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8286
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8287
    else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8288
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8289
        return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8290
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8291
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8292
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8293
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8294
// CCamAppUi::StartFileNameCheck
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8295
// Checks whether the file name is deleted/renamed outside camera
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8296
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8297
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8298
void CCamAppUi::StartFileNameCheck()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8299
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8300
    PRINT( _L("Camera => CCamAppUi::StartFileNameCheck") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8301
    if( !iFileCheckAo->IsActive() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8302
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8303
        iFileCheckAo->Start();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8304
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8305
    PRINT( _L("Camera <= CCamAppUi::StartFileNameCheck") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8306
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8307
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8308
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8309
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8310
// CCamAppUi::FileCheckingComplete
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8311
// Handle a file checking complete event. Used to inform
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8312
// when filechecking active object.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8313
// has finished checking existance of files.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8314
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8315
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8316
void CCamAppUi::FileCheckingCompleteL( TInt aStatus, TInt aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8317
  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8318
  PRINT2( _L("Camera => CCamAppUi::FileCheckingComplete(), \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8319
      aStatus=%d, aError=%d "), aStatus, aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8320
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8321
  if( aStatus <= 0 || KErrNone != aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8322
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8323
      PRINT( _L("Camera <> CCamAppUi::FileCheckingComplete: \
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8324
      all files deleted, trying viewswitch") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8325
      iTargetViewState = ECamViewStatePreCapture;      	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8326
      TrySwitchViewL( ETrue );		  	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8327
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8328
  else if ( aStatus < iController.BurstCaptureArray()->Count() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8329
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8330
      PRINT2( _L("Camera <> CCamAppUi::FileCheckingComplete: %d < %d,\
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8331
              some file(s) have been deleted"),
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8332
              aStatus,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8333
              iController.BurstCaptureArray()->Count() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8334
      
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8335
      if ( iViewState == ECamViewStateBurstThumbnail || iViewState == ECamViewStatePostCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8336
          {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8337
          PRINT( _L("Camera <> CCamAppUi::FileCheckingComplete() updating thumbnail view") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8338
          CCamBurstThumbnailView* thumbnailView =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8339
          static_cast<CCamBurstThumbnailView*>( View( TUid::Uid( ECamViewIdBurstThumbnail ) ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8340
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8341
          if ( thumbnailView )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8342
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8343
              thumbnailView->ImageFilesDeleted();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8344
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8345
          
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8346
          if ( iViewState == ECamViewStatePostCapture )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8347
              {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8348
              // view state is post-capture, check if the image currently viewed has been deleted
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8349
              if ( iController.BurstCaptureArray()->IsDeleted( iController.CurrentImageIndex() ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8350
                  {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8351
                  //switch back to burst thumbnail view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8352
                  HandleCommandL( EAknSoftkeyBack );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8353
                  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8354
              
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8355
              }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8356
          }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8357
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8358
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8359
  //When return to video post capture view from background, we need to determine whether show the toolbar
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8360
  if( iReturnFromBackground
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8361
      && iViewState == ECamViewStatePostCapture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8362
      && iMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8363
      {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8364
      SetToolbarVisibility();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8365
      }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8366
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8367
  PRINT( _L("Camera <= CCamAppUi::FileCheckingComplete()") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8368
  }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8369
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8370
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8371
// CCamAppUi::HandleSelfTimerEvent
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8372
// Handle self-timer event
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8373
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8374
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8375
void CCamAppUi::HandleSelfTimerEvent( TCamSelfTimerEvent aEvent,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8376
                                      TInt aCountDown )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8377
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8378
#if defined( CAMERAAPP_CAPI_V2_DVF )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8379
    TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8380
#else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8381
    (void) aEvent;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8382
    (void) aCountDown;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8383
#endif // CAMERAAPP_CAPI_V2_DVF
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8384
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8385
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8386
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8387
// CCamAppUi::RequestedNewFileResolution
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8388
// Set the requested resolution for a new file
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8389
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8390
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8391
void CCamAppUi::SetRequestedNewFileResolution(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8392
    const TSize& aRequestedResolution )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8393
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8394
    iRequestedNewFileResolution.SetSize(
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8395
        aRequestedResolution.iWidth,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8396
        aRequestedResolution.iHeight );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8397
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8398
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8399
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8400
// CCamAppUi::RequestedNewFileResolution
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8401
// Get the requested resolution for a new file
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8402
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8403
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8404
TSize CCamAppUi::RequestedNewFileResolution() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8405
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8406
    // Default is TSize(0, 0) which interpreted as MMS quality resolution
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8407
    return iRequestedNewFileResolution;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8408
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8409
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8410
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8411
// CCamAppUi::SetToolbarVisibility
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8412
// Set toolbar visibility in according to whether current view and 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8413
// mode are fit. When embedded camera starts up, view and mode may 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8414
// not be fit.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8415
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8416
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8417
void CCamAppUi::SetToolbarVisibility()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8418
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8419
    // fixed toolbar is used only with touch devices
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8420
    CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8421
    if ( iController.IsTouchScreenSupported() && fixedToolbar )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8422
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8423
        if ( IsEmbedded() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8424
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8425
            // Check that iMode matches iTargetMode and that the corresponding
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8426
            // view is active.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8427
            if ( iMode == iTargetMode &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8428
                ( ( iMode == ECamControllerVideo && iView == iVideoCaptureView ) ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8429
                  ( iMode == ECamControllerImage && iView == iStillCaptureView ) ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8430
                ( iPreCaptureMode != ECamPreCapCaptureSetup ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8431
                ( iPreCaptureMode != ECamPreCapGenericSetting ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8432
                ( iPreCaptureMode != ECamPreCapSceneSetting ) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8433
                ( iPreCaptureMode != ECamPreCapStandby ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8434
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8435
                fixedToolbar->SetToolbarVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8436
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8437
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8438
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8439
                fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8440
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8441
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8442
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8443
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8444
            if( (iPreCaptureMode != ECamPreCapCaptureSetup) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8445
                (iPreCaptureMode != ECamPreCapGenericSetting) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8446
                (iPreCaptureMode != ECamPreCapSceneSetting) && 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8447
                (iPreCaptureMode != ECamPreCapStandby) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8448
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8449
                fixedToolbar->SetToolbarVisibility( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8450
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8451
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8452
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8453
                // No toolbar with the settings view
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8454
                fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8455
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8456
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8457
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8458
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8459
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8460
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8461
// CCamAppUi::SubmergeToolbar
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8462
// Hide toolbar if needed.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8463
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8464
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8465
void CCamAppUi::SubmergeToolbar()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8466
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8467
    PRINT( _L("Camera => CCamAppUi::SubmergeToolbar()") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8468
    // fixed toolbar is used only with touch devices
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8469
    CAknToolbar* fixedToolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8470
    if ( iController.IsTouchScreenSupported() && fixedToolbar )  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8471
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8472
        fixedToolbar->SetToolbarVisibility( EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8473
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8474
    PRINT( _L("Camera <= CCamAppUi::SubmergeToolbar()") ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8475
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8476
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8477
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8478
// Check if it's applicable to use the courtesy UI
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8479
// ---------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8480
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8481
TBool CCamAppUi::CourtesyUiApplies() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8482
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8483
    return ( ECamCapturing != iController.CurrentVideoOperation()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8484
             && ECamPaused != iController.CurrentVideoOperation()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8485
             && !SelfTimerEnabled()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8486
             && ( ECamOrientationCamcorder == iCamOrientation ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8487
                  ECamOrientationCamcorderLeft == iCamOrientation ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8488
                  ECamOrientationPortrait == iCamOrientation ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8489
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8490
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8491
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8492
// CCamAppUi::IsToolBarVisible
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8493
// Returns whether or the tool bar has been activated
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8494
// Will return ETrue when when the tool bar is active
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8495
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8496
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8497
TBool CCamAppUi::IsToolBarVisible() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8498
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8499
    PRINT1( _L("Camera => CCamAppUi::IsToolBarVisible %d" ), iToolbarVisibility )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8500
    return iToolbarVisibility;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8501
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8502
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8503
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8504
// CCamAppUi::IsToolBarExtensionVisible
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8505
// Returns ETrue if the toolbar extension is visible,
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8506
// otherwise EFalse.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8507
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8508
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8509
TBool CCamAppUi::IsToolBarExtensionVisible() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8510
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8511
    if ( iController.IsTouchScreenSupported() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8512
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8513
        CAknToolbar* toolbar = CurrentFixedToolbar();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8514
        if ( toolbar )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8515
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8516
            CAknToolbarExtension* toolbarextension =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8517
                toolbar->ToolbarExtension();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8518
            if ( toolbarextension && toolbarextension->IsShown() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8519
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8520
                PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible ETrue" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8521
                return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8522
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8523
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8524
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8525
    PRINT( _L("Camera <> CCamAppUi::IsToolBarExtensionVisible EFalse" ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8526
    return EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8527
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8528
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8529
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8530
// CCamAppUi::SetAssumePostCaptureView
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8531
// Sets iAssumePostCapture flag according to aValue
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8532
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8533
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8534
void CCamAppUi::SetAssumePostCaptureView( TBool aValue )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8535
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8536
    if ( iView 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8537
         && ( iStillCaptureView == iView || iVideoCaptureView == iView ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8538
        {	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8539
        static_cast<CCamPreCaptureViewBase*>( iView )->SetPostCaptureViewAsumption( aValue );	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8540
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8541
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8542
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8543
// --------------------------------------------------------------------------- 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8544
// CCamAppUi::SetDrawPreCaptureCourtesyUI 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8545
// Set iDrawPreCaptureCourtesyUI flag 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8546
// --------------------------------------------------------------------------- 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8547
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8548
void CCamAppUi::SetDrawPreCaptureCourtesyUI(TBool iDraw) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8549
    { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8550
        if( iDraw ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8551
            { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8552
            iDrawPreCaptureCourtesyUI = ETrue; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8553
            } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8554
        else 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8555
            { 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8556
            iDrawPreCaptureCourtesyUI = EFalse; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8557
            } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8558
    } 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8559
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8560
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8561
// CCamAppUi::IsMemoryFullOrUnavailable
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8562
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8563
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8564
TBool 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8565
CCamAppUi::IsMemoryFullOrUnavailable(const TCamMediaStorage 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8566
									 aStorageLocation) const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8567
	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8568
	if(!iController.IsMemoryAvailable(aStorageLocation))
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8569
		return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8570
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8571
	if(iMode == ECamControllerImage)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8572
		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8573
		TInt availableMemoryUnits = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8574
		availableMemoryUnits = 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8575
			iController.ImagesRemaining(aStorageLocation,EFalse);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8576
		return (availableMemoryUnits <= 0);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8577
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8578
	else if(iMode == ECamControllerVideo)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8579
		{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8580
		TTimeIntervalMicroSeconds timeLeft = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8581
		
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8582
		TInt err(KErrNone);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8583
		if( iController.CurrentOperation() == ECamNoOperation )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8584
		    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8585
            TRAP(err,timeLeft =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8586
                    iController.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8587
                    CalculateVideoTimeRemainingL(aStorageLocation) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8588
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8589
		else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8590
		    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8591
            TRAP(err,timeLeft =
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8592
                    iController.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8593
                    RemainingVideoRecordingTime() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8594
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8595
		
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8596
		if(err)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8597
		    timeLeft = 0;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8598
		return (timeLeft < KMemoryFullVideoRemaining);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8599
		}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8600
	return ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8601
	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8602
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8603
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8604
// CCamAppUi::AllMemoriesFullOrUnavailable
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8605
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8606
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8607
TBool CCamAppUi::AllMemoriesFullOrUnavailable() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8608
	{
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8609
	TBool phoneMemoryUnavailable = iController.IntegerSettingValue(ECamSettingItemRemovePhoneMemoryUsage)?
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8610
                                    ETrue:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8611
                                    IsMemoryFullOrUnavailable(ECamMediaStoragePhone);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8612
    return ( phoneMemoryUnavailable &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8613
		   IsMemoryFullOrUnavailable(ECamMediaStorageCard) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8614
		   IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8615
	}
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8616
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8617
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8618
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8619
// CCamAppUi::AppUIConstructCallbackL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8620
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8621
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8622
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8623
TInt CCamAppUi::AppUIConstructCallbackL( TAny* aAny )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8624
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8625
    PRINT( _L("Camera => CCamAppUi::AppUIConstructCallbackL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8626
    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8627
    __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8628
    appui->iWaitTimer->Cancel();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8629
    if ( !appui->IsUiConstructionComplete() )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8630
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8631
        appui->CompleteAppUIConstructionL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8632
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8633
    PRINT( _L("Camera <= CCamAppUi::AppUIConstructCallbackL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8634
    return KErrNone;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8635
    }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8636
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8637
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8638
// CCamAppUi::CompleteAppUIConstructionL
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8639
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8640
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8641
//    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8642
void CCamAppUi::CompleteAppUIConstructionL()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8643
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8644
    PRINT( _L("Camera => CCamAppUi::CompleteAppUIConstructionL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8645
    iUiConstructionComplete = ETrue; 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8646
    // Load the settings model static settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8647
    PRINT( _L("Camera <> call CCamAppController::LoadStaticSettingsL..") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8648
    iController.LoadStaticSettingsL( IsEmbedded() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8649
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8650
    iInternalStorage = static_cast<TCamMediaStorage>(iController.IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8651
    // store the userscene settings
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8652
    iController.StoreUserSceneSettingsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8653
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8654
/*#ifndef __WINSCW__    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8655
        if ( !iSFIUtils )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8656
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8657
            // Initialize SFIUtils
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8658
            iSFIUtils = CSFIUtilsAppInterface::NewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8659
            iSendFileInCall = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8660
            PRINT( _L("iSendFileInCall = EFalse") );	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8661
            }	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8662
#endif        */
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8663
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8664
    // Create text resolver for error note text
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8665
    iTextResolver = CTextResolver::NewL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8666
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8667
    ConstructPreCaptureViewsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8668
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8669
    iSelfTimer = CCamSelfTimer::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8670
#if defined( CAMERAAPP_CAPI_V2_DVF )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8671
    iSelfTimer->AddObserverL( this ); 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8672
#endif // CAMERAAPP_CAPI_V2_DVF
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8673
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8674
    PRINT( _L("Camera <> creating navicounter model") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8675
    iNaviCounterModel = CCamNaviCounterModel::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8676
    PRINT( _L("Camera <> append navicounter to resourceloaders") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8677
    User::LeaveIfError( iResourceLoaders.Append(iNaviCounterModel) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8678
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8679
    PRINT( _L("Camera <> creating progress bar model") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8680
    iNaviProgressBarModel = CCamNaviProgressBarModel::NewL( iController );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8681
    PRINT( _L("Camera <> append progressbar to resourceloaders") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8682
    User::LeaveIfError(iResourceLoaders.Append(iNaviProgressBarModel));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8683
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8684
    ConstructNaviPaneL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8685
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8686
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8687
    //embedded camera may start straight in videomode
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8688
    if( IsEmbedded() && iTargetMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8689
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8690
        SetDefaultViewL( *iVideoCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8691
        PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL SetDefaultView Video") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8692
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8693
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8694
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8695
        SetDefaultViewL( *iStillCaptureView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8696
        PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL SetDefaultView Still") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8697
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8698
                
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8699
    // pre-construct side-pane & zoom pane
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8700
    // get whether we overlay sidepane over view-finder
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8701
    TBool overlayViewFinder;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8702
    User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8703
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create sidepane") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8704
    iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8705
    User::LeaveIfError(iResourceLoaders.Append(iCamSidePane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8706
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8707
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create zoom pane") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8708
    iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8709
    User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8710
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8711
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create doc handler") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8712
    iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8713
    iDocHandler->SetExitObserver(this);    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8714
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8715
    // Check to see if we are set to use mmc storage but the card has
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8716
    // been removed.  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8717
    iController.CheckMemoryToUseL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8718
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8719
    // create navi-pane and navi-porgress bar for use in camcorder mode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8720
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create navicounter control") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8721
    iNaviCounterControl = CCamNaviCounterControl::NewL( *iNaviCounterModel );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8722
    iNaviCounterControl->SetExtentToWholeScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8723
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8724
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create progress bar control") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8725
    iNaviProgressBarControl = CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel );        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8726
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8727
    // get max num of images for burst capture
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8728
    CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, iMaxBurstCaptureNum );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8729
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8730
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create AP handler") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8731
    iActivePaletteHandler = CCamActivePaletteHandler::NewL( iController, EFalse );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8732
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8733
    // get coutesy UI timeout
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8734
    TInt timeoutValue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8735
    CamUtility::GetPsiInt( ECamPsiCourtesyUiTimeoutValue, timeoutValue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8736
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8737
    iCourtesyTimer = CCamTimer::NewL( timeoutValue * 1000000, 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8738
                                    TCallBack( CCamAppUi::CourtesyTimeout, this ) );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8739
                                    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8740
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL update navi models") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8741
    UpdateNaviModelsL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8742
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL navi counter reload resources") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8743
    iNaviCounterModel->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8744
    PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL navi progress bar reload resources") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8745
    iNaviProgressBarModel->ReloadResourceDataL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8746
  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8747
    iFileCheckAo = CCamFileCheckAo::NewL( iController, *this );  
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8748
    iCollectionManager = new (ELeave) CCamCollectionManagerAO( *this );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8749
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8750
    //iStillCaptureView->Container()->MakeVisible( ETrue );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8751
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8752
    if( IsEmbedded() && iTargetMode == ECamControllerVideo )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8753
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8754
        ActivateLocalViewL( iVideoCaptureView->Id() );    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8755
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8756
    else        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8757
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8758
        ActivateLocalViewL( iStillCaptureView->Id() );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8759
        }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8760
    StartCheckingDefaultAlbumIdL();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8761
    PRINT( _L("Camera <= CCamAppUi::CompleteAppUIConstructionL") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8762
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8763
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8764
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8765
// CCamAppUi::IsUiConstructionComplete()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8766
// 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8767
// ---------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8768
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8769
TBool CCamAppUi::IsUiConstructionComplete()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8770
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8771
    return iUiConstructionComplete;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8772
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8773
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8774
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8775
// CCamAppUi::SetLensCoverExit 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8776
// Sets iLensCoverExit flag according to aValue
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8777
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8778
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8779
void CCamAppUi::SetLensCoverExit( TBool aValue )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8780
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8781
    iLensCoverExit = aValue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8782
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8783
	
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8784
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8785
// CCamAppUi::SetViewFinderStoppedStatus 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8786
// set whether camera viewfinder stop or not
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8787
// @param aViewFinderStopped ETrue viewfinder is stoped,EFalse viewfinder is runing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8788
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8789
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8790
void CCamAppUi::SetViewFinderStoppedStatus( TBool aViewFinderStopped )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8791
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8792
    iViewFinderStopped = aViewFinderStopped;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8793
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8794
    if (iStartupLogoController)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8795
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8796
        iStartupLogoController->HideLogo();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8797
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8798
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8799
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8800
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8801
// CCamAppUi::IsViewFinderInTransit 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8802
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8803
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8804
TBool CCamAppUi::IsViewFinderInTransit()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8805
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8806
    return iViewFinderInTransit;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8807
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8808
        
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8809
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8810
// CCamAppUi::SetViewFinderInTransit 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8811
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8812
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8813
void CCamAppUi::SetViewFinderInTransit(TBool aInTransit)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8814
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8815
    iViewFinderInTransit = aInTransit;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8816
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8817
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8818
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8819
// CCamAppUi::CheckMemoryAvailableForCapturing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8820
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8821
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8822
void CCamAppUi::CheckMemoryAvailableForCapturing()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8823
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8824
    PRINT( _L("Camera => CCamAppUi::CheckMemoryAvailableForCapturing") )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8825
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CHECKMEMORYAVAILABLEFORCAPTURING, "e_CCamAppUi_CheckMemoryAvailableForCapturing 1" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8826
    if ( ( ECamControllerVideo == iController.CurrentMode() ||
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8827
           ECamControllerVideo == iController.TargetMode() ) &&
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8828
           ECamMediaStorageCard == iController.
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8829
                IntegerSettingValue( ECamSettingItemVideoMediaStorage ) )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8830
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8831
        iMemoryAvailableForCapturing = !IsMemoryFullOrUnavailable( ECamMediaStorageCard );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8832
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8833
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8834
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8835
        iMemoryAvailableForCapturing = !IsMemoryFullOrUnavailable( ECamMediaStorageCurrent );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8836
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8837
    OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CHECKMEMORYAVAILABLEFORCAPTURING, "e_CCamAppUi_CheckMemoryAvailableForCapturing 0" );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8838
    PRINT1( _L("Camera <= CCamAppUi::CheckMemoryAvailableForCapturing iMemoryAvailableForCapturing:%d"), iMemoryAvailableForCapturing )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8839
    }    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8840
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8841
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8842
// CCamAppUi::IsMemoryAvailableForCapturing
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8843
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8844
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8845
TBool CCamAppUi::IsMemoryAvailableForCapturing() const
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8846
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8847
    return iMemoryAvailableForCapturing;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8848
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8849
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8850
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8851
// CCamAppUi::StartupLogoController
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8852
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8853
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8854
CCamStartupLogoController* CCamAppUi::StartupLogoController()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8855
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8856
    return iStartupLogoController;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8857
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8858
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8859
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8860
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8861
// CCamAppUi::IsRecoverableStatus 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8862
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8863
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8864
TBool CCamAppUi::IsRecoverableStatus()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8865
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8866
    TBool ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8867
    switch(iStandbyStatus)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8868
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8869
        case ECamErrMassStorageMode:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8870
        case ECamErrMemoryCardNotInserted:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8871
            ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8872
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8873
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8874
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8875
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8876
    return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8877
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8878
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8879
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8880
// CCamAppUi::ChangeStandbyStatusL 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8881
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8882
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8883
TBool CCamAppUi::ChangeStandbyStatusL( TInt aError )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8884
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8885
    PRINT( _L("Camera => CCamAppUi::ChangeStandbyStatusL") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8886
    TBool ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8887
    if( ECamViewStateStandby == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8888
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8889
        CCamViewBase* view = static_cast<CCamViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8890
        if( view )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8891
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8892
            PRINT( _L("Camera <> CCamAppUi::ChangeStandbyStatusL ECamViewStateStandby") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8893
            view->SetStandbyStatusL( aError );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8894
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8895
        else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8896
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8897
            ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8898
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8899
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8900
    else if( ECamViewStatePreCapture == iViewState )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8901
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8902
        CCamPreCaptureViewBase* view = static_cast<CCamPreCaptureViewBase*>( iView );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8903
        PRINT( _L("Camera <> CCamAppUi::ChangeStandbyStatusL ECamViewStatePreCapture") );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8904
        if( view ) 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8905
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8906
            if( TBool(ETrue)  == view->IsSetupModeActive() ) // Boolean corruption
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8907
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8908
                ret = ETrue;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8909
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8910
            else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8911
                {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8912
                ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8913
                }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8914
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8915
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8916
    else
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8917
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8918
        if( ECamViewStatePreCapture ==  iTargetViewState  || ECamPreCapViewfinder == iPreCaptureMode)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8919
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8920
            ret = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8921
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8922
        PRINT3( _L("Camera <> CCamAppUi::ChangeStandbyStatusL iViewState=%d iTargetViewState=%d iPreCaptureMode=%d"), iViewState, iTargetViewState, iPreCaptureMode );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8923
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8924
    PRINT1( _L("Camera <= CCamAppUi::ChangeStandbyStatusL ret=%d"), ret);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8925
    return ret;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8926
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8927
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8928
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8929
// CCamAppUi::PreCaptureMode 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8930
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8931
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8932
TCamPreCaptureMode CCamAppUi::PreCaptureMode()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8933
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8934
    PRINT1( _L("Camera <> CCamAppUi::PreCaptureMode %d"), iPreCaptureMode);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8935
    return iPreCaptureMode;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8936
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8937
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8938
void CCamAppUi::HandleServerAppExit(TInt aReason)
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8939
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8940
    PRINT1(_L("Camera => CCamAppUi::HandleServerAppExit. aReason:%d"), aReason);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8941
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8942
    MAknServerAppExitObserver::HandleServerAppExit(aReason);
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8943
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8944
    iVideoClipPlayInProgress = EFalse;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8945
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8946
    PRINT(_L("Camera <= CCamAppUi::HandleServerAppExit."));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8947
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8948
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8949
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8950
// CCamAppUi::HandleHdmiEventL 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8951
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8952
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8953
void CCamAppUi::HandleHdmiEventL( TCamHdmiEvent aEvent )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8954
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8955
    HBufC* noteString = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8956
    CAknWarningNote* note = NULL;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8957
    switch( aEvent )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8958
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8959
        case ECamHdmiCableConnectedBeforeRecording:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8960
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8961
            noteString = StringLoader::LoadLC( R_QTN_LCAM_HDMI_REMOVE_CABLE );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8962
            note = new (ELeave) CAknWarningNote();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8963
            note->ExecuteLD( *noteString );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8964
            CleanupStack::PopAndDestroy( noteString );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8965
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8966
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8967
        case ECamHdmiCableConnectedDuringRecording:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8968
            {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8969
            noteString = StringLoader::LoadLC( R_QTN_LCAM_HDMI_CABLE_DETECTED );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8970
            note = new (ELeave) CAknWarningNote();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8971
            note->ExecuteLD( *noteString );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8972
            CleanupStack::PopAndDestroy( noteString );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8973
            }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8974
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8975
        default:
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8976
            break;
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8977
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8978
    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8979
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8980
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8981
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8982
// CCamAppUi::NaviProgressBarModel 
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8983
// -----------------------------------------------------------------------------
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8984
//
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8985
CCamNaviProgressBarModel* CCamAppUi::NaviProgressBarModel()
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8986
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8987
    return iNaviProgressBarModel;    
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8988
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8989
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8990
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8991
void CCamAppUi::CleanupBlankScreen( TAny* aAny )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8992
    {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8993
    PRINT(_L("Camera => CCamAppUi::CleanupBlankScreen."));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8994
    CCamAppUi* appui = static_cast<CCamAppUi*>( aAny );
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8995
    RAknUiServer* capServ = CAknSgcClient::AknSrv();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8996
    if( capServ )
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8997
        {
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8998
        capServ->UnblankScreen();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  8999
        appui->Exit();
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  9000
        }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  9001
    PRINT(_L("Camera <= CCamAppUi::CleanupBlankScreen."));
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  9002
    }
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  9003
bac7acad7cb3 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  9004
//  End of File