camerauis/cameraapp/generic/inc/camcapturebuttoncontainer.h
branchRCL_3
changeset 24 bac7acad7cb3
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 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 custom camera capture button (touch) 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CAMCAPTUREBUTTONCONTAINER_H_
       
    19 #define CAMCAPTUREBUTTONCONTAINER_H_
       
    20 
       
    21 
       
    22 #include "CamPreCaptureContainerBase.h"
       
    23 #include "CamSettingsInternal.hrh"
       
    24 
       
    25 
       
    26 // ===========================================================================
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 class MTouchFeedback;
       
    30 
       
    31 
       
    32 // ===========================================================================
       
    33 // CLASS DECLARATION
       
    34 
       
    35 class CCamCaptureButtonContainer : public CCoeControl
       
    36     {
       
    37 private:
       
    38     CCamCaptureButtonContainer();
       
    39     
       
    40 protected: 
       
    41 
       
    42     /**
       
    43     * C++ constructor
       
    44     * @since 5.2
       
    45     * @param aController reference to CCamAppController instance
       
    46     * @param aView reference to the view containing this container
       
    47     * @param aContainer reference to the parent container
       
    48     * @param aCameraMode mode of the camera (image/video) 
       
    49     */
       
    50     CCamCaptureButtonContainer( CCamAppController& aController,
       
    51                                 CAknView& aView,
       
    52                                 CCamPreCaptureContainerBase& aContainer,
       
    53                                 TCamCameraMode aCameraMode );
       
    54     
       
    55     /**
       
    56     * Perform the second phase construction of a CCamCaptureButtonContainer object.
       
    57     * @since 5.2
       
    58     * @param aRect rectangular region bounding this container
       
    59     */
       
    60     void ConstructL( const TRect& aRect );
       
    61 
       
    62 public:
       
    63     /**
       
    64     * Destructor.
       
    65     */
       
    66     virtual ~CCamCaptureButtonContainer();
       
    67     
       
    68     /**
       
    69     * Two-phased factory constructor
       
    70     * @since 5.2
       
    71     * @param aController reference to CCamAppController instance
       
    72     * @param aView reference to the view containing this container
       
    73     * @param aContainer Parent container
       
    74     * @return pointer to the created CCamCaptureButtonContainer object already pushed on the Cleanupstack
       
    75     */
       
    76     static CCamCaptureButtonContainer* NewLC( CCamAppController& aController,
       
    77                                               CAknView& aView,            
       
    78                                               CCamPreCaptureContainerBase& aContainer,
       
    79                                               const TRect& aRect,
       
    80                                               TCamCameraMode aCameraMode );
       
    81     
       
    82     /**
       
    83     * Two-phased factory constructor.
       
    84     * @since 5.2
       
    85     * @param aController reference to CCamAppController instance
       
    86     * @param aView reference to the view containing this container
       
    87     * @param aContainer Parent container
       
    88     * @return pointer to the created CCamCaptureButtonContainer object
       
    89     */
       
    90     static CCamCaptureButtonContainer* NewL( CCamAppController& aController, 
       
    91                                              CAknView& aView,
       
    92                                              CCamPreCaptureContainerBase& aContainer,
       
    93                                              const TRect& aRect,
       
    94                                              TCamCameraMode aCameraMode );
       
    95     
       
    96 public:
       
    97     /**
       
    98     * Performs the actual draw on the container 
       
    99     * @since 5.2
       
   100     * @param aRect area where to draw
       
   101     */
       
   102     virtual void Draw( const TRect& aRect ) const;
       
   103     
       
   104     /**
       
   105      * From CCoeControl
       
   106      * Handle pointer events. 
       
   107      * @since S60 5.2
       
   108      * @param aPointerEvent information about the pointerevent
       
   109      */
       
   110     virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   111 
       
   112     /**
       
   113      * Used to control visibilty of capture button
       
   114      * @since S60 5.2
       
   115      * @param aShown button is shown if ETrue, else not shown 
       
   116      */
       
   117     void SetCaptureButtonShown( TBool aShown );
       
   118 
       
   119 private:
       
   120     /**
       
   121      * Draws the capture button
       
   122      * @since S60 5.2
       
   123      * @param aGc graphics context to draw to 
       
   124      */
       
   125     void DrawCaptureButton( CBitmapContext& aGc ) const;
       
   126     
       
   127 private:
       
   128 
       
   129     CCamAppController& iController; 
       
   130     CAknView& iView;
       
   131     CCamPreCaptureContainerBase& iParentContainer;
       
   132 
       
   133     TCamCameraMode iCameraMode;
       
   134     MTouchFeedback* iFeedback;
       
   135 
       
   136     // Icons and rect for capturing image
       
   137     CFbsBitmap *iCaptureIcon;
       
   138     CFbsBitmap *iCaptureIconMask;
       
   139     CFbsBitmap *iCaptureIconPressed;
       
   140     CFbsBitmap *iCaptureIconPressedMask;
       
   141     TRect iCaptureRect;
       
   142     TBool iCaptureButtonShown;
       
   143     TBool iCaptureButtonPressed;
       
   144     };
       
   145 
       
   146 #endif /* CAMCAPTUREBUTTONCONTAINER_H_ */