camerauis/cameraapp/generic/inc/CamCaptureSetupContainer.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 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:  Class for displaying capture set-up controls*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMCAPTURESETUPCONTAINER_H
       
    19 #define CAMCAPTURESETUPCONTAINER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <AknUtils.h>
       
    23 #include <eiklbo.h>
       
    24  
       
    25 #include "CamContainerBase.h"
       
    26 #include "CamControllerObservers.h"
       
    27 #include "mcamcameraobserver.h"
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CCamCaptureSetupControlHandler;
       
    32 class MTouchFeedback; 
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * Container base class
       
    39 */
       
    40 class CCamCaptureSetupContainer : public CCamContainerBase,
       
    41                                   public MCamCameraObserver,
       
    42                                   public MEikListBoxObserver
       
    43 //                                public MCamViewFinderObserver
       
    44   {
       
    45   public: // Constructors and destructor
       
    46 
       
    47     /**
       
    48     * Symbian OS two-phased constructor
       
    49     * @since 2.8
       
    50     * @param aController Controller reference
       
    51     * @param aView View reference
       
    52     * @param aControlHandler Handler reference
       
    53     * @param aRect Frame rectangle for container.
       
    54     */
       
    55     static CCamCaptureSetupContainer* NewL( 
       
    56               CCamAppController&              aController, 
       
    57               CAknView&                       aView,
       
    58               CCamCaptureSetupControlHandler& aControlHandler,
       
    59               const TRect&                    aRect  );
       
    60         
       
    61     /**
       
    62     * Destructor.
       
    63     * @since 2.8
       
    64     */
       
    65     virtual ~CCamCaptureSetupContainer();
       
    66         
       
    67 
       
    68   // -----------------------------------------------------
       
    69   // From CCoeControl
       
    70   private:  
       
    71 
       
    72     /**
       
    73     * @since 2.8
       
    74     * @return number of contained controls
       
    75     */
       
    76     TInt CountComponentControls() const;
       
    77     
       
    78     /**
       
    79     * @since 2.8
       
    80     * @param aIndex the index of the control
       
    81     * @return pointer to the component control
       
    82     */
       
    83     CCoeControl* ComponentControl( TInt aIndex ) const;
       
    84 
       
    85     /**
       
    86     * @since 2.8
       
    87     * @param aRect area where to draw
       
    88     */
       
    89     void Draw( const TRect& aRect ) const;
       
    90 
       
    91     /**
       
    92     * @since 2.8
       
    93     * @param aKeyEvent the key event
       
    94     * @param aType the type of the event
       
    95     * @return TKeyResponse key event was used by this control or not
       
    96     */
       
    97     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
    98                                        TEventCode aType );
       
    99     
       
   100     /*
       
   101      * From CoeControl
       
   102      * @param aPointerEvent the pointer event to handle
       
   103      */
       
   104     void HandlePointerEventL(  const TPointerEvent& aPointerEvent );
       
   105     /**
       
   106     * From MEikListBoxObserver
       
   107     */
       
   108     void HandleListBoxEventL(CEikListBox* aListBox, 
       
   109                              TListBoxEvent aEventType );
       
   110 
       
   111   // -----------------------------------------------------
       
   112   // From MCamCameraObserver 
       
   113   public: 
       
   114 
       
   115       
       
   116     /**
       
   117       * Handle events sending app to foreground or background
       
   118       * @param aForeground whether the event brings the app to fore or background
       
   119     */   
       
   120       
       
   121       void HandleForegroundEventL( TBool aForeground );
       
   122       
       
   123       
       
   124       /**
       
   125     * @since Camera 4.0
       
   126     * @see MCamCameraObserver
       
   127     */
       
   128     virtual void HandleCameraEventL( TInt              aStatus, 
       
   129                                      TCamCameraEventId aEventId, 
       
   130                                      TAny*             aEventData = NULL );
       
   131 
       
   132   // -----------------------------------------------------
       
   133   // Other methods
       
   134   private:
       
   135 
       
   136     /**
       
   137     * Calculates the position for the settings editing control
       
   138     * @since 2.8
       
   139     * @return the top left corner position for the control
       
   140     */
       
   141     TPoint ControlPositionL() const;
       
   142     
       
   143     /**
       
   144     * Read nontouch layout
       
   145     * @return TRect, listbox rectangle
       
   146     */
       
   147     TRect NonTouchLayout();
       
   148     
       
   149     /**
       
   150     * Read touch layout
       
   151     * @return TRect, listbox rectangle
       
   152     */
       
   153     TRect TouchLayout();
       
   154     
       
   155     /**
       
   156     * Enters viewfinder mode either in image or videomode
       
   157     * depending current visible view. Also starts idle timer.
       
   158     */
       
   159     void ReserveAndStartVF();
       
   160     
       
   161   // -----------------------------------------------------
       
   162   // Constructors
       
   163   private:
       
   164 
       
   165     /**
       
   166     * C++ constructor
       
   167     * @param aController Controller reference
       
   168     * @param aView View reference
       
   169     * @param aControlHandler Handler reference
       
   170     * @since 2.8
       
   171     */
       
   172     CCamCaptureSetupContainer( 
       
   173         CCamAppController& aController,
       
   174         CAknView& aView,
       
   175         CCamCaptureSetupControlHandler& aControlHandler );
       
   176 
       
   177     /**
       
   178     * Symbian OS 2nd phase constructor.
       
   179     * @since 2.8
       
   180     * @param aRect Frame rectangle for container.
       
   181     */
       
   182     void ConstructL( const TRect& aRect );
       
   183 
       
   184 
       
   185   // =====================================================
       
   186   // Data
       
   187   protected:
       
   188 
       
   189     // The control handler that creates the setting editing control
       
   190     CCamCaptureSetupControlHandler& iControlHandler;
       
   191     // The control that edits the setting value
       
   192     CCoeControl* iCaptureSetupControl;
       
   193     // The text shown as the title of the container
       
   194     HBufC* iTitleText;
       
   195     // Whether or not the container displays a viewfinder preview pane
       
   196     TBool iViewFinding;
       
   197     
       
   198     // Layout rect for cropped viewfinder display
       
   199     TAknLayoutRect iViewFinderRectLayout;
       
   200     
       
   201     TAknLayoutRect iSetupControlRectLayout;
       
   202     
       
   203     // Layout rect for title text
       
   204     TAknLayoutText iTitleTextRectLayout;
       
   205     
       
   206     // width of list-box
       
   207     TInt iListBoxWidth;
       
   208     
       
   209     TBool iActivateOnTouchRelease;
       
   210     MTouchFeedback* iFeedback; // not own
       
   211     TRect iLayoutAreaRect; 
       
   212   };
       
   213 
       
   214 #endif // CAMCAPTURESETUPCONTAINER_H
       
   215 
       
   216 // End of File