camerauis/cameraapp/generic/inc/CamVideoPreCaptureContainer.h
branchRCL_3
changeset 24 bac7acad7cb3
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Container for video pre capture view*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef CAMVIDEOPRECAPTURECONTAINER_H
       
    20 #define CAMVIDEOPRECAPTURECONTAINER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CamPreCaptureContainerBase.h"
       
    24 
       
    25 class MTouchFeedback;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 * Container for video image pre capture view
       
    31 */
       
    32 class CCamVideoPreCaptureContainer : public CCamPreCaptureContainerBase
       
    33   {
       
    34   public: // Constructors and destructor
       
    35         
       
    36     /**
       
    37     * Symbian OS two-phased constructor
       
    38     * @since 2.8
       
    39     * @param aController reference to CCamAppControllerBase instance
       
    40     * @param aView reference to the view containing this container
       
    41     * @param aSetupPaneHandler handle to horizontal setup pane (product specific)
       
    42     * @param aRect Frame rectangle for container.
       
    43     * @return Pointer to newly constructed CCamVideoPreCaptureContainer object
       
    44     */
       
    45     static CCamVideoPreCaptureContainer* NewL( 
       
    46                 CCamAppController& aController, 
       
    47                 CAknView& aView,									   
       
    48                 const TRect& aRect );
       
    49 
       
    50     /**
       
    51     * Destructor.
       
    52     */
       
    53     virtual ~CCamVideoPreCaptureContainer();
       
    54 
       
    55   // -------------------------------------------------------
       
    56   // From MCamControllerObserver
       
    57   public:
       
    58 
       
    59     /**
       
    60     * @since 2.8
       
    61     * @param aEvent The specific event which occurred
       
    62     * @param aError The error code associated with the event
       
    63     */
       
    64     void HandleControllerEventL( TCamControllerEvent aEvent, TInt aError );
       
    65 
       
    66   // <CAMERAAPP_CAPI_V2_MIGRATION>
       
    67   // -------------------------------------------------------
       
    68   // From MCamCameraObserver  
       
    69   public:
       
    70 
       
    71     /**
       
    72     * @since Camera 4.0
       
    73     * @see MCamCameraObserver
       
    74     */
       
    75     // Base class implementation fits this class, too.
       
    76     // virtual void HandleCameraEventL( TInt              aStatus, 
       
    77     //                                  TCamCameraEventId aEventId, 
       
    78     //                                  TAny*             aEventData = NULL );
       
    79 
       
    80     /**
       
    81     * From MCamViewFinderObserver
       
    82     * New viewfinder frame is available 
       
    83     * @since 2.8
       
    84     * @param aFrame pointer to the bitmap. This pointer is valid until
       
    85     *               the call returns. Ownership not transferred.
       
    86     * @param aFrozen whether or not the viewfinder has been frozen
       
    87     */
       
    88     //   void ShowViewFinderFrame( const CFbsBitmap* aFrame, TBool aFrozen );
       
    89 
       
    90   // </CAMERAAPP_CAPI_V2_MIGRATION>
       
    91   // -------------------------------------------------------
       
    92   // From CCamPreCaptureContainerBase
       
    93   public:
       
    94 
       
    95     /**
       
    96     * Handle events sending app to foreground or background
       
    97     * @since 2.8
       
    98     * @param aForeground whether the event brings the app to fore or background
       
    99     */
       
   100 		virtual void HandleForegroundEventL( TBool aForeground );
       
   101 
       
   102   protected:
       
   103 
       
   104     /**
       
   105     * Init the viewfinder grid.
       
   106     * Overriden from base class to always disable vf grid.
       
   107     */
       
   108     virtual void InitVfGridL( const TRect& aRect );
       
   109 
       
   110   private:
       
   111 
       
   112     /**
       
   113     * From CCamPreCaptureContainerBase
       
   114     * Return the id of the layout resource for the viewfinder frame
       
   115     * @since 2.8
       
   116     * @param aViewFinderLayoutId on return this contains the resource id
       
   117     *           of the viewfinder layout
       
   118     * @param aReticuleLayoutId on return this contains the resource id 
       
   119     *           of the reticule layout if used, otherwise 0
       
   120     */
       
   121     virtual void ViewFinderLayoutResourceIds( TInt& aViewFinderLayoutId, 
       
   122                                               TInt& aReticuleLayoutId ) const;
       
   123                                           
       
   124     /**
       
   125     * From CCamPreCaptureContainerBase
       
   126     * Sets the resolution indicator to the required icon
       
   127     * @since 2.8
       
   128     */
       
   129     virtual void SetResolutionIndicator();
       
   130 
       
   131     /**
       
   132     * Sets the location indicator icon if the setting is enabled
       
   133     */
       
   134     virtual void SetLocationIndicatorVisibility();
       
   135 
       
   136     /**
       
   137     * Returns the rect of the location indicator
       
   138     * @return The rect of the location icon as a TRect
       
   139     * @since 3.0
       
   140     */
       
   141     virtual TRect LocationIndicatorRect();
       
   142         
       
   143     /**
       
   144     * From CCamPreCaptureContainerBase
       
   145     * Move up through the flash settings
       
   146     * @since 3.0
       
   147     */
       
   148     virtual void IncreaseFlashSettingL();
       
   149    
       
   150     /**
       
   151     * From CCamPreCaptureContainerBase
       
   152     * Move down through the flash settings
       
   153     * @since 3.0
       
   154     */ 
       
   155     virtual void DecreaseFlashSettingL();                                         
       
   156                                           
       
   157     /**
       
   158     * From CCamPreCaptureContainerBase
       
   159     * Process a key event that should change the current capture state
       
   160     * E.g. start/pause recording, start/stop capture
       
   161     * @since 3.0
       
   162     * @param aKeyEvent the key press that initiates the capture
       
   163     * @return whether or not the key was consumed
       
   164     */ 
       
   165     virtual TKeyResponse HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent );                                          
       
   166     
       
   167     /**
       
   168     * Allows additional mode-specific icons to be drawn
       
   169     * @param aGc The context to draw with
       
   170     */
       
   171     virtual void DrawAdditionalIcons(CBitmapContext& aGc) const;
       
   172         
       
   173     /**
       
   174     * Returns the ID of the array containing the resolution indicator icons
       
   175     * @return The array ID
       
   176     * @since 3.0
       
   177     */
       
   178     virtual TCamPsiKey ResolutionIndicatorIconPsiKey() const;
       
   179     
       
   180     /**
       
   181     * Process a key event that could change the current capture state
       
   182     * E.g. start autofocus, revert from post-capture to pre-capture views        
       
   183     * @since 3.0
       
   184     * @param aKeyEvent the key press that initiates the capture
       
   185     * @param aType the key type for the event
       
   186     * @return whether or not the key was consumed
       
   187     */         
       
   188     virtual TKeyResponse HandleShutterKeyEventL( const TKeyEvent& aKeyEvent,
       
   189                                                        TEventCode aType );
       
   190        
       
   191     /**
       
   192     * Gets the resource id of AP items.
       
   193     * Resource is selected based on embedded status and user mode.
       
   194     */
       
   195     virtual TInt GetAPResourceId() const;
       
   196 
       
   197 
       
   198   // -------------------------------------------------------
       
   199   // New methods
       
   200   private: 
       
   201     
       
   202     /**
       
   203     * Draws blank softkeys
       
   204     * @since 3.0
       
   205     */
       
   206     void BlankSoftkeysL();
       
   207 
       
   208     /**
       
   209     * Creates the icons used to indicate video file type
       
   210     * @since 3.0
       
   211     */
       
   212     void CreateFiletypeIndicatorL();
       
   213 
       
   214     /**
       
   215     * Sets the video file type icon depending on current setting
       
   216     * @since 3.0
       
   217     */
       
   218     void SetFileTypeIndicator();
       
   219     
       
   220 
       
   221   // -------------------------------------------------------
       
   222   // Constructors
       
   223   private:
       
   224     
       
   225     /**
       
   226     * Symbian OS 2nd phase constructor.
       
   227     * @since 2.8
       
   228     * @param aRect Frame rectangle for container.
       
   229     */
       
   230     void ConstructL( const TRect& aRect );
       
   231     
       
   232     /**
       
   233     * C++ constructor
       
   234     * @since 2.8
       
   235     * @param aController reference to CCamAppControllerBase instance
       
   236     * @param aSetupPaneHandler handle to horizontal setup pane (product specific)
       
   237     * @param aView reference to the view containing this container
       
   238     */
       
   239     CCamVideoPreCaptureContainer( 
       
   240         CCamAppController& aController,
       
   241         CAknView& aView );
       
   242 
       
   243   // =======================================================
       
   244   // Data
       
   245   private: 
       
   246     // Values representing current recording state
       
   247     enum TCamRecordState
       
   248       {
       
   249       ECamNotRecording,
       
   250       ECamRecording,
       
   251       ECamRecordPaused
       
   252       };
       
   253 
       
   254     // Current recording states
       
   255     TCamRecordState iRecordState;
       
   256     
       
   257     // resource for viewfinder layout
       
   258     TInt iVFRes;
       
   259     
       
   260     // Video file type indicator
       
   261     CCamIndicator* iFileTypeIndicator;
       
   262 
       
   263     
       
   264     // Normal location of video file type indicator
       
   265     TRect iFileTypeIndicatorPosition;
       
   266     
       
   267     // Position to move the resolution icon to during video capture
       
   268     TRect iResolutionIndicatorVidcapPosition;
       
   269     
       
   270     MTouchFeedback *iFeedback;
       
   271 
       
   272   // =======================================================
       
   273   };
       
   274 
       
   275 #endif // CAMVIDEOPRECAPTURECONTAINER_H
       
   276     
       
   277 // End of File CAMVIDEOPRECAPTURECONTAINER_H