camerauis/cameraapp/generic/inc/CamInfoListBoxContainer.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:  Setting page for Image/Video quality.*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMINFOLISTBOXCONTAINER_H
       
    19 #define CAMINFOLISTBOXCONTAINER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "CamContainerBase.h"
       
    23 #include "CamAppController.h"
       
    24 #include "CamSettingValueObserver.h"
       
    25 #include "CamSettings.hrh"
       
    26 #include <AknUtils.h>
       
    27 #include <eiklbo.h>
       
    28 
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class MAknQueryValue;
       
    40 class CCamInfoListBox;
       
    41 class CAknInfoPopupNoteController;
       
    42 class MTouchFeedback;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 * Implements a general setting control, with a listbox with choices 
       
    48 * in the left and a icon and highlighted item description in the right.
       
    49 *
       
    50 *  @since 2.8
       
    51 */
       
    52 
       
    53 class CCamInfoListBoxContainer : public CCamContainerBase, 
       
    54                                  public MCamSettingValueObserver,
       
    55                                  public MEikListBoxObserver
       
    56             {
       
    57     public: // Constructors and destructor
       
    58         
       
    59         /**
       
    60         * Symbian OS two-phased constructor
       
    61         * @since 2.8
       
    62         * @param aRect Frame rectangle for container.
       
    63         * @param aView Reference to the view containing this container
       
    64         * @param aController reference to CCamAppControllerBase instance
       
    65         * @param aListBoxResource Listbox resource data
       
    66         * @param aSummaryResource Summary resource data
       
    67         * @param aSettingValue Initial setting value
       
    68         */
       
    69         static CCamInfoListBoxContainer* NewL( const TRect& aRect, 
       
    70                                                  CAknView& aView,
       
    71                                                  CCamAppController& aController,
       
    72                                                  TInt aListBoxResource,
       
    73                                                  TInt aSummaryResource,
       
    74                                                  TInt aSettingValue, 
       
    75                                                  TInt aTitleResource,
       
    76                                                  TBool aSkinnedBackGround = ETrue );
       
    77         
       
    78 
       
    79         /**
       
    80         * Destructor.
       
    81         * @since 2.8
       
    82         */
       
    83         virtual ~CCamInfoListBoxContainer();
       
    84 
       
    85     private:
       
    86         /**
       
    87         * Symbian OS 2nd phase constructor.
       
    88         * @since 2.8
       
    89         * @param aRect Frame rectangle for container.
       
    90         * @param aListBoxResource
       
    91         * @param aSummaryResource
       
    92         */
       
    93         void ConstructL( const TRect& aRect, TInt aListBoxResource, TInt aSummaryResource, TInt aTitleResource  );
       
    94         
       
    95         /**
       
    96         * C++ constructor
       
    97         * @since 2.8
       
    98         * @param aController reference to CCamAppControllerBase instance
       
    99         * @param aView Reference to the view containing this container
       
   100         * @param aSettingValue Initial setting value
       
   101         * display the base scenes for the user scene.
       
   102         */
       
   103         CCamInfoListBoxContainer(   CCamAppController& aController,
       
   104                                     CAknView& aView,
       
   105                                     TInt aSettingValue, TBool aSkinnedBackGround = EFalse );
       
   106 
       
   107     public: 
       
   108         
       
   109         /**
       
   110         * Gets the settings item value ID of the current item
       
   111         * @since 2.8
       
   112         * @return the settings item value of the currently highlighted item
       
   113         */
       
   114         TInt CurrentSettingItemValue() const;
       
   115         
       
   116         /**
       
   117         * Returns ETrue if the setting item value has changed
       
   118         * @since 2.8
       
   119         * @return setting value change status
       
   120         */        
       
   121         TBool SettingValueChanged() const;
       
   122         
       
   123         /**
       
   124         * Gets the index in the item array that has the specified settings 
       
   125         * item value ID of the current item
       
   126         * @since 3.0
       
   127         * @return the index of the item with the specified value id
       
   128         */
       
   129         TInt IndexForValueId( TInt aValueId ) const;
       
   130         
       
   131    public: //Functions from base classes
       
   132         /**
       
   133         * From MCamSettingValueObserver
       
   134         * Handles a change in the slider value
       
   135         * @since 2.8
       
   136         * @param aNewValue the new value of the setting
       
   137         */ 
       
   138         void HandleSettingValueUpdateL( TInt aNewValue );
       
   139         
       
   140  
       
   141     protected: // Functions from base classes
       
   142         /**
       
   143         * From CoeControl
       
   144         * @since 2.8
       
   145         * @return number of contained controls
       
   146         */
       
   147         TInt CountComponentControls() const;
       
   148 
       
   149         /**
       
   150         * From CCoeControl
       
   151         * @since 2.8
       
   152         * @param aIndex The index of the required control
       
   153         * @return Returns the requested control
       
   154         */
       
   155         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   156 
       
   157         /**
       
   158         * From CCoeControl
       
   159         * @since 2.8
       
   160         * @param aRect area where to draw
       
   161         */
       
   162         void Draw( const TRect& aRect ) const;
       
   163 
       
   164         /**
       
   165         * From CamContainerBase 
       
   166         * @since 2.8
       
   167         * @param aKeyEvent the key event
       
   168         * @param aType the type of the event
       
   169         * @return TKeyResponse key event was used by this control or not
       
   170         */
       
   171         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   172                                      TEventCode aType );
       
   173 
       
   174     private: 
       
   175         /**
       
   176         * Sets up the summary pane detail arrays
       
   177         * @since 2.8
       
   178         * @param aResourceId The resource that defines the summary pane details
       
   179         */
       
   180         void ConstructSummaryDetailsFromResourceL(TInt aResourceId);
       
   181 
       
   182         
       
   183         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   184         /**
       
   185          * From MEikListBoxObserver
       
   186          */
       
   187         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   188         void ShowTooltipL();
       
   189         void ConstructContainerTitleFromResourceL( TInt aResourceId );
       
   190         
       
   191         /**
       
   192         * Draws the summary title and description text
       
   193         * @param aGc The graphics context to draw to
       
   194         */
       
   195         void DrawSummaryTextL( CWindowGc& aGc ) const;
       
   196         
       
   197         /**
       
   198         * Read touch layout
       
   199         * @return TRect, listbox rectangle
       
   200         */
       
   201         TRect TouchLayout();
       
   202 
       
   203         /**
       
   204         * Read non-touch layout
       
   205         * @return TRect, listbox rectangle
       
   206         */
       
   207         TRect NonTouchLayout();
       
   208         
       
   209     private: // data
       
   210         
       
   211         // The listbox itself
       
   212 				CCamInfoListBox* iListBox;
       
   213 
       
   214         // Array of bitmaps for the large summary icon
       
   215         RPointerArray<CFbsBitmap> iSummaryBitmapArray;        
       
   216         // Array of all shooting mode titles
       
   217         RPointerArray<HBufC> iTitleArray;
       
   218         // Array of all shooting mode descriptions
       
   219         RPointerArray<HBufC> iDescArray;
       
   220              
       
   221         TInt iSettingValue;
       
   222         
       
   223         		
       
   224 		// The text shown as the title of the container
       
   225         HBufC16* iListboxTitle;
       
   226         
       
   227         // info tooltip
       
   228         CAknInfoPopupNoteController* iTooltipController;
       
   229         TBool iShowTooltip;
       
   230         TInt iTooltipIndex;
       
   231         
       
   232         // Layout rect for title text
       
   233         TAknLayoutText iTitleTextRectLayout;  
       
   234         TAknLayoutRect iListboxLayoutRect; 
       
   235         TRect iLayoutAreaRect;  
       
   236         TRect iExplanationRect; 
       
   237         TInt iExplLineCount; // Number of available layouts
       
   238         TAknLayoutRect iExplIconLayout;  
       
   239         TAknLayoutText iExplTitleLayout;
       
   240         RArray<TAknLayoutText> iExplTxtLinesLayout;
       
   241         CArrayFixFlat<TPtrC>* iCurrentDescLineArray; // own
       
   242         
       
   243         TBool iActivateOnTouchRelease;
       
   244 
       
   245         TBool iSkinnedBackGround;        
       
   246         
       
   247     };
       
   248     
       
   249 #endif //CAMINFOLISTBOXCONTAINER_H