camerauis/cameraapp/generic/inc/CamAppUi.h
changeset 19 d9aefe59d544
parent 3 8b2d6d0384b0
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  App UI class for cameraapp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMAPPUI_H
       
    20 #define CAMAPPUI_H
       
    21 
       
    22 // ===========================================================================
       
    23 //  INCLUDES
       
    24 #include "CamAppUiBase.h"
       
    25 #include "CamNewFileService.h"
       
    26 #include "CamSelfTimerObserver.h"  
       
    27 #include "CamVolumeKeyObserver.h"
       
    28 #include "mcamcameraobserver.h"
       
    29 #include "CamFileCheckAo.h"
       
    30 
       
    31 #include "MCamAddToAlbumObserver.h"
       
    32 
       
    33 class CFbsBitGc;
       
    34 class CAknNavigationDecorator;
       
    35 class CAknNavigationControlContainer;
       
    36 class CCamWaitDialog;
       
    37 class CCamTimerBase;
       
    38 class CCamNaviCounterControl;
       
    39 class CCamNaviCounterModel;
       
    40 class CCamNaviProgressBarControl;
       
    41 class CCamNaviProgressBarModel;
       
    42 class CCamSelfTimer;
       
    43 class MCamBurstModeObserver;
       
    44 class CDocumentHandler;
       
    45 class CTextResolver;
       
    46 class CCamSidePane;
       
    47 class CCamZoomPane;
       
    48 class MCamResourceLoader;
       
    49 class CCamTimer;
       
    50 class CIdle;
       
    51 class CAknStylusPopUpMenu; 
       
    52 
       
    53 class CGSPluginInterface;
       
    54 class CGSTabHelper;
       
    55 class CCamGSInterface;
       
    56 
       
    57 class CAknGlobalNote;
       
    58 
       
    59 //class CASpaAppLauncherActionData;
       
    60 //class CSFIUtilsAppInterface;    // InCall Send interface
       
    61 class CCamPropertyWatcher;
       
    62 class CRepository;
       
    63 class MActivePalette2UI;
       
    64 class CCamActivePaletteHandler;
       
    65 class CAknLocalScreenClearer;
       
    66 class CAknStaticNoteDialog;
       
    67 class CCamCollectionManagerAO;
       
    68 class CCamStillPreCaptureView;
       
    69 class CCamVideoPreCaptureView;
       
    70 class CCamMemoryMonitor;
       
    71 
       
    72 // ===========================================================================
       
    73 // CLASS DECLARATION
       
    74 
       
    75 /**
       
    76 *  AppUi class for Camera
       
    77 *
       
    78 *  @since 2.8
       
    79 */
       
    80 class CCamAppUi : public CCamAppUiBase,
       
    81                   public MCamSelfTimerObserver,
       
    82                   public MCamControllerObserver,
       
    83                   public MCamVolumeKeyObserver,
       
    84                   public MCamFileCheckObserver,
       
    85                   public MCamCameraObserver
       
    86                   ,public MCamAddToAlbumObserver
       
    87   {
       
    88   // =======================================================
       
    89   // Data Types
       
    90   private: 
       
    91         
       
    92     // enumeration to describe the type of view switch required when 
       
    93     // the capture mode or view state changes
       
    94     enum TCamViewSwitch
       
    95         {
       
    96         ECamViewSwitchNone,    // no switch required
       
    97         ECamViewSwitchModeOnly,// only capture mode or view state need updating
       
    98         ECamViewSwitch         // full view switch required including state 
       
    99                                // and mode update
       
   100         };
       
   101 
       
   102     /**
       
   103      * Enumeration used for the state of delayed postacapture views
       
   104      * construction. Only used if CAMERAAPP_DELAYED_POSTCAPTURE_CREATION is
       
   105      * enabled.
       
   106      */
       
   107     enum TCamPostCapConstruction
       
   108         {    
       
   109         ECamConstructStillPostCap,
       
   110         ECamConstructBurstPostCap,
       
   111         ECamConstructVideoPostCap,
       
   112         ECamPostCapsDone
       
   113         };
       
   114     
       
   115     enum TSoftkeyIndex
       
   116         {
       
   117         ESoftkeyIndex1 = 0,
       
   118         ESoftkeyIndex2 = 2
       
   119         };
       
   120       
       
   121     enum TPendingViewSwitchType 
       
   122         {
       
   123         EPendingViewSwitchNone = 0,
       
   124         EPendingViewSwitchNormal,
       
   125         EPendingViewSwitchDeactivateFirst
       
   126         };
       
   127 
       
   128     /**
       
   129      * Memory card status
       
   130      */
       
   131     enum TCamMemoryStatus
       
   132         {
       
   133         ECamMemoryStatusOK,
       
   134         ECamMemoryStatusFull,
       
   135         ECamMemoryStatusInternalFull,
       
   136         ECamMemoryStatusCardNotInserted,
       
   137         ECamMemoryStatusCardReadOnly,
       
   138         ECamMemoryStatusCardLocked,
       
   139         ECamMemoryStatusMassStorageFull
       
   140         };
       
   141 
       
   142   // =======================================================
       
   143   // Methods 
       
   144 
       
   145   // -------------------------------------------------------
       
   146   // Constructors and destructor
       
   147   public:  
       
   148 
       
   149     /**
       
   150     * C++ constructor.
       
   151     * @since 2.8
       
   152     * @param aController Reference to CCamAppController
       
   153     * @return Pointer to CCamAppUi
       
   154     */
       
   155     CCamAppUi( CCamAppController& aController );
       
   156 
       
   157     /**
       
   158     * Perform the second phase construction of a CCamAppUi object.
       
   159     * @since 2.8
       
   160     */
       
   161     void ConstructL();
       
   162 
       
   163     /**
       
   164     * Destructor.
       
   165     */
       
   166     virtual ~CCamAppUi();
       
   167   
       
   168   // -------------------------------------------------------
       
   169   // From MCamCameraObserver
       
   170   public:
       
   171 
       
   172     /**
       
   173     * Handle camera event.
       
   174     *
       
   175     * @param aStatus    Status code describing the event status.
       
   176     * @param aEventId   Identifier for the event.
       
   177     * @param aEventData Event associated data. If such data is provided with
       
   178     *                   the event, it is mentioned in the documentation of
       
   179     *                   particular event id.
       
   180     *                   Ownership not transferred to observer.
       
   181     */
       
   182     void HandleCameraEventL(
       
   183         TInt aStatus, 
       
   184         TCamCameraEventId aEventId, 
       
   185         TAny* aEventData = NULL );   
       
   186 
       
   187   // -------------------------------------------------------
       
   188   // From MCamFileCheckObserver
       
   189   public:
       
   190 
       
   191     /**
       
   192     * Callback to notify that file checking operation has completed.
       
   193     * @param aStatus Number of files that were missing
       
   194     * @param aError  Error code
       
   195     */
       
   196     void FileCheckingCompleteL( TInt aStatus, TInt aError );   
       
   197 
       
   198   // -------------------------------------------------------
       
   199   // New functions
       
   200   public: 
       
   201       /**
       
   202       * Returns whether or the toolbar has been activated/visible
       
   203       * Will return ETrue when when the toolbar is active/visible
       
   204       * @since 3.2
       
   205       * @return ETrue if toolbar is active/visible, else returns EFalse
       
   206       */
       
   207       virtual TBool IsToolBarVisible() const;
       
   208 
       
   209         /**
       
   210         * Check if given view state indicates that "internal",
       
   211         * CCamViewBase inherited view is in question.
       
   212         */
       
   213         TBool IsInternalView( TCamViewState aViewState ) const;
       
   214 
       
   215         /**
       
   216         * Set status of standby mode.
       
   217         */
       
   218         void SetStandbyStatus( TInt aStatus );
       
   219 
       
   220         /**
       
   221         * Get status of standby mode.
       
   222         */
       
   223         TInt StandbyStatus() const;
       
   224 
       
   225         /*
       
   226         * Check for file name deletion/renaming outside camera
       
   227         */
       
   228         void StartFileNameCheck();
       
   229              
       
   230         /**
       
   231         * Determines whether or not all construction has been completed
       
   232         * Used on view activation to determine if the view should
       
   233         * open in standby mode. This will happen if the app is waiting for
       
   234         * an orientation switch to complete or for the initial view to be set
       
   235         * when launched in embedded
       
   236         * @since 3.0
       
   237         * @return ETrue if all construction has completed, else EFalse
       
   238         */   
       
   239         TBool IsConstructionComplete() const;
       
   240 
       
   241         /**
       
   242         * Set title pane text from a resource.
       
   243         * @since 2.8
       
   244         * @param aResourceId resource to read from
       
   245         */
       
   246         void SetTitleL( TInt aResourceId );
       
   247 
       
   248         /**
       
   249         * Set title pane text from a descriptor.
       
   250         * @since 2.8
       
   251         * @param aText title pane text
       
   252         */
       
   253         void SetTitleL( const TDesC& aText );
       
   254 
       
   255         /**
       
   256         * In embedded mode set title to name of embedding application
       
   257         * @since 2.8
       
   258         */
       
   259         void SetTitleEmbeddedL();
       
   260 
       
   261         /**
       
   262         * Push navi pane indicators on to navi pane stack.
       
   263         * @since 2.8
       
   264         */
       
   265         void PushNaviPaneCounterL();
       
   266 
       
   267         /**
       
   268         * Push navi pane progress bar on to navi pane stack.
       
   269         * @since 2.8
       
   270         */
       
   271         void PushNaviPaneProgressBarL();
       
   272 
       
   273         /**
       
   274         * Push default navi pane on to navi pane stack.
       
   275         * @since 2.8
       
   276         */
       
   277         void PushDefaultNaviPaneL();
       
   278 
       
   279         /**
       
   280         * Call DisplayDeleteNoteL on the current view
       
   281         * @return whether the delete was performed
       
   282         * @since 2.8
       
   283         */
       
   284         TBool DisplayDeleteNoteL();
       
   285 
       
   286         /**
       
   287         * Enable or disable self-timer functionality
       
   288         * @since 2.8
       
   289         * @param aEnable The selftimer functionality to use
       
   290         */
       
   291         void SelfTimerEnableL( TCamSelfTimerFunctions aEnable );
       
   292 
       
   293         /**
       
   294         * Returns current self-timer state
       
   295         * @since 2.8
       
   296         * @return Returns whether or not Self Timer is currently enabled.
       
   297         */
       
   298         TBool SelfTimerEnabled() const;
       
   299 
       
   300         /**
       
   301         * Returns pointer to self-timer
       
   302         * @since 2.8
       
   303         * @return pointer to CCamSelfTimer object.
       
   304         */
       
   305         CCamSelfTimer* SelfTimer();
       
   306 
       
   307         /**
       
   308         * Registers an observer for changes in burst mode activation
       
   309         * @since 2.8
       
   310         * @param aBurstModeObserver the object observing burst mode changes
       
   311         */
       
   312         void AddBurstModeObserverL( MCamBurstModeObserver* aBurstModeObserver );
       
   313 
       
   314         /**
       
   315         * Removes an observer for changes in burst mode activation
       
   316         * @since 2.8
       
   317         * @param aBurstModeObserver the observer to remove
       
   318         */
       
   319         void RemoveBurstModeObserver( const MCamBurstModeObserver* aBurstModeObserver );
       
   320 
       
   321         /**
       
   322         * Returns whether or not burst capture mode is enabled.
       
   323         * Will return ETrue when burst mode is enabled for still capture
       
   324         * even if the application is currently in video capture mode
       
   325         * @since 2.8
       
   326         * @return ETrue if burst mode is enabled, else returns EFalse
       
   327         */
       
   328         TBool IsBurstEnabled() const;
       
   329 
       
   330         /*
       
   331         * Gets the handle to the controller, which is used inturn by the
       
   332         * plugin to call the interfaces for performing needed actions.
       
   333         */
       
   334         MCamAppController& AppController();
       
   335         
       
   336         /*
       
   337         * Gets the handle to the settings model, which is used inturn by the
       
   338         * plugin to call the interfaces for performing needed actions.
       
   339         */
       
   340         MCamStaticSettings& StaticSettingsModel();
       
   341         
       
   342         /**
       
   343         * Returns the currently enabled burst mode.
       
   344         * @since 3.0
       
   345         * @return the currently enable burst mode or ECamImageCaptureNone if 
       
   346         * burst is not enabled
       
   347         */
       
   348         TCamImageCaptureMode CurrentBurstMode() const;
       
   349 
       
   350         /**
       
   351         * Sets the current capture mode ( and target capture mode )
       
   352         * @since 2.8
       
   353         */
       
   354         void SetCaptureMode(
       
   355             TCamCameraMode aMode, 
       
   356             TCamImageCaptureMode aImageMode = ECamImageCaptureNone );
       
   357 
       
   358         /**
       
   359         * Changes the state of sequence capture
       
   360         * @since 3.0
       
   361         * @param aImageMode Single/Multi/Timelapse
       
   362         * @param aReprepare Whether or not the engine should be reprepared with sequence
       
   363         * settings (Do not reprepare if the engine is about to be deleted/released)
       
   364         * @param aUpdateUi  Whether or not to do Ui update related things. Those are not
       
   365         * needed/allowed if this method is called just to return sequence mode setting
       
   366         * to default value (single capture).
       
   367         */ 
       
   368         void SwitchStillCaptureModeL( TCamImageCaptureMode aImageMode, 
       
   369                                       TBool                aReprepare, 
       
   370                                       TBool                aUpdateUi = ETrue );
       
   371 
       
   372 
       
   373         /**
       
   374         * Returns whether or the secondary camera has been activated
       
   375         * Will return ETrue when when the second camera is active
       
   376         * @since 2.8
       
   377         * @return ETrue if second camera is active, else returns EFalse
       
   378         */
       
   379         TBool IsSecondCameraEnabled() const;
       
   380 
       
   381         /**
       
   382         * Secondary camera orientation is constructed according to this flag.
       
   383         * Flag can be forced to portrait/landscape or it can follow qwerty 
       
   384         * state. Variation is handled via KCamCr2ndCamOrientation CenRep key.
       
   385         * @param aLock, Lock orientation state flag. 
       
   386         *               ETrue, ask state and lock it.
       
   387         *               EFalse, ask current state.
       
   388         * @return ETrue if secondary camera orientation must be landscape
       
   389         */
       
   390         TBool IsQwerty2ndCamera( TBool aLock = EFalse );  
       
   391 
       
   392         /**
       
   393         * 
       
   394         * @return ETrue if wait dialog exist
       
   395         */
       
   396         TBool CCamAppUi::IsWaitDialog() const;
       
   397 
       
   398         /**
       
   399         * Returns the active camera
       
   400         * @since 2.8
       
   401         * @return either primary, secondary or none ( if in process of switching )
       
   402         */
       
   403         TCamActiveCamera ActiveCamera() const;
       
   404 
       
   405         /**
       
   406         * Called just prior to capture. Checks if there is sufficient memory
       
   407         * available for capture and handles out of memory/error conditions. 
       
   408         * @since 2.8
       
   409         * @return ETrue if there is memory available for capture
       
   410         */
       
   411         TBool CheckMemoryL();
       
   412 
       
   413         /**
       
   414         * Display error note - with OK softkey only
       
   415         * @since 2.8
       
   416         * @param aStatus error status
       
   417         */
       
   418         void ShowErrorNoteL( TCamMemoryStatus aStatus );
       
   419 
       
   420         /**
       
   421         * Display error note for OOM condition - OK and Cancel softkeys
       
   422         * @since 2.8
       
   423         * @param aLabel text to be shown
       
   424         * @param aWithCancel Enables cancel softkey; default=ETrue
       
   425         * @return Response code returned from Out of memory dialog
       
   426         */
       
   427         TInt ShowOOMNoteL( TDesC& aLabel, TBool aWithCancel = ETrue);
       
   428 
       
   429         /**
       
   430         * Set the requested resolution for a new file
       
   431         * @since 3.2
       
   432         * @param aRequestedResolution the requested resolution from the new file request.
       
   433         */
       
   434         void SetRequestedNewFileResolution( const TSize& aRequestedResolution );
       
   435 
       
   436         /**
       
   437         * Get the requested resolution for a new file
       
   438         * @since 3.2
       
   439         * @return the requested resolution from the new file request.
       
   440         *  Default is TSize(0,0) which interpreted as mms quality resolution
       
   441         */
       
   442         TSize RequestedNewFileResolution() const;
       
   443 
       
   444         /**
       
   445         * Shows the mmc removal note if it is required
       
   446         * @since 2.8
       
   447         */
       
   448         void ShowMMCRemovalNoteIfRequiredL();
       
   449 
       
   450         /**
       
   451         * Check memory card for available space and card status
       
   452         * @since 2.8
       
   453         * @param aFull on return contains ETrue if card is full
       
   454         * @param aStatus on return contains the card status
       
   455         * @param aCurrentLocation current storage location
       
   456         */
       
   457         void CheckMemoryCard( TBool& aFull,
       
   458                 TCamMemoryStatus& aStatus, TCamMediaStorage aCurrentLocation );
       
   459 
       
   460         /**
       
   461         * Checks if aStorage location is full
       
   462         * @since 2.8
       
   463         * @param aStorage target storage location
       
   464         * @param aCurrentLocation current storage location
       
   465         * @return ETrue if aStorage location is full
       
   466         */
       
   467         TBool MemoryFull( TCamMediaStorage aStorage, TCamMediaStorage aCurrentLocation );
       
   468 
       
   469         /**
       
   470         * Starts the video/photo capture
       
   471         * @since 2.8
       
   472         * @param aKeyEvent Key used to start the capture
       
   473         * @return whether the key was consumed by the function
       
   474         */
       
   475         TKeyResponse StartCaptureL( const TKeyEvent& aKeyEvent );
       
   476 
       
   477         /**
       
   478         * Stops the video capture
       
   479         * @since 2.8
       
   480         */
       
   481         void EndCapture();
       
   482         
       
   483         /**
       
   484         * Changes the orientation to aNewOrientation
       
   485         * If aNewOrientation is EAppUiOrientationUnspecified, switches
       
   486         * to the normal orientation (this may depend on the currently
       
   487         * activated camera)
       
   488         * @since 3.0
       
   489         */
       
   490         void SwitchOrientationIfRequiredL( TInt aNewOrientation );
       
   491 
       
   492         /**
       
   493         * Returns pointer to side-pane
       
   494         * @since 2.8
       
   495         * @return pointer to CCamSidePane object constructed by appUi
       
   496         */
       
   497         CCamSidePane* SidePane();
       
   498 
       
   499         /**
       
   500         * Returns pointer to zoom-pane
       
   501         * @since 2.8
       
   502         * @return pointer to CCamZoomPane object constructed by appUi
       
   503         */
       
   504         CCamZoomPane* ZoomPane();
       
   505 
       
   506         /**
       
   507         * Returns current camera orientation
       
   508         * @since 3.0
       
   509         * @return current camera orientation
       
   510         */
       
   511         TCamOrientation CamOrientation();
       
   512 
       
   513         /**
       
   514         * set current camera orientation as landscape
       
   515         */
       
   516         void SetCamOrientationToLandscape();
       
   517 	
       
   518         /**
       
   519         * Returns current viewstate
       
   520         * @since 3.0
       
   521         * @return current viewstate
       
   522         */
       
   523         TCamViewState CurrentViewState() const;
       
   524         
       
   525         /**
       
   526         * Returns target view state
       
   527         * @since 4.0
       
   528         * @return target view state
       
   529         */
       
   530         TCamViewState TargetViewState();
       
   531 
       
   532         /**
       
   533         * Returns the target mode of current mode switch
       
   534         * (Image/Video/Idle/Shutdown). The returned value
       
   535         * should equal to current state, if no switch is
       
   536         * in progress
       
   537         */        
       
   538         TCamCameraMode TargetMode() const;
       
   539 
       
   540         /**
       
   541         * Handles the shutter key press
       
   542         * @param aPressed ETrue if the shutter is pressed, EFalse if released
       
   543         * @since 2.8
       
   544         */
       
   545         void HandleShutterKeyL( TBool aPressed );    
       
   546         
       
   547         /**
       
   548         * Set embedding flag 
       
   549         * @param aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), 
       
   550         * EFalse if not
       
   551         * @since 2.8
       
   552         */
       
   553         void SetEmbedding( TBool aEmbedding );
       
   554         
       
   555         /**
       
   556         * Return embedding flag 
       
   557         * @return ETrue if we are embedding (ie Messaging, Realplayer), 
       
   558         * EFalse if not
       
   559         * @since 2.8
       
   560         */
       
   561         TBool Embedding() const;
       
   562         
       
   563         /**
       
   564         * Set SendAs flag 
       
   565         * @param aSendAsInProgress ETrue if SendAs in progress, EFalse if not
       
   566         * @since 2.8
       
   567         */
       
   568         void SetSendAsInProgressL( TBool aSendAsInProgress );
       
   569 
       
   570         /**
       
   571         * Get SendAs flag value 
       
   572         * @return ETrue if SendAs in progress, EFalse if not
       
   573         * @since 4.0
       
   574         */        
       
   575         virtual TBool SendAsInProgress() const;
       
   576         
       
   577         /**
       
   578         * Offers a pointer to appui's TextResolver instance
       
   579         * @return pointer to appui's TextResolver instance   
       
   580         */
       
   581         CTextResolver* TextResolver();
       
   582             
       
   583 #ifndef __WINSCW__
       
   584         /**
       
   585         * Get pointer to SFI utility class 
       
   586         * @since 3.0
       
   587         * @return pointer to CSFIUtilsAppInterface
       
   588         */
       
   589         //CSFIUtilsAppInterface* SFIUtility() const;
       
   590 
       
   591         /**
       
   592         * Return whether we are currently in-call send
       
   593         * @since 3.0
       
   594         * @return TBool true if we are in in-call send mode
       
   595         */
       
   596         //TBool IsInCallSend() const;
       
   597 
       
   598         /**
       
   599         * Send media file using SFI utility
       
   600         * @since 3.0
       
   601         */
       
   602         //void DoInCallSendL() const;
       
   603 #endif //WINSCW
       
   604 
       
   605         /**
       
   606         * Whether or not the application is in the background
       
   607         * @since 2.8
       
   608         * @param aIncludeNotifier If EFalse then the application is not
       
   609         * classed as being in the background if the foreground application is
       
   610         * a notifier, e.g. charging enabled.
       
   611         * @return ETrue if the application is in the background
       
   612         */   
       
   613         TBool AppInBackground( TBool aIncludeNotifier ) const;
       
   614         
       
   615         /**
       
   616         * Indicates whether or not the application is in a simulated exit situation
       
   617         * @return ETrue if the application has pretended to exit, else EFalse 
       
   618         */
       
   619         TBool IsInPretendExit() const;
       
   620 
       
   621         /**
       
   622         * Returns whether an MMC removed note is pending
       
   623         * @since 3.0
       
   624         * @return TBool ETrue if the UI needs to show an MMC 
       
   625         */
       
   626         TBool IsMMCRemovedNotePending() const;                  
       
   627 
       
   628         /**
       
   629         * Returns the pointer to the NaviCounter pane
       
   630         * @since 3.0
       
   631         * @return The Navi Counter pointer
       
   632         */
       
   633         CCamNaviCounterControl* NaviCounterControl();
       
   634         
       
   635         /**
       
   636         * Returns the pointer to the NaviProgress pane
       
   637         * @since 3.0
       
   638         * @return The Navi Progress pointer
       
   639         */
       
   640         CCamNaviProgressBarControl* NaviProgressBarControl();
       
   641 
       
   642         /**
       
   643         * Returns the pointer to the Navi Counter ModelProgress pane
       
   644         * @since 3.0
       
   645         * @return The Navi Counter Model pointer
       
   646         */
       
   647         CCamNaviCounterModel* NaviCounterModel();
       
   648 
       
   649         /**
       
   650         * Return handle to active palette if supported
       
   651         * @since 3.0
       
   652         * @return Handle to Active palette
       
   653         */             
       
   654         MActivePalette2UI* ActivePalette() const;
       
   655         
       
   656         /**
       
   657         * Get pointer to Active Palette handler instance.
       
   658         *
       
   659         * @return Pointer to Active Palette handler instance. Ownership not
       
   660         *         transferred.
       
   661         */
       
   662         CCamActivePaletteHandler* APHandler() const;
       
   663 
       
   664         /**
       
   665         * Tries to show or hide the Active Toolbar
       
   666         * @since 3.0
       
   667         * @param aShown True to show it, False to hide it
       
   668         */
       
   669         void SetActivePaletteVisibility( TBool aShown );
       
   670 
       
   671         /**
       
   672         * Returns whether the user has set the icons to always display in pre-capture
       
   673         * @since 3.0
       
   674         * @return ETrue if the optional icons should always be displayed
       
   675         */
       
   676         TBool AlwaysDrawPreCaptureCourtesyUI() const;
       
   677 
       
   678         /**
       
   679         * Returns whether the user has set the icons to always display in post-capture
       
   680         * @since 3.0
       
   681         * @return ETrue if the optional icons should always be displayed
       
   682         */
       
   683         TBool AlwaysDrawPostCaptureCourtesyUI() const;
       
   684 
       
   685         /**
       
   686         * Set whether the icons should always display in pre-capture
       
   687         * @since 3.0
       
   688         * @param aNewSetting True if they should always be drawn; False if they should only be drawn when the UI is raised
       
   689         */
       
   690         void  SetAlwaysDrawPreCaptureCourtesyUI( TBool aNewSetting );
       
   691 
       
   692         /**
       
   693         * Set whether the icons should always display in post-capture
       
   694         * @since 3.0
       
   695         * @param aNewSetting True if they should always be drawn; False if they should only be drawn when the UI is raised
       
   696         */
       
   697         void SetAlwaysDrawPostCaptureCourtesyUI( TBool aNewSetting );
       
   698 
       
   699         /**
       
   700         * Check whether a key event should cause the courtesy UI to be raised
       
   701         * @since 3.0
       
   702         * @param aKeyEvent The key event
       
   703         * @param aType The type of key event
       
   704         * @param aInPreCapture Whether the key was pressed in precapture mode
       
   705         * @return Whether the key was consumed or not
       
   706         */
       
   707         TKeyResponse CheckCourtesyKeyEventL( const TKeyEvent aKeyEvent, TEventCode aType, TBool aInPreCapture );
       
   708 
       
   709         /**
       
   710         * Whether to draw the complete UI in precapture mode
       
   711         * @since 3.0
       
   712         * @return True if it should all be drawn
       
   713         */
       
   714         TBool DrawPreCaptureCourtesyUI() const;
       
   715 
       
   716         /**
       
   717         * Whether to draw the complete UI in postcapture mode
       
   718         * @since 3.0
       
   719         * @return True if it should all be drawn
       
   720         */
       
   721         TBool DrawPostCaptureCourtesyUI() const;
       
   722 
       
   723         /**
       
   724         * Bring the complete UI to the fore in precapture
       
   725         * @param aShowZoomBar Briefly shows the zoombar first, if necessary
       
   726         * @since 3.0
       
   727         */
       
   728         void RaisePreCaptureCourtesyUI(TBool aShowZoomBar);
       
   729 
       
   730         /**
       
   731         * Bring the complete UI to the fore in postcapture
       
   732         * @since 3.0
       
   733         */
       
   734         void RaisePostCaptureCourtesyUI();
       
   735 
       
   736         /**
       
   737         * Hide the optional UI in precapture
       
   738         * @since 3.0
       
   739         */
       
   740         void SubmergePreCaptureCourtesyUI();
       
   741 
       
   742         /**
       
   743         * Hide the optional UI in postcapture
       
   744         * @since 3.0
       
   745         */
       
   746         void SubmergePostCaptureCourtesyUI();
       
   747 
       
   748         /**
       
   749         * Ensures the zoom pane gets shown and updated, specifically in direct viewfinder/active toolbar modes. Calling this method
       
   750         * is not sufficient to show the zoom pane however, other methods in CZoomPane must be called to achieve this.
       
   751         * @param aRedraw Whether to force a redraw event
       
   752         * @since 3.0
       
   753         */
       
   754         void ShowZoomPane( TBool aRedraw );
       
   755         
       
   756         /**
       
   757         * Ensures the zoom pane gets hidden, specifically in direct viewfinder/active toolbar modes. As above, not sufficient to 
       
   758         * hide the zoom pane.
       
   759         * @param aRedraw Whether to force a redraw event
       
   760         * @since 3.0
       
   761         */
       
   762         void HideZoomPane( TBool aRedraw );
       
   763 
       
   764         /**
       
   765         * Refreshes the CBA based on current view and app state
       
   766         * @since 2.8
       
   767         */       
       
   768         void UpdateCba();
       
   769 
       
   770         /**
       
   771         * Sets the softkeys to the specified Resource ID
       
   772         * @since 3.0
       
   773         * @param aResource ID of the softkey resource to use
       
   774         */
       
   775         void SetSoftKeysL( TInt aResource );
       
   776         
       
   777         /**
       
   778         * Returns whether the time lapse slider is shown
       
   779         * @since 3.0
       
   780         * @return ETrue if time lapse slider is shown
       
   781         */
       
   782         TBool TimeLapseSliderShown() const;
       
   783 
       
   784         /**
       
   785         * Detects whether the direct viewfinder is in use or not
       
   786         * @since 3.0
       
   787         * @return True if it is active, otherwise false
       
   788         */
       
   789         TBool IsDirectViewfinderActive();
       
   790 
       
   791         /**
       
   792         * Let the AppUi know what is being shown in pre-capture
       
   793         * @param aMode What's being shown
       
   794         */
       
   795         void SetPreCaptureModeL(TCamPreCaptureMode aMode);  
       
   796 
       
   797         /**
       
   798          * Let the AppUi know what is being shown in pre-capture
       
   799          * @param aMode What's being shown
       
   800          */
       
   801         void SetPreCaptureMode(TCamPreCaptureMode aMode);
       
   802         
       
   803         /**
       
   804         * Whether or not the telephone application is in the foreground
       
   805         * @since 3.0
       
   806         * @return ETrue if the telephone application is in the foreground
       
   807         */    
       
   808         TBool ForegroundAppIsPhoneApp() const;
       
   809 
       
   810         /**
       
   811         * Whether to show the post capture view in current mode
       
   812         * @return ETrue iff we should show the post capture view in current mode
       
   813         */    
       
   814         TBool ShowPostCaptureView() const;
       
   815 
       
   816         /**
       
   817          * Whether the automatic UI-rise should be suppressed on next viewfinder start event
       
   818          * e.g. when postcapture is set to off, the UI is off and a photo is taken
       
   819          * @return Whether the automatic UI-rise should be suppressed
       
   820          */
       
   821         TBool SuppressUIRiseOnViewfinderStart() const;
       
   822 
       
   823         /**
       
   824          * Set whether the automatic UI-rise should be suppressed on next viewfinder start event
       
   825          * @see SuppressUIRiseOnViewfinderStart
       
   826          * @param aSuppress Whether the automatic UI-rise should be suppressed
       
   827          */
       
   828         void SetSuppressUIRiseOnViewfinderStart(TBool aSuppress);
       
   829         
       
   830         /**
       
   831         * Whether the current capture was selftimer initiated
       
   832         * @return ETrue if the current capture was started via selftimer
       
   833         */
       
   834         TBool IsSelfTimedCapture() const;
       
   835 
       
   836 
       
   837         /**
       
   838          * Set the 'freeing memory' flag.
       
   839          *
       
   840          * @param aFreeingMemory New value for the 'freeing memory' flag.
       
   841          */
       
   842         void SetFreeingMemory( TBool aFreeingMemory );
       
   843         
       
   844         /**
       
   845          * Get the current state of the 'freeing memory' flag.
       
   846          *
       
   847          * @return Current value for the 'freeing memory' flag.
       
   848          */
       
   849         TBool IsFreeingMemory() const;
       
   850 
       
   851         
       
   852         /**
       
   853         * Checks whether its safe to draw controls
       
   854         * @return ETrue if its safe to draw the controls 
       
   855         */
       
   856         TBool ReadyToDraw() const;
       
   857         
       
   858         /**
       
   859         * Set toolbar visibility in according to whether current view and mode are fit.
       
   860         */
       
   861         void SetToolbarVisibility();
       
   862 
       
   863         /**
       
   864         * Hide the toolbar.
       
   865         */
       
   866         void SubmergeToolbar(); 
       
   867  
       
   868     public: // Functions from base classes
       
   869         /**
       
   870         * Draw the counter to the bitmap used in the navi pane
       
   871         * @since 3.0
       
   872         * @param aBmpGc The graphics context for the bitmap
       
   873         * @param aBmpMaskGc The graphics context for the bitmap mask
       
   874         */
       
   875         void CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter );
       
   876 	    
       
   877         /**
       
   878         * From CAknAppUi Handle user menu selections
       
   879         * @since 2.8
       
   880         * @param aCommand The enumerated code for the option selected
       
   881         */
       
   882         void HandleCommandL( TInt aCommand );
       
   883 
       
   884         /**
       
   885         * From MCamControllerObserver
       
   886         * @since 2.8
       
   887         * @param aEvent The enumerated code for the event received
       
   888         * @param aError The error code associated with the event
       
   889         */
       
   890         void HandleControllerEventL( TCamControllerEvent aEvent,
       
   891                                             TInt aError );
       
   892 
       
   893         /**
       
   894         * Return whether we are in embedded mode (if we have a pointer to a
       
   895         * MApaEmbeddedDocObserver).
       
   896         * @since 2.8
       
   897         * @return TBool if tthere is a handle to MApaEmbeddedDocObserver
       
   898         */
       
   899         TBool IsEmbedded() const;
       
   900 
       
   901         /**
       
   902         * Handle window server event.
       
   903         * @since 2.8
       
   904         * @param aEvent the window server event
       
   905         * @param aDestination the control associated with the event. 
       
   906         * Only valid for pointer events.
       
   907         */
       
   908         void HandleWsEventL( const TWsEvent& aEvent,
       
   909                              CCoeControl* aDestination );
       
   910                              
       
   911                              
       
   912         /**
       
   913         * Start application as file server application
       
   914         * @since 3.0
       
   915         * @param aEmbeddedObserver service observer
       
   916         * @param aMode Service type (image or video)
       
   917         */
       
   918         void StartAsServerAppL( MCamEmbeddedObserver *aEmbeddedObserver, 
       
   919         	               TInt aMode );
       
   920 
       
   921         /**
       
   922         * Closes the application
       
   923         * @since 2.8
       
   924         */
       
   925         void CloseAppL(); 
       
   926         
       
   927         /**
       
   928         * Closes the application
       
   929         * @since 2.8
       
   930         * Exits the application according to current state, if the app always
       
   931         * running flag is set, the application goes to the background but if 
       
   932         * embedded, or app always running flag is not set or in an error situation 
       
   933         * the application truly exits
       
   934         */
       
   935         void InternalExitL();
       
   936 
       
   937         /**
       
   938         * Inform the controller of the count of images required at the next
       
   939         * capture. Called before every still capture request.
       
   940         * @since 2.8
       
   941         */
       
   942         void InitCaptureCountL();
       
   943 
       
   944         /**
       
   945 		* From MCamVolumeKeyObserver - pick up volume key events
       
   946 		* @since 3.1
       
   947 		* @param aOperationId - operation id (i.e. volume key up/down)
       
   948 		* @param aButtonAct bitton action press/click/release
       
   949 		*/
       
   950 		void HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId,
       
   951                             	   TRemConCoreApiButtonAction aButtonAct);
       
   952                           			
       
   953         /**
       
   954         * Handle an event from CCamSelfTimer.   
       
   955         * @since S60 v5.0
       
   956         * @param aEvent the self timer event
       
   957         * @param aCountDown self timer countdown duration
       
   958         */
       
   959         void HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, 
       
   960                                    TInt aCountDown );
       
   961 
       
   962   
       
   963     public: // new fuctions
       
   964 
       
   965         /**
       
   966         * We handle the case when settings plugin exists
       
   967         **/
       
   968         void SettingsPluginExitedL( TCamSettingsPluginExitMessage aType ); 
       
   969 
       
   970         /**
       
   971         * We keep track of lauching settings plugin within camera
       
   972         * to control the behaviour of the camera when the plugin exists and
       
   973         * returns to camera
       
   974         **/
       
   975         TBool SettingsLaunchedFromCamera() const;
       
   976         
       
   977         /**
       
   978         * Checks if the memory type is full or unavailable
       
   979         * @param aStorage TCamMediaStorage enum specifying the memory type; 
       
   980         *	default=ECamMediaStorageCurrent
       
   981         * @return ETrue if the specified memory is full or unavailable
       
   982         **/
       
   983         TBool 
       
   984         IsMemoryFullOrUnavailable(const TCamMediaStorage 
       
   985         						  aStorage = ECamMediaStorageCurrent) const;
       
   986         
       
   987         /**
       
   988         * Checks if all memories are full and unavailable
       
   989         * @return ETrue if all memories are full or unavailable
       
   990         **/
       
   991         TBool AllMemoriesFullOrUnavailable() const;
       
   992 
       
   993             
       
   994     private: // New functions
       
   995 
       
   996       /**
       
   997       * Helper method to handle controller event for
       
   998       * going to standby mode.
       
   999       */
       
  1000       void HandleStandbyEventL( TInt aStatus );
       
  1001             
       
  1002       /**
       
  1003       * Notify our views of application level events, like focus gained/lost.
       
  1004       */
       
  1005       void NotifyViews( const TCamAppEvent& aEvent );
       
  1006 
       
  1007 
       
  1008         /**
       
  1009         * Construct views
       
  1010         * Construct pre capture views        
       
  1011         * @since 2.8
       
  1012         */
       
  1013         void ConstructPreCaptureViewsL();
       
  1014 
       
  1015         /**
       
  1016         * Construct post capture views
       
  1017         * @since 2.8
       
  1018         */
       
  1019         void ConstructPostCaptureViewsL();
       
  1020 
       
  1021         /**
       
  1022         * Construct settings, user scene setup, and postcapture views 
       
  1023         * @since 2.8
       
  1024         */
       
  1025         void ConstructViewIfRequiredL();
       
  1026 
       
  1027         /**
       
  1028         * Construct navi pane
       
  1029         * @since 2.8
       
  1030         */
       
  1031         void ConstructNaviPaneL();
       
  1032 
       
  1033         /**
       
  1034         * Switch to pre-capture view
       
  1035         * @since 2.8
       
  1036         * @return TInt to indicate if function should be called again
       
  1037         */
       
  1038         TInt DoPostCaptureTimeoutL();
       
  1039 
       
  1040         /**
       
  1041         * Try to switch active view.
       
  1042         * @since 2.8
       
  1043         */
       
  1044         void TrySwitchViewL( TBool aDeactivateFirst = EFalse );
       
  1045 
       
  1046         /**
       
  1047         * Determines if a switch of the active view required.
       
  1048         * @param aDeactivateFirst Deactivate before check
       
  1049         * @since 2.8
       
  1050         */
       
  1051         TCamViewSwitch ViewSwitchRequired( TBool aDeactivateFirst = EFalse ) const;
       
  1052 
       
  1053         /**
       
  1054         * Get uid of view with requested view and mode.
       
  1055         * @since 2.8
       
  1056         * @param aState      View state
       
  1057         * @param aMode       Main camera mode (image/video)
       
  1058         * @param aImageMode  In image mode, image capture type (single/burst/timelapse)
       
  1059         * @param aUid        Uid of view passed by reference and populated in function
       
  1060         * @param aMessageUid A message Uid to pass to the view
       
  1061         * @return            Whether or not a valid view uid can be obtained
       
  1062         */
       
  1063         TBool ViewId( TCamViewState        aState, 
       
  1064                              TCamCameraMode       aMode, 
       
  1065                              TCamImageCaptureMode aImageMode, 
       
  1066                              TUid&                aUid, 
       
  1067                              TUid&                aMessageUid,
       
  1068                              TBool                aDeactivateFirst );
       
  1069 
       
  1070         /**
       
  1071         * Return a pointer to the navi pane.
       
  1072         * @since 2.8
       
  1073         * @return pointer to the status pane's navigation control container
       
  1074         */
       
  1075         CAknNavigationControlContainer* NaviPaneL();
       
  1076 
       
  1077         /**
       
  1078         * Display the wait dialog when saving video
       
  1079         * @since 2.8
       
  1080         */
       
  1081         void DisplayWaitDialogL();
       
  1082 
       
  1083         /**
       
  1084         * Get the default startup mode from settings
       
  1085         * If this is not defined the factory default will be used
       
  1086         * @since 2.8
       
  1087         * @return The default startup capture mode
       
  1088         */
       
  1089         TCamStartupMode StartupMode() const;
       
  1090     
       
  1091         /**
       
  1092         * Save the current capture mode to settings.
       
  1093         * This will be used as the startup mode
       
  1094         * @since 2.8
       
  1095         */
       
  1096         void SaveCaptureMode();
       
  1097         
       
  1098         /**
       
  1099         * Save the current state of the UI to settings.
       
  1100         * 
       
  1101         */
       
  1102         
       
  1103         void SaveCourtesyUiState();
       
  1104 
       
  1105         /**
       
  1106         * Override HandleScreenDeviceChangedL() and trigger a re-layout
       
  1107 		* of the main controls from this - addition for 2.8
       
  1108         * @since 2.8
       
  1109         */
       
  1110         void HandleScreenDeviceChangedL();
       
  1111 
       
  1112         /**
       
  1113         * Called when the video is ready to be stopped
       
  1114         * @since 2.8
       
  1115         * @param aPtr pointer to the object that called the timer
       
  1116         * @return Error code
       
  1117         */
       
  1118         static TInt StopVideoRecording( TAny* aPtr );
       
  1119 
       
  1120         /**
       
  1121         * Called when the application is ready to exit
       
  1122         * @since 2.8
       
  1123         * @param aAny pointer to the object that called the timer
       
  1124         * @return Error code
       
  1125         */
       
  1126         static TInt CallExit( TAny* aAny );
       
  1127 
       
  1128         /**
       
  1129         * Callback used when the application needs to switch view
       
  1130         * @since 2.8
       
  1131         * @param aAny pointer to the object that called the timer
       
  1132         * @return Error code
       
  1133         */
       
  1134         static TInt CallSwitch( TAny* aAny );
       
  1135 
       
  1136         /**
       
  1137         * Launch the context sensitive help application
       
  1138         * @since 2.8
       
  1139         */  
       
  1140         void LaunchHelpL();
       
  1141 
       
  1142         /**
       
  1143         * Returns the AppUi orientation (e.g. Portrait or Landscape) for the given product-specific orientation
       
  1144         * @since 3.0
       
  1145         * @param aCamOrientation The product-specific orientation
       
  1146         * @return The AppUi orientation (e.g. Portrait or Landscape)
       
  1147         */
       
  1148         TAppUiOrientation AppUiOrientation( TCamOrientation aCamOrientation );
       
  1149 
       
  1150         /**
       
  1151         * Returns the camera orientation based on the layout state set by the phone
       
  1152         * @since 3.0
       
  1153         * @param aLayoutState The layout state set by the phone
       
  1154         * @return The camera orientation
       
  1155         */
       
  1156         TCamOrientation LayoutStateToOrientation( TInt aLayoutState );
       
  1157 
       
  1158         /**
       
  1159         * Returns the camera orientation based on the layout state set by the phone
       
  1160         * @since 3.0
       
  1161         * @return The camera orientation based on the layout state set by the phone
       
  1162         */
       
  1163         TCamOrientation ReadCurrentDeviceOrientation();
       
  1164 
       
  1165         /**
       
  1166          * Returns whether or not the full screen viewfinder is being shown
       
  1167          * @return Whether or not the full screen viewfinder is being shown 
       
  1168          */
       
  1169         TBool FullScreenViewfinderEnabled() const;
       
  1170         
       
  1171         /**
       
  1172         * Construct a postcapture view if not already constructed
       
  1173         *
       
  1174         * The following parameter combinations can be used:
       
  1175         * Still postcapture view: sViewState = ECamViewStatePostCapture, aMode = ECamControllerImage
       
  1176         * Burst thumbnail view:   aViewState = ECamViewStateBurstThumbnail
       
  1177         * Video Postcapture view: aViewState = ECamViewStatePostCapture, aMode = ECamControllerVideo
       
  1178         *
       
  1179         * @param aViewState
       
  1180         * @param aCaptureMode
       
  1181         * @since 2.8
       
  1182         */
       
  1183         void ConstructPostCaptureViewIfRequiredL( TCamViewState aViewState,
       
  1184                                                   TCamCameraMode aMode );
       
  1185         
       
  1186         /*
       
  1187         * Initiate the check operation using collection manager
       
  1188         */
       
  1189         /**
       
  1190          * We start check operation to see if "Default Album exists"
       
  1191          * Usecase: Whenever the camera returns from background/startup we
       
  1192          * first start checking the default album which is set, if any, to make
       
  1193          * sure that album really exists. If not, then we set back the value
       
  1194          * of setting item "Add to album" to "No" in Image/Video setting
       
  1195          * image settings
       
  1196          */
       
  1197         void StartCheckingDefaultAlbumIdL();
       
  1198 
       
  1199                                                   
       
  1200 #ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION                                                  
       
  1201                                                 
       
  1202         /**
       
  1203         * Starts calls to PostCapIdleCallBack during processor idle time. The calls
       
  1204         * are continued until PostCapIdleCallBack is done.
       
  1205         * @since 3.1
       
  1206         */
       
  1207         void StartPostCapIdleL();
       
  1208         
       
  1209         /**
       
  1210         * Handles postcapture view construction so that each call to this function
       
  1211         * constructs one postcapture view. Returns ETrue if there are still more views
       
  1212         * to construct, EFalse if all are finished and no further calls are required.
       
  1213         *
       
  1214         * @param aSelf pointer to current CCamAppUi object
       
  1215         * @return construction status
       
  1216         * @since 3.1
       
  1217         */
       
  1218         static TInt PostCapIdleCallBack( TAny* aSelf );        
       
  1219 
       
  1220 #endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION        
       
  1221 
       
  1222         
       
  1223         /**
       
  1224         * Initiates a call to SensorIdleCallback during processor idle time
       
  1225         * @since 3.1
       
  1226         */        
       
  1227         void StartSensorIdleL();
       
  1228         
       
  1229         /**
       
  1230         * Cancels the (possibly) pending call to SensorIdleCallBack
       
  1231         * @since 3.1
       
  1232         */        
       
  1233         void CancelSensorIdle();                
       
  1234                                 
       
  1235         /**
       
  1236         * Initializes the sensor API by calling iController.UpdateSensorApiL()
       
  1237         *        
       
  1238         * @param aSelf pointer to current CCamAppUi object
       
  1239         * @return construction status
       
  1240         * @since 3.1
       
  1241         */
       
  1242         static TInt SensorIdleCallBack( TAny* aSelf );        
       
  1243         
       
  1244 
       
  1245     private: // Functions from base classes
       
  1246 
       
  1247 #ifndef __WINSCW__
       
  1248         /**
       
  1249         * From CEikAppUi.
       
  1250         * Processes shell commands.
       
  1251         * @since 3.0
       
  1252         * @param aCommand The command line command
       
  1253         * @param aDocumentName The name of the document to open
       
  1254         * @param aTail Not used.
       
  1255         * @return TBool
       
  1256         */
       
  1257         TBool ProcessCommandParametersL( TApaCommand aCommand,
       
  1258                                          TFileName& aDocumentName,
       
  1259                                          const TDesC8& aTail );
       
  1260         /**
       
  1261         * From CEikAppUi.
       
  1262         * Handle the external message.
       
  1263         * @since 3.0
       
  1264         * @param aClientHandleOfTargetWindowGroup Handle.
       
  1265         * @param aMessageUid Message id.
       
  1266         * @param aMessageParameters Message parameters.
       
  1267         * @return Response to the message.
       
  1268         */
       
  1269         MCoeMessageObserver::TMessageResponse HandleMessageL(
       
  1270             TUint32 aClientHandleOfTargetWindowGroup,
       
  1271             TUid aMessageUid,
       
  1272             const TDesC8& aMessageParameters );
       
  1273             
       
  1274 #endif //WINSCW            
       
  1275             
       
  1276     private: // new functions
       
  1277 
       
  1278 #ifndef __WINSCW__        
       
  1279         /**
       
  1280         * Bring the Phone application back to foreground after in-call send completion
       
  1281         * @since 3.0
       
  1282         */
       
  1283         void BringPhoneAppToForeGroundL();
       
  1284 #endif //WINSCW
       
  1285 
       
  1286         /**
       
  1287         * Sends the camera application to the background, to pretend we're closing
       
  1288         * @since 2.8
       
  1289         */
       
  1290         void SendCameraAppToBackgroundL();
       
  1291 
       
  1292         /**
       
  1293         * Hides the application from task list, to pretend that camera app is closed
       
  1294         * @since 3.0 (added back since its useful in certain situation)
       
  1295         * @param aHide whether to hide or make visible
       
  1296         */
       
  1297         void HideTaskL(TBool aHide);
       
  1298 
       
  1299     public:
       
  1300         /**
       
  1301         * Display error note
       
  1302         * @since 2.8
       
  1303         * @param aError The error code
       
  1304         */ 
       
  1305         void HandleCameraErrorL( TInt aError );
       
  1306         
       
  1307         
       
  1308         /**
       
  1309         * Set iAssumePostCaptureView flag
       
  1310         * @param aValue ETrue sets flag on, EFalse off
       
  1311         */ 
       
  1312         void SetAssumePostCaptureView( TBool aValue );
       
  1313         
       
  1314         /**
       
  1315          * Set iLensCoverExit flag
       
  1316          * @param aValue ETrue sets flag on, EFalse off
       
  1317          */
       
  1318         void SetLensCoverExit( TBool aValue );
       
  1319 		
       
  1320 		/** 
       
  1321         * Set iDrawPreCaptureCourtesyUI flag 
       
  1322         * @param aValue ETrue sets flag on, EFalse off 
       
  1323         */        
       
  1324         void SetDrawPreCaptureCourtesyUI(TBool iDraw); 
       
  1325 		
       
  1326          /**
       
  1327         * Finishes the AppUI construction by calling 
       
  1328         * CompleteAppUIConstructionL
       
  1329         */ 
       
  1330         static TInt AppUIConstructCallbackL( TAny* aAny );
       
  1331         
       
  1332         /**
       
  1333         * returns ETrue if appUi construction is complete
       
  1334         */ 
       
  1335         TBool IsUiConstructionComplete();
       
  1336         
       
  1337         /**
       
  1338 		* set whether camera viewfinder stop or not
       
  1339 		* @param aViewFinderStopped ETrue viewfinder is stoped,EFalse viewfinder is runing
       
  1340 		* 
       
  1341 		*/ 
       
  1342 		void SetViewFinderStoppedStatus(TBool aViewFinderStopped);
       
  1343 		
       
  1344         /**
       
  1345         * Getter for iViewFinderInTransit 
       
  1346         * @return ETrue if viewfinder handle is in transit between different windows
       
  1347         */ 
       
  1348 		TBool IsViewFinderInTransit();
       
  1349 		
       
  1350 		/**
       
  1351         * Setter for iViewFinderInTransit
       
  1352         * @param aInTransit Set to ETrue if viewfinder window handle is in transit 
       
  1353         * @return void
       
  1354         */
       
  1355 		void SetViewFinderInTransit(TBool aInTransit);
       
  1356 		
       
  1357      public: //MCamAddToAlbumObserver
       
  1358 
       
  1359 
       
  1360         /*
       
  1361         * From MCamAddToAlbumObserver
       
  1362         * Notification once the aysnchronous operations using
       
  1363         * CollectionManager interface are done completly
       
  1364         * Status of the operation are returned using aStatus
       
  1365         * e.g. KErrNone
       
  1366         */
       
  1367         void AddToAlbumIdOperationComplete() {};
       
  1368         
       
  1369         /**
       
  1370         * From MCamAddToAlbumObserver
       
  1371         * Notification once the asynchronous operations using
       
  1372         * CollectionManager interface have completed.
       
  1373         *
       
  1374         * @param aAlbumExists ETrue if album exists
       
  1375         * @param aAlbumTitle  Title of the album
       
  1376         */
       
  1377         void CheckAlbumIdOperationCompleteL(
       
  1378                 TBool aAlbumExists, const TDesC& aAlbumTitle );
       
  1379 
       
  1380 
       
  1381     private:
       
  1382 
       
  1383         /**
       
  1384         * Called when the courtesy timer ends
       
  1385         * @since 3.0
       
  1386         * @param aPtr The CCamAppUI object the timer has completed on
       
  1387         */ 
       
  1388         static TInt CourtesyTimeout( TAny* aPtr );
       
  1389 
       
  1390         /**
       
  1391         * Called when the courtesy timer ends
       
  1392         * @since 3.0
       
  1393         */ 
       
  1394         TInt DoCourtesyTimeout();
       
  1395 
       
  1396         /**
       
  1397         * Called to set the correct navicounter / naviprogress controls to "active"
       
  1398         * @since 3.0
       
  1399         */ 
       
  1400         void UpdateNaviModelsL( TBool aUpdateNavi = ETrue );
       
  1401                 
       
  1402 
       
  1403         /**
       
  1404         /**
       
  1405         * Dismisses out of memory / memory card removed note, if active.
       
  1406         */
       
  1407         void DismissMemoryNoteL();  
       
  1408         
       
  1409 		/**
       
  1410 		* Register to capture half and full shutter press key events
       
  1411 		* @since 3.0
       
  1412 		*/
       
  1413 		void RegisterCaptureKeysL();
       
  1414 		
       
  1415 		/**
       
  1416 		* Release capture of half and full shutter press key events
       
  1417 		* @since 3.0
       
  1418 		*/
       
  1419 		void UnRegisterCaptureKeys();  
       
  1420 
       
  1421     /**
       
  1422     * Select the setting for viewfinder grid.
       
  1423     */
       
  1424     void SelectViewFinderGridSettingL();
       
  1425 
       
  1426     /**
       
  1427     * Starts the Photos application command line
       
  1428     **/
       
  1429     void StartAppCmdLineL( const TDes8& aData );
       
  1430 
       
  1431     /**
       
  1432     * Check if it's applicable to use the courtesy UI
       
  1433     * @since S60 v5.0
       
  1434     * @return ETrue if courtesy UI can be used
       
  1435     */
       
  1436     TBool CourtesyUiApplies() const;
       
  1437     
       
  1438     /**
       
  1439     * Finish the AppUI construction
       
  1440     **/
       
  1441     void CompleteAppUIConstructionL();
       
  1442     
       
  1443   // =======================================================
       
  1444   // Data
       
  1445   private:    
       
  1446     
       
  1447         CCamAppController& iController;
       
  1448 
       
  1449         TCamSelfTimerFunctions iInSelfTimerMode;
       
  1450         
       
  1451         // Own
       
  1452         CCamSelfTimer* iSelfTimer;
       
  1453 
       
  1454         // Not own.
       
  1455         CCamNaviCounterControl* iNaviPaneCounterControl;
       
  1456 
       
  1457         // Not own.
       
  1458         CCamNaviProgressBarControl* iNaviPaneProgressBarControl;
       
  1459 
       
  1460         // Own.
       
  1461         CAknNavigationDecorator* iDecoratedNaviPaneCounter;
       
  1462 
       
  1463         // Own.
       
  1464         CAknNavigationDecorator* iDecoratedNaviPaneProgressBar;
       
  1465 
       
  1466 
       
  1467         // NOT owned; this pointer is just for checking 
       
  1468         // if the wait dialog object still exists, or
       
  1469         // whether it has deleted itself
       
  1470         CCamWaitDialog* iWaitDialog;
       
  1471 
       
  1472         // Not own.
       
  1473         CCamStillPreCaptureView* iStillCaptureView;
       
  1474 
       
  1475         // Not own.
       
  1476         CCamVideoPreCaptureView* iVideoCaptureView;
       
  1477 
       
  1478         // Not own.
       
  1479         CAknView*   iViaPlayerView;
       
  1480 
       
  1481         TCamViewState iViewState;
       
  1482         TCamViewState iTargetViewState;
       
  1483         TCamCameraMode iMode;
       
  1484         TCamCameraMode iTargetMode;
       
  1485 
       
  1486         TCamImageCaptureMode iImageMode;
       
  1487         TCamImageCaptureMode iTargetImageMode;
       
  1488         TInt                  iStandbyStatus;
       
  1489 
       
  1490         TBool iKeyShutter;
       
  1491 
       
  1492         // Used to determine whether or not the startup view has been
       
  1493         // set when app is launched embedded  
       
  1494         TBool iEmbeddedViewSet;
       
  1495 
       
  1496         // Name of parent app if we're embedded
       
  1497         // Own.
       
  1498         HBufC*  iParentAppName;
       
  1499 
       
  1500         // Whether or not the cba has been blanked
       
  1501         TBool iCbaIsDisabled;
       
  1502 
       
  1503         // Whether or not the burst mode has been activated
       
  1504         TBool iBurstModeEnabled;
       
  1505 
       
  1506         // Observer that needs to know when burst mode is switched on/off
       
  1507         // Observer objects are not owned.
       
  1508         RPointerArray<MCamBurstModeObserver> iBurstModeObservers;
       
  1509 
       
  1510         // handle of the camera key captured
       
  1511         TInt iCameraKeyHandle;
       
  1512 
       
  1513         // timer to assist with displaying wait dialog
       
  1514         // Own.
       
  1515         CPeriodic* iWaitTimer;
       
  1516 
       
  1517         // Whether or not the wait timer should be used
       
  1518         TBool iApplyTimer;
       
  1519 
       
  1520         // Used for opening (and playing) video clips
       
  1521         // Own.
       
  1522         CDocumentHandler* iDocHandler;
       
  1523 
       
  1524         // the id of the application's window group
       
  1525         TInt iMyWgId;
       
  1526 
       
  1527         // the id of the eikon server window group
       
  1528         TInt iEikonServerWindowGroupId;
       
  1529 
       
  1530         // Whether or not a view switch is pending, used to delay switch to
       
  1531         // post capture view when the application is in the background
       
  1532         TPendingViewSwitchType iPendingViewSwitch;
       
  1533 
       
  1534         // Keeps track of the state before focus gained events
       
  1535         TBool iReturnFromBackground;
       
  1536 
       
  1537         // Side-pane handler
       
  1538         // Own.
       
  1539         CCamSidePane* iCamSidePane;
       
  1540         
       
  1541         // Zoom-pane handler
       
  1542         // Own.
       
  1543         CCamZoomPane* iCamZoomPane;
       
  1544 
       
  1545         // Used to access settings
       
  1546         // Own.
       
  1547         CRepository* iRepository;        
       
  1548 
       
  1549         // Flag to indicate when video recording has stopped due to incoming call
       
  1550         // Post capture timer is not started when this flag is set, delays the
       
  1551         // timeout of the video post capture view
       
  1552         TBool iDelayVideoPostCaptureTimeout;
       
  1553                 
       
  1554         // Indicates if the mmc was detected as removed at startup, requiring
       
  1555         // the user to be informed
       
  1556         TBool iMMCRemoveNoteRequired;
       
  1557         
       
  1558         // Indicates if the mmc was detected as removed whilst we were in focus,
       
  1559         // requiring us to inform the user when capture is attempted.
       
  1560         TBool iMMCRemoveNoteRequiredOnCapture;     
       
  1561 
       
  1562         // Only the precapture views are created on construction
       
  1563         // These flags indicate whether or not the other views have been created
       
  1564         TBool iPostCaptureViewsConstructed;
       
  1565         TBool iUserSceneSetupViewConstructed;
       
  1566         TBool iCustomiseToolbarViewConstructed;
       
  1567 
       
  1568         // Used to resolve error message texts
       
  1569         // Own.
       
  1570         CTextResolver* iTextResolver;    
       
  1571 
       
  1572 //#ifndef __WINS__
       
  1573         // in-call send utility class
       
  1574         // Own.
       
  1575         //CSFIUtilsAppInterface* iSFIUtils;
       
  1576 
       
  1577         // Whether in in-call send mode
       
  1578         //TBool iSendFileInCall;
       
  1579 //#endif              
       
  1580 
       
  1581         // embedded observer
       
  1582         // Not own.
       
  1583         MCamEmbeddedObserver* iEmbeddedObserver;
       
  1584 
       
  1585         // embedded start up capture mode
       
  1586         TInt iApplicationMode;
       
  1587 
       
  1588         // Pointer to the only navicounter model
       
  1589         // Own.
       
  1590         CCamNaviCounterModel* iNaviCounterModel;
       
  1591 
       
  1592         //Pointer to the only naviprogressbar model
       
  1593         // Own.
       
  1594         CCamNaviProgressBarModel* iNaviProgressBarModel;
       
  1595 
       
  1596         // Pointer to the NaviCounter control
       
  1597         // Own.
       
  1598         CCamNaviCounterControl* iNaviCounterControl;
       
  1599 
       
  1600         // Pointer to the NaviProgress control
       
  1601         // Own.
       
  1602         CCamNaviProgressBarControl* iNaviProgressBarControl;
       
  1603 
       
  1604         TCamOrientation iCamOrientation;
       
  1605 
       
  1606         // Keeps a list of MCamResourceLoaders that this class owns
       
  1607         RPointerArray<MCamResourceLoader> iResourceLoaders;
       
  1608 
       
  1609         // Own.
       
  1610         CCamActivePaletteHandler* iActivePaletteHandler;
       
  1611 
       
  1612         // Maximum no if images in burst capture
       
  1613         TInt iMaxBurstCaptureNum;
       
  1614 
       
  1615         // Whether the Coutesy UI should currently be displayed (precapture)
       
  1616         TBool iDrawPreCaptureCourtesyUI;
       
  1617         // Whether the user has set the UI to always be on (precapture)
       
  1618         TBool iAlwaysDrawPreCaptureCourtesyUI;
       
  1619 
       
  1620         // Whether the Coutesy UI should currently be displayed (postcapture)
       
  1621         TBool iDrawPostCaptureCourtesyUI;
       
  1622         // Whether the user has set the UI to always be on (postcapture)
       
  1623         TBool iAlwaysDrawPostCaptureCourtesyUI;
       
  1624 
       
  1625         // The courtesy timer: when this ends, the UI should be hidden if applicable
       
  1626         // Own.
       
  1627         CCamTimer* iCourtesyTimer;
       
  1628 
       
  1629         // Whether the timer was started in precapture mode or not
       
  1630         TBool iCourtesyTimerInPreCapture;
       
  1631 
       
  1632         // True if the zoom pane is currently being shown, False if not
       
  1633         TBool iZoomPaneShown;
       
  1634 
       
  1635         // True when application is started  
       
  1636         TBool iFirstBoot;
       
  1637         
       
  1638         // Flag to show if a screen redraw event is being processed
       
  1639         TBool iProcessingScreenRedraw;
       
  1640         
       
  1641         // Whether the active palette should be prevented from being shown:
       
  1642         // used during saving of an image/video
       
  1643         TBool iPreventActivePaletteDisplay;
       
  1644         
       
  1645         // Used to delay engine creation on app startup or camera switch
       
  1646         // if the orientation has not completed initialising.
       
  1647         TBool iEngineConstructionDelayed;
       
  1648         TBool iCameraSwitchDelayed;  
       
  1649 
       
  1650         // Set to true in the case where we pretend to exit the app, but are still really
       
  1651         // running in the background. The app should behave slightly differently when we 
       
  1652         // are next brought to the foreground.
       
  1653         TBool iPretendExit;
       
  1654 
       
  1655         // flag to indicate whether we are currently embedding another application
       
  1656         TBool iEmbedding;
       
  1657 
       
  1658         // flag to indicate if "Send As" is in progress
       
  1659         TBool iSendAsInProgress;
       
  1660 
       
  1661         // 
       
  1662         TInt iFullShutterPressHandle;
       
  1663         TInt iHalfShutterPressHandle;
       
  1664         TInt iFullShutterUpDownHandle;
       
  1665 
       
  1666         // Window group ID for Bluetooth server
       
  1667         TInt iBTServerWindowGroupId;
       
  1668         
       
  1669         // Window group ID for Telephone application
       
  1670         TInt iPhoneAppWindowGroupId;
       
  1671         
       
  1672         // position of softkeys in landscape mode (left or right)
       
  1673         TInt iSoftkeyPosition;
       
  1674         
       
  1675         /// The current pre capture mode shown
       
  1676         TCamPreCaptureMode iPreCaptureMode;
       
  1677 
       
  1678         // flag to indicate viewfinder stopped
       
  1679         TBool iViewFinderStopped;  
       
  1680 
       
  1681         // flag used to say whether we want to suppress auto-UI rise on next viewfinder start event
       
  1682         TBool iSuppressUIRise;
       
  1683 
       
  1684         // Flag used to indicate that focus was lost to an incoming call during sequence capture
       
  1685         TBool iFocusLostToCallDuringSequenceCapture;
       
  1686 
       
  1687         // observer to receive volume key presses
       
  1688         // Own.
       
  1689         CCamRemConObserver* iVolumeKeyObserver;
       
  1690 
       
  1691         TBool iZoomUsingVolumeKeys;
       
  1692 
       
  1693         // Own
       
  1694         CAknLocalScreenClearer* iScreenClearer;
       
  1695 
       
  1696         // Status of postcapture views construction
       
  1697         TBool iStillPostCaptureViewConstructed;
       
  1698         TBool iBurstThumbnailViewConstructed;
       
  1699         TBool iVideoPostCaptureViewConstructed;
       
  1700 
       
  1701 #ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION        
       
  1702         // CIdle object used for late construction of the postcapture views
       
  1703         // Own.
       
  1704         CIdle* iPostCapIdle;
       
  1705 
       
  1706         // Status of the views creation
       
  1707         TCamPostCapConstruction iPostCapProgress;
       
  1708 #endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION
       
  1709 
       
  1710         // Own.
       
  1711         CIdle* iSensorIdle;       
       
  1712         TBool iSensorIdleRunning;
       
  1713 
       
  1714         // Own.
       
  1715         HBufC* iLowRamNoteText;
       
  1716 
       
  1717         // Used to allow postcapture view to show for selftimed captures
       
  1718         TBool iSelfTimedCapture;
       
  1719 
       
  1720         TBool iDSASupported;
       
  1721 
       
  1722         TInt iNoteId;
       
  1723 
       
  1724         // View UID if the ViaPlayerApplication view
       
  1725         TUid iViaPlayerUid;
       
  1726         // LeftSoftKey is Pressed
       
  1727         TBool iLeftSoftKeyPressed;
       
  1728         TBool iEndKeyPressed;
       
  1729 
       
  1730         TBool iCheckOperationInProgress;
       
  1731         CCamCollectionManagerAO* iCollectionManager;
       
  1732 
       
  1733         // Own.
       
  1734         CCamGSInterface* iPlugin;
       
  1735 
       
  1736         TBool iSettingsPluginLaunched;
       
  1737 
       
  1738         TBool iReturnedFromPlugin;
       
  1739 
       
  1740         // Own
       
  1741         CCamFileCheckAo *iFileCheckAo;
       
  1742 
       
  1743         // Own
       
  1744         CAknStylusPopUpMenu* iTouchPopupMenu;
       
  1745 
       
  1746         // Own
       
  1747         CAknStaticNoteDialog* iMemoryNote;
       
  1748 
       
  1749         TSize iRequestedNewFileResolution;
       
  1750 
       
  1751         TBool iLostFocusToNewWindow;
       
  1752         TBool        iToolbarVisibility;
       
  1753         TBool        iRotatedKeyEvent;
       
  1754         
       
  1755         // flag that tells us that we are exiting app because lens cover is closed
       
  1756         // used to skip post-capture view in these cases
       
  1757         TBool iLensCoverExit; 
       
  1758         // flag that indicates whether view finder start is the
       
  1759         // first one after camera startup
       
  1760         TBool iFirstVFStart;
       
  1761 
       
  1762         TUid iLastHiddenViewId;
       
  1763         
       
  1764         TCamMediaStorage iInternalStorage; //Points to either Phone or Internal Mass storage based on availability
       
  1765         T2ndCamOrientation iLockedQwertyState; 
       
  1766         TBool iUiConstructionComplete;
       
  1767         CCamMemoryMonitor* iMemoryMonitor;
       
  1768 		        
       
  1769         //Flag to monitor viewfinder window handle switch
       
  1770         TBool iViewFinderInTransit;
       
  1771 
       
  1772 		TInt iLandscapeScreenMode;
       
  1773         TInt iPortraitScreenMode;
       
  1774         };
       
  1775 
       
  1776 // ===========================================================================
       
  1777 // Debug strings
       
  1778 
       
  1779 #ifdef _DEBUG
       
  1780 const TUint16* const KCamViewStateNames[] =
       
  1781   {
       
  1782   (const TUint16* const)_S16("ECamViewStateRangeInternalMin"),
       
  1783 
       
  1784   (const TUint16* const)_S16("ECamViewStatePreCapture"),
       
  1785   (const TUint16* const)_S16("ECamViewStatePostCapture"),
       
  1786   (const TUint16* const)_S16("ECamViewStateBurstThumbnail"),
       
  1787   (const TUint16* const)_S16("ECamViewStateSettings"),
       
  1788   (const TUint16* const)_S16("ECamViewStateStandby"),
       
  1789   (const TUint16* const)_S16("ECamViewStateUserSceneSetup"),
       
  1790   (const TUint16* const)_S16("ECamViewStateWhiteBalanceUser"),
       
  1791   (const TUint16* const)_S16("ECamViewStateColourFilterUser"),
       
  1792   (const TUint16* const)_S16("ECamViewStateFlashUser"),
       
  1793   (const TUint16* const)_S16("ECamViewStateSceneUser"),
       
  1794   (const TUint16* const)_S16("ECamViewStateSceneStill"),
       
  1795   (const TUint16* const)_S16("ECamViewStateCaptureSetupMenu"),
       
  1796   (const TUint16* const)_S16("ECamViewStateSceneSettingList"),
       
  1797   (const TUint16* const)_S16("ECamViewStateExposureUser"),
       
  1798   (const TUint16* const)_S16("ECamViewStateCustomiseToolbar"),
       
  1799   (const TUint16* const)_S16("ECamViewStatePrePortraitCapture"),
       
  1800   
       
  1801   (const TUint16* const)_S16("ECamViewStateRangeInternalMax"),
       
  1802   (const TUint16* const)_S16("ECamViewStateRangeExternalMin"),
       
  1803 
       
  1804   (const TUint16* const)_S16("ECamViewStateViaPlayer"),
       
  1805   (const TUint16* const)_S16("ECamViewStateGsCamcorderPlugin"),
       
  1806 
       
  1807   (const TUint16* const)_S16("ECamViewStateRangeExternalMax")
       
  1808   };
       
  1809 __ASSERT_COMPILE( (sizeof(KCamViewStateNames)/sizeof(TUint16*)) == ECamViewStateCount );
       
  1810 #endif // _DEBUG
       
  1811 
       
  1812 #endif      // CAMAPPUI_H   
       
  1813             
       
  1814 // End of File