camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingContainer.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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMLOCATIONSETTINGCONTAINER_H
       
    20 #define CAMLOCATIONSETTINGCONTAINER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include <AknUtils.h>
       
    25 #include <eiklbo.h>
       
    26 
       
    27 #include "MCamAppController.h"
       
    28 #include "CamSettingValueObserver.h"
       
    29 #include "CamStaticSettingsModel.h"
       
    30 // CONSTANTS
       
    31 const TInt KMaxTextLength = 40;
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CCamCaptureSetupListBox;
       
    35 class MAknQueryValue;
       
    36 class MTouchFeedback;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Implements the location listbox control and descriptive texts
       
    42 *
       
    43 *  @since 2.8
       
    44 */
       
    45 class CCamLocationSettingContainer : public CCoeControl,
       
    46                                      public MCamSettingValueObserver,
       
    47                                      public MEikListBoxObserver
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         * @since 2.8
       
    54         * @param aController reference to the app controller
       
    55         * @param aCaptureMode the current capture mode
       
    56         * @param aParent this control's parent
       
    57         * @return pointer to a new quality container
       
    58         */
       
    59         static CCamLocationSettingContainer* NewL( MCamAppController& aController,
       
    60                                                   TCamCameraMode aCaptureMode,
       
    61                                                   CCoeControl* aParent );
       
    62         
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66         virtual ~CCamLocationSettingContainer();
       
    67 
       
    68     public: // New functions
       
    69         
       
    70         /**
       
    71         * Returns the selected quality
       
    72         * @since 2.8
       
    73         * @return the selected quality
       
    74         */
       
    75         TInt SelectedValue() const;
       
    76 
       
    77     public: // Functions from base classes
       
    78 
       
    79         /**
       
    80         * From CCoeControl 
       
    81         * Constructs the control from a resource
       
    82         * @since 2.8
       
    83         * @param aReader the resource reader
       
    84         */
       
    85         void ConstructFromResourceL( TResourceReader& aReader );
       
    86 
       
    87         /**
       
    88         * From CCoeControl
       
    89         * Standard CCoeControl routine to return the number of component controls
       
    90         * @since 2.8
       
    91         * @return the number of component controls
       
    92         */
       
    93 	    TInt CountComponentControls() const;
       
    94 
       
    95         /**
       
    96         * From CCoeControl
       
    97         * Standard CCoeControl routine to return the control at a given index
       
    98         * @since 2.8
       
    99         * @param anIndex index at which to return control
       
   100         * @return the control at the given index
       
   101         */ 
       
   102         CCoeControl* ComponentControl( TInt anIndex ) const;
       
   103 
       
   104         /**
       
   105         * From CCoeControl
       
   106         * Draws the controls
       
   107         * @since 2.8
       
   108         * @param aRect	the invlaid rect to draw
       
   109         */ 
       
   110         void Draw( const TRect& aRect ) const;
       
   111 
       
   112         /**
       
   113         * From CCoeControl
       
   114         * Called when the size of the control changes
       
   115         * @since 2.8
       
   116         */ 
       
   117         void SizeChanged();
       
   118 
       
   119         /**
       
   120         * From CCoeControl
       
   121         * Offers a key event to the control
       
   122         * @since 2.8
       
   123         * @param aKeyEvent the key event offered
       
   124         * @param aType the type key event
       
   125         * @return whether the key was handled
       
   126         */ 
       
   127         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   128     
       
   129         /**
       
   130         * From MCamSettingValueObserver
       
   131         * Handles a change in the slider value
       
   132         * @since 2.8
       
   133         * @param aNewValue the new value of the setting
       
   134         */ 
       
   135         void HandleSettingValueUpdateL( TInt aNewValue );
       
   136 
       
   137 
       
   138     protected:  // New functions
       
   139 
       
   140     protected:  // Functions from base classes
       
   141 
       
   142     private:
       
   143 
       
   144         /**
       
   145         * C++ default constructor.
       
   146         * @since 2.8
       
   147         * @param aController reference to the app controller
       
   148         * @param aMode the current capture mode
       
   149         * @param aParent this control's parent
       
   150         */
       
   151         CCamLocationSettingContainer( MCamAppController& aController,
       
   152                                      TCamCameraMode aMode,
       
   153                                      CCoeControl* aParent );
       
   154 
       
   155         /**
       
   156         * By default Symbian 2nd phase constructor is private.
       
   157         * @since 2.8
       
   158         */
       
   159         void ConstructL();
       
   160        
       
   161         /**
       
   162         * Reads the listbox layout from a resource file
       
   163         */
       
   164         void ReadListboxLayoutL( TRect& aRect );
       
   165 
       
   166         /**
       
   167 	      * Sets up the summary pane detail arrays
       
   168 	      * @since 2.8
       
   169 	      * @param aResourceId The resource that defines the summary pane details
       
   170 	      */
       
   171 	      void ConstructSummaryDetailsFromResourceL(TInt aResourceId);
       
   172         
       
   173 	      /**
       
   174 	      * Draws the summary title and description text
       
   175 	      * @since 2.8
       
   176 	      * @param aGc The graphics context to draw to
       
   177 	      */
       
   178 	      void DrawSummaryText( CWindowGc& aGc ) const;
       
   179 	       /**
       
   180 	      * Splits the summary title and description text into multiple lines that fit the status layouts
       
   181 	      * @since 2.8
       
   182 	      */
       
   183 	      void SplitCurrentTextL();
       
   184 
       
   185           void ConstructContainerTitleFromResourceL( TInt aResourceId );
       
   186           void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   187           /**
       
   188            * From MEikListBoxObserver
       
   189            */
       
   190           void HandleListBoxEventL(CEikListBox* aListBox, 
       
   191                                       TListBoxEvent aEventType );
       
   192 	      
       
   193     private:    // Data
       
   194         // the parent control        
       
   195         CCoeControl* iParent;
       
   196         // the app controller
       
   197         MCamAppController& iController;
       
   198         
       
   199         // the location mode list box
       
   200         CCamCaptureSetupListBox* iListBox;
       
   201         // the capture mode (video/still)
       
   202         TCamCameraMode iMode;
       
   203 
       
   204          // Layout of summary outer region (box)
       
   205         TAknLayoutRect iSummaryRect;
       
   206         // Array of all descriptions texts
       
   207         RPointerArray<HBufC> iDescArray;
       
   208         // Array of layouts for description lines 
       
   209         RArray<TAknLayoutText> iDescLayoutArray;
       
   210         // Array of split description lines
       
   211         CArrayFixFlat<TPtrC>* iCurrentDescLineArray;
       
   212 	      
       
   213         // The text shown as the title of the container
       
   214         HBufC16* iTextTitle;
       
   215  
       
   216         TBool iActivateOnTouchRelease;
       
   217  
       
   218     };
       
   219 
       
   220 #endif      // CAMLOCATIONSETTINGCONTAINER_H   
       
   221             
       
   222 // End of File