camerauis/cameraapp/generic/inc/CamUserSceneSetupListItem.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:  A user scene setup list item.*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMUSERSCENESETUPLISTITEM_H
       
    19 #define CAMUSERSCENESETUPLISTITEM_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32def.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 
       
    27 // CLASS DECLARATION
       
    28 class TResourceReader;
       
    29 
       
    30 // CONSTANTS
       
    31 const TInt KListItemMaximumSubTextLength = 50;
       
    32 const TInt KListItemMaximumFullTextLength = 120;
       
    33 
       
    34 
       
    35 /**
       
    36 *  A user scene setup list item.  
       
    37 *  
       
    38 */
       
    39 class CCamUserSceneSetupListItem: public CBase
       
    40     {
       
    41     public: // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Symbian two-phased constructor.
       
    45         * @param resource Id for current item
       
    46         * @return pointer to the created CCamUserSceneSetupListItem object.
       
    47         * @since 2.8
       
    48         */
       
    49         static CCamUserSceneSetupListItem* NewLC( TInt aResId );
       
    50         /**
       
    51         * Symbian two-phased constructor.
       
    52         * @param resource Id for current item
       
    53         * @return pointer to the created CCamUserSceneSetupListItem object.
       
    54         * @since 2.8
       
    55         */
       
    56         static CCamUserSceneSetupListItem* NewL( TInt aResId );
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         * @since 2.8
       
    61         */
       
    62         ~CCamUserSceneSetupListItem();
       
    63 
       
    64     public: // New functions
       
    65         /**
       
    66         * Returns the formatted text of this item to be used in the list box
       
    67         * @since 2.8
       
    68         * @return pointer to the formatted text
       
    69         */
       
    70         TPtrC16 ListBoxText();
       
    71         /**
       
    72         * Returns the settings model item id that is associated with this
       
    73         * list item.
       
    74         * @since 2.8
       
    75         * @return the settings model item id.
       
    76         */
       
    77         TInt SettingsModelTypeId();
       
    78         /**
       
    79         * Sets the current value of this list item
       
    80         * @since 2.8
       
    81         * @param the new value.
       
    82         */
       
    83         void SetCurrentValue( TInt aNewValue );
       
    84 
       
    85 
       
    86     private: // Constructors
       
    87         /**
       
    88         * C++ Constructor
       
    89         * @since 2.8
       
    90         */
       
    91         CCamUserSceneSetupListItem();
       
    92         /**
       
    93         * 2nd phase Constructor
       
    94         * @param resource Id for current item.
       
    95         * @since 2.8
       
    96         */
       
    97         void ConstructL( TInt aResId );
       
    98      
       
    99     private: // New functions
       
   100         /**
       
   101         * Returns the name of the setting type represented by this
       
   102         * list item.
       
   103         * @return the name text.
       
   104         * @since 2.8
       
   105         */
       
   106         TPtrC SettingName() const;
       
   107         /**
       
   108         * Returns the text for the current setting value of this item
       
   109         * @return the setting text.
       
   110         * @since 2.8
       
   111         */
       
   112         TPtrC SettingText();
       
   113 
       
   114 
       
   115     private: //data
       
   116         // type that couples a value id with a textual description.
       
   117         class CValueTextPair: public CBase
       
   118             {
       
   119             public: // Data.
       
   120                 // The settings model id of the value.
       
   121                 TInt iSettingsModelId;    
       
   122                 // The textual description of the value.
       
   123                 TBuf<KListItemMaximumSubTextLength> iText;
       
   124             };
       
   125 
       
   126         // A list of all possible values for this list item, and
       
   127         // their associated text.
       
   128         RPointerArray<CValueTextPair> iValues;
       
   129         // The pair index that is associated with the current settings
       
   130         // model value for this list item.
       
   131         TInt iCurrentPairIndex;
       
   132 
       
   133         // The setting model id for this list item type.
       
   134         TInt iSettingsModelItemId;
       
   135         // The name of this list item type, e.g. "White balance"
       
   136         TBuf<KListItemMaximumSubTextLength> iName;
       
   137         // The text for the current value of this item.
       
   138         TBuf<KListItemMaximumSubTextLength> iValueText;
       
   139         // The full formatted text for this list item.
       
   140         TBufC<KListItemMaximumFullTextLength> iListBoxText;
       
   141     };
       
   142 
       
   143 #endif // CAMUSERSCENESETUPLISTITEM_H
       
   144 
       
   145 // End of File