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