camerauis/cameraapp/generic/inc/CamInfoListBoxContainer.h
changeset 0 1ddebce53859
child 12 8c55c525d5d7
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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 
       
    77         /**
       
    78         * Destructor.
       
    79         * @since 2.8
       
    80         */
       
    81         virtual ~CCamInfoListBoxContainer();
       
    82 
       
    83     private:
       
    84         /**
       
    85         * Symbian OS 2nd phase constructor.
       
    86         * @since 2.8
       
    87         * @param aRect Frame rectangle for container.
       
    88         * @param aListBoxResource
       
    89         * @param aSummaryResource
       
    90         */
       
    91         void ConstructL( const TRect& aRect, TInt aListBoxResource, TInt aSummaryResource, TInt aTitleResource  );
       
    92         
       
    93         /**
       
    94         * C++ constructor
       
    95         * @since 2.8
       
    96         * @param aController reference to CCamAppControllerBase instance
       
    97         * @param aView Reference to the view containing this container
       
    98         * @param aSettingValue Initial setting value
       
    99         * display the base scenes for the user scene.
       
   100         */
       
   101         CCamInfoListBoxContainer(   CCamAppController& aController,
       
   102                                     CAknView& aView,
       
   103                                     TInt aSettingValue );
       
   104 
       
   105     public: 
       
   106         
       
   107         /**
       
   108         * Gets the settings item value ID of the current item
       
   109         * @since 2.8
       
   110         * @return the settings item value of the currently highlighted item
       
   111         */
       
   112         TInt CurrentSettingItemValue() const;
       
   113         
       
   114         /**
       
   115         * Returns ETrue if the setting item value has changed
       
   116         * @since 2.8
       
   117         * @return setting value change status
       
   118         */        
       
   119         TBool SettingValueChanged() const;
       
   120         
       
   121         /**
       
   122         * Gets the index in the item array that has the specified settings 
       
   123         * item value ID of the current item
       
   124         * @since 3.0
       
   125         * @return the index of the item with the specified value id
       
   126         */
       
   127         TInt IndexForValueId( TInt aValueId ) const;
       
   128         
       
   129    public: //Functions from base classes
       
   130         /**
       
   131         * From MCamSettingValueObserver
       
   132         * Handles a change in the slider value
       
   133         * @since 2.8
       
   134         * @param aNewValue the new value of the setting
       
   135         */ 
       
   136         void HandleSettingValueUpdateL( TInt aNewValue );
       
   137         
       
   138  
       
   139     protected: // Functions from base classes
       
   140         /**
       
   141         * From CoeControl
       
   142         * @since 2.8
       
   143         * @return number of contained controls
       
   144         */
       
   145         TInt CountComponentControls() const;
       
   146 
       
   147         /**
       
   148         * From CCoeControl
       
   149         * @since 2.8
       
   150         * @param aIndex The index of the required control
       
   151         * @return Returns the requested control
       
   152         */
       
   153         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   154 
       
   155         /**
       
   156         * From CCoeControl
       
   157         * @since 2.8
       
   158         * @param aRect area where to draw
       
   159         */
       
   160         void Draw( const TRect& aRect ) const;
       
   161 
       
   162         /**
       
   163         * From CamContainerBase 
       
   164         * @since 2.8
       
   165         * @param aKeyEvent the key event
       
   166         * @param aType the type of the event
       
   167         * @return TKeyResponse key event was used by this control or not
       
   168         */
       
   169         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   170                                      TEventCode aType );
       
   171 
       
   172     private: 
       
   173         /**
       
   174         * Sets up the summary pane detail arrays
       
   175         * @since 2.8
       
   176         * @param aResourceId The resource that defines the summary pane details
       
   177         */
       
   178         void ConstructSummaryDetailsFromResourceL(TInt aResourceId);
       
   179 
       
   180         
       
   181         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   182         /**
       
   183          * From MEikListBoxObserver
       
   184          */
       
   185         void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   186         void ShowTooltipL();
       
   187         void ConstructContainerTitleFromResourceL( TInt aResourceId );
       
   188         
       
   189         /**
       
   190         * Draws the summary title and description text
       
   191         * @param aGc The graphics context to draw to
       
   192         */
       
   193         void DrawSummaryTextL( CWindowGc& aGc ) const;
       
   194         
       
   195         /**
       
   196         * Read touch layout
       
   197         * @return TRect, listbox rectangle
       
   198         */
       
   199         TRect TouchLayout();
       
   200 
       
   201         /**
       
   202         * Read non-touch layout
       
   203         * @return TRect, listbox rectangle
       
   204         */
       
   205         TRect NonTouchLayout();
       
   206         
       
   207     private: // data
       
   208         
       
   209         // The listbox itself
       
   210 				CCamInfoListBox* iListBox;
       
   211 
       
   212         // Array of bitmaps for the large summary icon
       
   213         RPointerArray<CFbsBitmap> iSummaryBitmapArray;        
       
   214         // Array of all shooting mode titles
       
   215         RPointerArray<HBufC> iTitleArray;
       
   216         // Array of all shooting mode descriptions
       
   217         RPointerArray<HBufC> iDescArray;
       
   218              
       
   219         TInt iSettingValue;
       
   220         
       
   221         		
       
   222 		// The text shown as the title of the container
       
   223         HBufC16* iListboxTitle;
       
   224         
       
   225         // info tooltip
       
   226         CAknInfoPopupNoteController* iTooltipController;
       
   227         TBool iShowTooltip;
       
   228         TInt iTooltipIndex;
       
   229         
       
   230         // Layout rect for title text
       
   231         TAknLayoutText iTitleTextRectLayout;  
       
   232         TAknLayoutRect iListboxLayoutRect; 
       
   233         TRect iLayoutAreaRect;  
       
   234         TRect iExplanationRect; 
       
   235         TInt iExplLineCount; // Number of available layouts
       
   236         TAknLayoutRect iExplIconLayout;  
       
   237         TAknLayoutText iExplTitleLayout;
       
   238         RArray<TAknLayoutText> iExplTxtLinesLayout;
       
   239         CArrayFixFlat<TPtrC>* iCurrentDescLineArray; // own
       
   240         
       
   241         TBool iActivateOnTouchRelease;
       
   242 
       
   243         MTouchFeedback* iFeedback; // not own 
       
   244         
       
   245     };
       
   246     
       
   247 #endif //CAMINFOLISTBOXCONTAINER_H