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