camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListItem.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     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:  Encapsulates the data for a particular Capture Setup Menu item.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef CAMCAPTURESETUPMENULISTITEM_H
       
    20 #define CAMCAPTURESETUPMENULISTITEM_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32des16.h>
       
    25  
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CFbsBitmap;
       
    29 class TResourceReader;
       
    30 
       
    31 // CONSTANTS
       
    32 const TInt KListItemMaximumTextLength = 40;
       
    33 const TInt KListItemMaximumIconTextLength = 5;
       
    34 
       
    35 typedef TBuf<KListItemMaximumIconTextLength> TIconText;
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Encapsulates the data for a particular Capture Setup Menu item.
       
    42 *  @since 2.8
       
    43 */
       
    44 class CCamCaptureSetupMenuListItem: public CBase
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         * @param aReader reader that is used to construct the data for this list item
       
    51         * @return pointer to the created list item.
       
    52         */
       
    53         static CCamCaptureSetupMenuListItem* NewL( TResourceReader& aReader );
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         ~CCamCaptureSetupMenuListItem();
       
    59 
       
    60     public: // New functions
       
    61         
       
    62         /**
       
    63         * Returns the bitmap that represents the current settings model 
       
    64         * value for this list item.
       
    65         * @since 2.8
       
    66         * @return A pointer to the bitmap.
       
    67         */
       
    68         CFbsBitmap* Bitmap() const;
       
    69 
       
    70         /**
       
    71         * Returns the mask that represents the current settings model 
       
    72         * value for this list item.
       
    73         * @since 2.8
       
    74         * @return A pointer to the bitmap.
       
    75         */
       
    76         CFbsBitmap* Mask() const;
       
    77 
       
    78         /**
       
    79         * Returns text used in place of an icon for this list item.
       
    80         * @since 2.8
       
    81         * @param aSettingVal The setting value used to return the text for
       
    82         * @return A reference to the icon text.
       
    83         */
       
    84         const TDesC& IconText( TInt aSettingVal ) const;
       
    85 
       
    86         /**
       
    87         * Returns text that describes the setting represented by this list item. 
       
    88         * @since 2.8
       
    89         * @return A reference to the text.
       
    90         */
       
    91         const TDesC& Text() const;
       
    92 
       
    93         /**
       
    94         * Returns the cached settings model value that the current bitmap represents. 
       
    95         * @since 2.8
       
    96         * @return the cached settings model value.
       
    97         */
       
    98         TInt CurrentValue() const;
       
    99 
       
   100         /**
       
   101         * Returns the id of the settings model item that this list item represents. 
       
   102         * @since 2.8
       
   103         * @return the settings model item id.
       
   104         */
       
   105         TInt SettingsModelItemId() const;
       
   106 
       
   107         /**
       
   108         * Changes the cached settings model value and the bitmap that represents it. 
       
   109         * @since 2.8
       
   110         * @param aNewValueId the new settings model value id.
       
   111         */
       
   112         void SetValueTo( TInt aNewValueId );
       
   113 
       
   114     private: // Constructors
       
   115  
       
   116         /**
       
   117         * C++ default constructor.
       
   118         * @since 2.8
       
   119         */
       
   120         CCamCaptureSetupMenuListItem();
       
   121 
       
   122         /**
       
   123         * By default Symbian 2nd phase constructor is private.
       
   124         * @since 2.8
       
   125         * @param aReader reader that is used to construct the data for this list item
       
   126         * from resources
       
   127         */
       
   128         void ConstructFromResourceL( TResourceReader& aReader );
       
   129 
       
   130     private: // New functions
       
   131         /**
       
   132         * Returns the array index for the brightness/contrast setting value
       
   133         * @since 2.8
       
   134         * @param aValue  in:the setting value to map to an array index
       
   135         *                out: the array index
       
   136         */
       
   137         void GetBrightnessContrastArrayIndex( TInt& aValue ) const;
       
   138 
       
   139     private:    // Data
       
   140         // Provides a list of all the bitmaps that are associated with
       
   141         // a particular setting item value id.
       
   142         RPointerArray<CFbsBitmap> iBitmaps;
       
   143         RPointerArray<CFbsBitmap> iMasks;
       
   144 
       
   145         // Text to be used in place of an icon for this list item.
       
   146         CArrayFixFlat<TIconText>* iIconTexts;
       
   147 
       
   148         // id of the setting item that is associated with this list item.
       
   149         TInt iSettingsModelItemId;
       
   150 
       
   151         // The text description for this list item.
       
   152         TBuf<KListItemMaximumTextLength> iText;
       
   153 
       
   154         // The settings model id of the currently set value for this list item.
       
   155         TInt iCurrentSettingItemValueId;
       
   156     };
       
   157 
       
   158 #endif      // CAMCAPTURESETUPMENULISTITEM_H   
       
   159             
       
   160 // End of File