camerauis/cameraapp/generic/inc/CamCaptureSetupMenu.h
changeset 0 1ddebce53859
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Container for the listbox that draws the Capture Setup Menu.*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMCAPTURESETUPMENU_H
       
    19 #define CAMCAPTURESETUPMENU_H
       
    20 
       
    21 // INCLUDES
       
    22 #include "CamContainerBase.h"
       
    23 #include <AknPopupFader.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CCamCaptureSetupMenuListBox;        
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  CCamCaptureSetupMenu  container control class.
       
    32 *  
       
    33 */
       
    34 class CCamCaptureSetupMenu : public CCamContainerBase, public MAknFadedComponent
       
    35     {
       
    36     public: // Constructors and destructor
       
    37 
       
    38         /**
       
    39         * Two-phased constructor.
       
    40         * @since 2.8
       
    41         * @param aController used by the list box model to get list item values.
       
    42         * @param aView the view that this container belongs to.
       
    43         * @param aRect the client rectangular area.
       
    44         * @param aResourceId the id of the resource that will be used to populate the list box.
       
    45         * @param aSelectedItemIndex the index of the selected item.
       
    46         * @return pointer to the created capture setup menu container.
       
    47         */
       
    48         static CCamCaptureSetupMenu* NewL( 
       
    49                                 CCamAppController& aController,
       
    50                                 CAknView& aView, 
       
    51                                 const TRect& aRect, 
       
    52                                 TInt aResourceId, 
       
    53                                 TInt aSelectedItemIndex = 0 );
       
    54         /**
       
    55         * Destructor.
       
    56         * @since 2.8
       
    57         */
       
    58         ~CCamCaptureSetupMenu();
       
    59 
       
    60     public: // New functions
       
    61         /**
       
    62         * Returns the list index of the currently selected item.
       
    63         * @since 2.8
       
    64         * @return the list index
       
    65         */
       
    66         TInt CurrentItemIndex() const;
       
    67 
       
    68         /**
       
    69         * Fades everything behind this menu.
       
    70         * @since 2.8
       
    71         * @param aFade ETrue if everything is to be faded. Otherwise EFalse.
       
    72         */
       
    73         void FadeBehind( TBool aFade );
       
    74 
       
    75     public: // Functions from base class MAknFadedComponent
       
    76 
       
    77         /**
       
    78         * Returns the number of components that are not faded
       
    79         * when the fader object is active.
       
    80         * @since 2.8
       
    81         * @return the number of unfaded components.
       
    82         */
       
    83         TInt CountFadedComponents();
       
    84 
       
    85         /**
       
    86         * Returns a pointer to a non-faded component.
       
    87         * @since 2.8
       
    88         * @param aIndex the index of the non-faded component.
       
    89         * @return the CCoeControl pointer.
       
    90         */
       
    91         CCoeControl* FadedComponent(TInt aIndex);
       
    92 
       
    93     public: // Functions from base classes
       
    94 
       
    95         /**
       
    96         * Handles commands.
       
    97         * @since 2.8
       
    98         * @param aCommand the command id.
       
    99         */
       
   100         void HandleCommandL( TInt aCommand );
       
   101 
       
   102 
       
   103     private: // Constructors.
       
   104         /**
       
   105         * C++ constructor
       
   106         * @since 2.8
       
   107         * @param aController reference to CCamAppController instance
       
   108         * @param aView reference to the view containing this container
       
   109         */
       
   110         CCamCaptureSetupMenu( CCamAppController& aController,
       
   111                                   CAknView& aView );
       
   112 
       
   113         /**
       
   114         * 2nd phase constructor.
       
   115         * @since 2.8
       
   116         * @param aRect Frame rectangle for container.
       
   117         * @param aResourceId the id of the resource to populate the list box with.
       
   118         * @param aSelectedItemIndex the index of the selected item.
       
   119         */
       
   120         void ConstructL( const TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex );
       
   121 
       
   122     private: // Functions from base classes
       
   123 
       
   124         /**
       
   125         * Returns number of component controls in this container.
       
   126         * @since 2.8
       
   127         * @return the number of component controls.
       
   128         */
       
   129         TInt CountComponentControls() const;
       
   130 
       
   131         /**
       
   132         * Returns a component control.
       
   133         * @since 2.8
       
   134         * @param aIndex the index of the desired component control.
       
   135         * @return the component control.
       
   136         */
       
   137         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   138 
       
   139         /**
       
   140         * Draws the container.
       
   141         * @since 2.8
       
   142         * @param aRect the client rectangular area.
       
   143         */
       
   144         void Draw( const TRect& aRect ) const;
       
   145 
       
   146         /**
       
   147         * Handles key events.
       
   148         * @since 2.8
       
   149         * @param aKeyEvent the key event.
       
   150         * @param aType the type of key event.
       
   151         * @return whether the key has been consumed or not.
       
   152         */
       
   153         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   154 
       
   155 
       
   156 
       
   157     private: // New functions
       
   158 
       
   159         /**
       
   160         * Creates the list box.
       
   161         * @since 2.8
       
   162         * @param aRect the client rectangular area.
       
   163         * @param aResourceId the id of the resource to populate the list.
       
   164         * @param aSelectedItemIndex Index of the item to be selected.
       
   165         */
       
   166         void CreateCaptureSetupListBoxL( TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex );
       
   167 
       
   168         /**
       
   169         * Returns the command id for activating the current list item control.
       
   170         * @since 2.8
       
   171         * @return the command id.
       
   172         */
       
   173         TInt CommandIdForActivatingCurrentItemControl();
       
   174 
       
   175         /**
       
   176         * Handles the pressing of the softkey selection.
       
   177         * @since 2.8
       
   178         */
       
   179         void HandleSelectionL();
       
   180 
       
   181     private: //data
       
   182 
       
   183         // The list box.
       
   184         CCamCaptureSetupMenuListBox* iCaptureSetupListBox;
       
   185 
       
   186         // Fader object used to fade everything except this menu and the CBA.
       
   187         TAknPopupFader iPopupFader;
       
   188 
       
   189     };
       
   190 
       
   191 #endif // CAMCAPTURESETUPMENU_H