camerauis/cameraapp/generic/inc/CamSidePane.h
changeset 0 1ddebce53859
child 27 53c8aa5d97a3
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     1 /*
       
     2 * Copyright (c) 2007 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:  SidePane Control*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMSIDEPANE_H
       
    19 #define CAMSIDEPANE_H
       
    20 
       
    21 // INCLUDES
       
    22  
       
    23 #include "CamSelfTimerObserver.h"
       
    24 #include "CamBurstModeObserver.h"
       
    25 #include "CamResourceLoader.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CCamIndicator;
       
    29 class CCamIndicatorData;
       
    30 class CCamIndicatorResourceReader;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 enum ECamSidePaneFlashState
       
    35     { // Used to indicate whether to turn flashing indicators on or off
       
    36     ECamSidePaneFlashOff,
       
    37     ECamSidePaneFlashOn
       
    38     };
       
    39 
       
    40 /**
       
    41 * Side Pane control
       
    42 */
       
    43 class CCamSidePane : public CBase,
       
    44                                 public MCamControllerObserver,
       
    45                                 public MCamResourceLoader
       
    46 #ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE 
       
    47                                 ,public MCamBurstModeObserver
       
    48 #endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE
       
    49   {
       
    50   // =========================================================================
       
    51   public: // Constructors and destructor
       
    52     
       
    53     /**
       
    54     * Symbian OS two-phased constructor
       
    55     * @since 2.8
       
    56     * @param aController reference to CCamAppControllerBase instance
       
    57     * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder
       
    58     * @return created CCamSidePane object
       
    59     */
       
    60     static CCamSidePane* NewL( CCamAppController& aController,
       
    61                                TBool              aOverlayViewFinder );
       
    62   
       
    63     /**
       
    64     * Destructor.
       
    65     */
       
    66     virtual ~CCamSidePane();
       
    67 
       
    68   public: // From MCamResourceLoader
       
    69 
       
    70     /**
       
    71     * From MCamResourceLoader
       
    72     * @since 3.0
       
    73     */
       
    74     void LoadResourceDataL();
       
    75 
       
    76     /**
       
    77     * From MCamResourceLoader
       
    78     * @since 3.0
       
    79     */
       
    80     void UnloadResourceData();
       
    81 
       
    82     /**
       
    83     * From MCamResourceLoader
       
    84     * @since 3.0
       
    85     */
       
    86     void ReloadResourceDataL();
       
    87 
       
    88   public: // New functions
       
    89 
       
    90     /**
       
    91     * Is the zoom pane visible?
       
    92     * @since 2.8
       
    93     * @return ETrue if the zoom pane is visible
       
    94     */   
       
    95     TBool IsVisible();
       
    96 
       
    97     /**
       
    98     * Tells the zoom pane whether it is on display
       
    99     * @since 2.8
       
   100     * @param aVisible ETrue to make the zoom pane invisible
       
   101     */   
       
   102     void MakeVisible( TBool aVisible );
       
   103 
       
   104     /**
       
   105     * Draws all the indicators that are displayed in the side pane
       
   106     * @since 2.8
       
   107     * @param aGc The graphics context to use for drawing
       
   108     */
       
   109     void Draw( CBitmapContext& aGc ) const;
       
   110 
       
   111     /**
       
   112     * Set draw rect
       
   113     * @since 2.8
       
   114     * @param Rect to draw into
       
   115     */
       
   116     void SetRect( TRect& aRect );
       
   117 
       
   118     /**
       
   119     * Set current capture mode
       
   120     * @since 2.8
       
   121     * @param aMode Capture mode
       
   122     */
       
   123     void SetCaptureMode( TCamCameraMode aMode );
       
   124     
       
   125     /**
       
   126     * Set up initial state of side pane
       
   127     * @since 2.8
       
   128     */
       
   129     void SetInitialState();
       
   130    
       
   131     /**
       
   132      * Updates the layouts for each indicator in sidepane
       
   133      * @since S60 5.0
       
   134      */
       
   135     void UpdateLayout();    
       
   136 
       
   137   protected: // Functions from base classes
       
   138 
       
   139     /**
       
   140     * From MCamControllerObserver
       
   141     * Handle an event from CCamAppControllerBase.
       
   142     * @since 2.8
       
   143     * @param aEvent the type of event
       
   144     * @param aError error code
       
   145     */
       
   146     virtual void HandleControllerEventL( TCamControllerEvent aEvent,
       
   147                                          TInt                aError );
       
   148 
       
   149 
       
   150   private:
       
   151 
       
   152     /**
       
   153     * Get the icon index of current flash setting in given mode.
       
   154     * @param aMode Capture mode for which the flash icon index is needed.
       
   155     */
       
   156     TInt GetFlashIconIndex( const TCamCameraMode& aMode );
       
   157 
       
   158 
       
   159     /**
       
   160     * Register this object with observed classes.
       
   161     * @since 2.8
       
   162     */
       
   163     void RegisterObserversL();
       
   164 
       
   165     /**
       
   166     * Deregister this object from observed classes
       
   167     * @since 2.8
       
   168     */
       
   169     void RemoveObservers();
       
   170 
       
   171 // Generic setup icon is displayed either in the navipane or sidepane
       
   172 #ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR
       
   173 #ifndef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR
       
   174     /**
       
   175     * Sets the default setup indicator depending on the 
       
   176     * current setup settings.
       
   177     * @since 2.8
       
   178     */
       
   179     void SetGenericSetupIndicator();
       
   180 #endif // !PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR
       
   181 #endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR
       
   182 
       
   183     /**
       
   184     * Sets the image stabilisation indicator
       
   185     * if the current capture mode is video
       
   186     * @since 3.0
       
   187     */
       
   188     void SetVideoStabilisationIndicator();
       
   189 
       
   190     /**
       
   191     * Sets the facetracking indicator
       
   192     * if the current capture mode is still image
       
   193     * @since 3.0
       
   194     */
       
   195     void SetFaceTrackingIndicator();
       
   196 
       
   197     /**
       
   198     * Set the video scene indicator depending on current setting
       
   199     * @since 2.8
       
   200     */
       
   201     void SetVideoSceneIndicator();
       
   202 
       
   203     /**
       
   204     * Set the photo scene indicator depending on current setting
       
   205     * @since 2.8
       
   206     */
       
   207     void SetPhotoSceneIndicator();
       
   208 
       
   209 // Burst mode icon is displayed in either the navipane or sidepane
       
   210 #ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE 
       
   211     /**
       
   212     * From MCamBurstModeObserver
       
   213     * @since 2.8
       
   214     * @param aActive whether or not burst mode is active
       
   215     * @param aStillModeActive whether or not still capture is active
       
   216     */
       
   217     void BurstModeActiveL( TBool aActive, TBool aStillModeActive );
       
   218 #endif  // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE 
       
   219 
       
   220     /**
       
   221     * Checks if the secondary camera is enabled
       
   222     * @since 2.8
       
   223     * @return ETrue if the second camera is enabled
       
   224     */
       
   225     TBool IsSecondaryCameraEnabled() const;
       
   226     
       
   227     /**
       
   228     * Read nontouch layout
       
   229     */
       
   230     void NonTouchLayout() const; 
       
   231 
       
   232     /**
       
   233     * Read touch layout
       
   234     */
       
   235     void TouchLayout() const; 
       
   236 
       
   237   private:
       
   238 
       
   239     /**
       
   240     * Symbian OS 2nd phase constructor.
       
   241     * @since 2.8
       
   242     */
       
   243     void ConstructL();
       
   244 
       
   245     /**
       
   246     * C++ constructor
       
   247     * @since 2.8
       
   248     * @param aController reference to CCamAppControllerBase instance
       
   249     * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder
       
   250     */
       
   251     CCamSidePane( CCamAppController& aController, 
       
   252                   TBool              aOverlayViewFinder );
       
   253 
       
   254   // =========================================================================
       
   255   // Data
       
   256   private: 
       
   257   
       
   258     CCamAppController& iController;
       
   259     RPointerArray<CCamIndicator> iIndicators; // contained indicators
       
   260    
       
   261     TCamCameraMode iMode; // capture state used to determine which settings to retrieve
       
   262 
       
   263     TBool iOverlayViewFinder;     // whether sidepane is drawn over the viewfinder 
       
   264     TRect iRect; // the side pane rect
       
   265     TBool iVisible; // whether the side pane is visible
       
   266 
       
   267   // =========================================================================
       
   268   };
       
   269 
       
   270 #endif
       
   271 
       
   272 // End of File