camerauis/cameraapp/generic/inc/CamShootingModeContainer.h
branchRCL_3
changeset 54 bac7acad7cb3
equal deleted inserted replaced
53:61bc0f252b2b 54: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 CAMSHOOTINGMODECONTAINER_H
       
    19 #define CAMSHOOTINGMODECONTAINER_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 <AknInfoPopupNoteController.h> 
       
    28 #include <eiklbo.h>
       
    29 
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class MAknQueryValue;
       
    41 class CCamSceneListBox;
       
    42 class CAknInfoPopupNoteController;
       
    43 class MTouchFeedback;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  Implements the Shooting Mode Setting control and descriptive texts
       
    49 *
       
    50 *  @since 2.8
       
    51 */
       
    52 
       
    53 
       
    54 class CCamShootingModeContainer : public CCamContainerBase, 
       
    55                                   public MCamSettingValueObserver,
       
    56                                   public MEikListBoxObserver
       
    57             {
       
    58     public: // Constructors and destructor
       
    59         
       
    60         /**
       
    61         * Symbian OS two-phased constructor
       
    62         * @since 2.8
       
    63         * @param aRect Frame rectangle for container.
       
    64         * @param aView Reference to the view containing this container
       
    65         * @param aMode Current capture mode
       
    66         * @param aController reference to CCamAppControllerBase instance
       
    67         * @param aUserBaseScenes Specifies whether this list should
       
    68         * display the base scenes for the user scene.
       
    69         */
       
    70         static CCamShootingModeContainer* NewL( const TRect& aRect, 
       
    71                                                  CAknView& aView,
       
    72                                                  TCamCameraMode aMode,
       
    73                                                  CCamAppController& aController,
       
    74                                                  TBool aUserBaseScenes = EFalse );
       
    75 
       
    76         /**
       
    77         * Symbian OS two-phased constructor
       
    78         * @since 2.8
       
    79         * @param aRect Frame rectangle for container.
       
    80         * @param aView Reference to the view containing this container
       
    81         * @param aMode Current capture mode
       
    82         * @param aController reference to CCamAppControllerBase instance
       
    83         * @param aUserBaseScenes Specifies whether this list should
       
    84         * display the base scenes for the user scene.
       
    85         * @param aFullySkinned Specifies whether this list should
       
    86         * be displayed as transparent or skinned background.
       
    87         */
       
    88         static CCamShootingModeContainer* NewL( const TRect& aRect, 
       
    89                                                  TBool aFullySkinned,
       
    90                                                  CAknView& aView,
       
    91                                                  TCamCameraMode aMode,
       
    92                                                  CCamAppController& aController,
       
    93                                                  TBool aUserBaseScenes );        
       
    94         
       
    95         /**
       
    96         * Destructor.
       
    97         * @since 2.8
       
    98         */
       
    99         virtual ~CCamShootingModeContainer();
       
   100 
       
   101     private:
       
   102         /**
       
   103         * Symbian OS 2nd phase constructor.
       
   104         * @since 2.8
       
   105         * @param aRect Frame rectangle for container.
       
   106         */
       
   107         void ConstructL( const TRect& aRect );
       
   108         
       
   109         /**
       
   110         * C++ constructor
       
   111         * @since 2.8
       
   112         * @param aMode Current capture mode
       
   113         * @param aController reference to CCamAppControllerBase instance
       
   114         * @param aView Reference to the view containing this container
       
   115         * @param aUserBaseScenes Specifies whether this list should
       
   116         * display the base scenes for the user scene.
       
   117         */
       
   118         CCamShootingModeContainer( TCamCameraMode aMode, 
       
   119                                     CCamAppController& aController,
       
   120                                     CAknView& aView,
       
   121                                     TBool aUserBaseScenes,
       
   122                                     TBool aFullySkinned=ETrue );
       
   123 
       
   124     public: // New functions
       
   125         /**
       
   126         * Is the user scene currently selected
       
   127         * @since 2.8
       
   128         * @return ETrue if user scene highlighted
       
   129         */
       
   130         TBool UserSceneHighlighted();
       
   131 
       
   132         /** 
       
   133         * Saves the selected scene in dynamic settings
       
   134         * @since 2.8
       
   135         * @return ETrue if the scene setting was changed successfully.
       
   136         */
       
   137         TBool SaveSceneSettingL();
       
   138 
       
   139         /** 
       
   140         * Saves the selected scene in dynamic settings if the scene
       
   141         * mode has changed from current value.
       
   142         * @since S60 v5.0
       
   143         * @return ETrue if the scene setting was changed successfully.
       
   144         */
       
   145         TBool SaveSceneSettingIfChangedL();
       
   146 
       
   147         /**
       
   148         * Gets the settings item value ID of the current item
       
   149         * @since 2.8
       
   150         * @return the settings item value of the currently highlighted item
       
   151         */
       
   152         TInt CurrentSettingItemValue() const;
       
   153         
       
   154         /**
       
   155         * Gets the index in the item array that has the specified settings 
       
   156         * item value ID of the current item
       
   157         * @since 3.0
       
   158         * @return the index of the item with the specified value id
       
   159         */
       
   160         TInt IndexForValueId( TInt aValueId ) const;
       
   161         
       
   162         /**
       
   163          * Hilights the given item on scene listbox
       
   164          * @return returns false if item cannot be selected
       
   165          */
       
   166         TBool SelectItem( TInt aItemIndex );
       
   167         
       
   168    public: //Functions from base classes
       
   169         /**
       
   170         * From MCamSettingValueObserver
       
   171         * Handles a change in the slider value
       
   172         * @since 2.8
       
   173         * @param aNewValue the new value of the setting
       
   174         */ 
       
   175         void HandleSettingValueUpdateL( TInt aNewValue );
       
   176         
       
   177     protected: // Functions from base classes
       
   178         /**
       
   179         * From CoeControl
       
   180         * @since 2.8
       
   181         * @return number of contained controls
       
   182         */
       
   183         TInt CountComponentControls() const;
       
   184 
       
   185         /**
       
   186         * From CCoeControl
       
   187         * @since 2.8
       
   188         * @param aIndex The index of the required control
       
   189         * @return Returns the requested control
       
   190         */
       
   191         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   192 
       
   193         /**
       
   194         * From CCoeControl
       
   195         * @since 2.8
       
   196         * @param aRect area where to draw
       
   197         */
       
   198         void Draw( const TRect& aRect ) const;
       
   199 
       
   200         /**
       
   201         * From CamContainerBase 
       
   202         * @since 2.8
       
   203         * @param aKeyEvent the key event
       
   204         * @param aType the type of the event
       
   205         * @return TKeyResponse key event was used by this control or not
       
   206         */
       
   207         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   208                                      TEventCode aType );
       
   209 
       
   210     private: 
       
   211         
       
   212 
       
   213       /**
       
   214       * Sets up the summary pane detail arrays
       
   215       * @since 2.8
       
   216       * @param aResourceId The resource that defines the summary pane details
       
   217       */
       
   218       void ConstructSummaryDetailsFromResourceL(TInt aResourceId);
       
   219       
       
   220       
       
   221       /**
       
   222       * Select the resource for summary texts.
       
   223       * @return Resource id of the summaries.
       
   224       */
       
   225       TInt SelectSummaryResourceL();
       
   226 
       
   227       /**
       
   228       * Get if the given scene is supported.
       
   229       */
       
   230       TBool IsSupportedScene( TInt aSceneId ) const;
       
   231 
       
   232       /**
       
   233       * Draws the summary title and description text
       
   234       * @param aGc The graphics context to draw to
       
   235       */
       
   236       void DrawSummaryTextL( CWindowGc& aGc ) const;
       
   237 
       
   238       /**
       
   239       * Read touch layout
       
   240       * @return TRect, listbox rectangle
       
   241       */
       
   242       TRect TouchLayout();
       
   243 
       
   244       /**
       
   245       * Read non-touch layout
       
   246       * @return TRect, listbox rectangle
       
   247       */
       
   248       TRect NonTouchLayout(); 
       
   249 
       
   250     public:
       
   251      
       
   252      /**
       
   253      * From CCoeControl
       
   254      */
       
   255      void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   256      
       
   257      /**
       
   258       * From MEikListBoxObserver
       
   259       */
       
   260      void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   261      /**
       
   262      * Displays tooltip for the selected listbox item
       
   263      */
       
   264      void ShowTooltipL();
       
   265      
       
   266      /**
       
   267      * Hides tooltip for the selected listbox item, if one is visible
       
   268      */
       
   269      void HideCurrentTooltipL();
       
   270      
       
   271      /**
       
   272      * Reads the title text from given resource
       
   273      * @param aResourceId The resource that defines the summary pane details
       
   274      */
       
   275      void ConstructContainerTitleFromResourceL( TInt aResourceId );
       
   276      
       
   277         
       
   278     private: // data
       
   279         
       
   280       // the shooting mode list box
       
   281       CCamSceneListBox* iListBox;
       
   282 
       
   283       // the capture mode (video/still)
       
   284       TCamCameraMode iMode;
       
   285       // Specifies whether or not the scene list is for 
       
   286       // the user base scenes
       
   287       TBool iUserBaseScenes;
       
   288 
       
   289       TBool iFullySkinned;
       
   290       // Array of bitmaps for the large summary icon
       
   291       RPointerArray<CFbsBitmap> iSummaryBitmapArray;        
       
   292       // Array of all shooting mode titles
       
   293       RPointerArray<HBufC> iTitleArray;
       
   294       // Array of all shooting mode descriptions
       
   295       RPointerArray<HBufC> iDescArray;
       
   296        
       
   297       
       
   298       // Array of supported scenes
       
   299       RArray<TInt> iSupportedScenes;
       
   300 
       
   301         // The text shown as the title of the container
       
   302       HBufC* iTitleText;
       
   303 
       
   304       // Layout rect for title text
       
   305       TAknLayoutText iTitleTextRectLayout;  
       
   306       TAknLayoutRect iListboxLayoutRect; 
       
   307 
       
   308       TRect iLayoutAreaRect;  // Scene setting
       
   309       TRect iExplanationRect; 
       
   310       TInt iExplLineCount;  // Number of available layouts
       
   311       TAknLayoutRect iExplIconLayout; 
       
   312       TAknLayoutText iExplTitleLayout;
       
   313       RArray<TAknLayoutText> iExplTxtLinesLayout;
       
   314       CArrayFixFlat<TPtrC>* iCurrentDescLineArray; // own
       
   315         
       
   316       CAknInfoPopupNoteController* iTooltipController;
       
   317       TBool iShowTooltip;
       
   318       HBufC16* iListboxTitle;
       
   319       TInt iTooltipIndex;
       
   320         
       
   321       TBool iActivateOnTouchRelease;
       
   322 
       
   323     };
       
   324     
       
   325 #endif //CAMSHOOTINGMODECONTAINER_H