ipsservices/ipssossettings/inc/ipssetuictrlpageresource.h
branchRCL_3
changeset 64 3533d4323edc
parent 0 8466d47a6819
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     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:  Decleares class to control page resources.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IPSSETUICTRLPAGERESOURCE_H
       
    20 #define IPSSETUICTRLPAGERESOURCE_H
       
    21 
       
    22 
       
    23 /**
       
    24  * Page resources in array
       
    25  */
       
    26 enum TIpsSetUiPageResource
       
    27     {
       
    28     EIpsSetUiRadioButton = 0,
       
    29     EIpsSetUiCheckbox,
       
    30     EIpsSetUiText,
       
    31     EIpsSetUiNumber,
       
    32     EIpsSetUiScNumber,
       
    33     EIpsSetUiSecret,
       
    34     EIpsSetUiMultiLine,
       
    35     EIpsSetUiLastPage
       
    36     };
       
    37 
       
    38 typedef CArrayFixFlat<TInt> CResourceStack;
       
    39 typedef CArrayPtrFlat<CResourceStack> CResourceStackArray;
       
    40 
       
    41 /**
       
    42  * Class to control page resource array.
       
    43  *
       
    44  * @since FS v1.0
       
    45  * @lib IpsSosSettings.lib
       
    46  */
       
    47 NONSHARABLE_CLASS( CIpsSetUiCtrlPageResource ): public CBase
       
    48     {
       
    49 public:  // Constructors and destructor
       
    50 
       
    51     /**
       
    52      * Two-phase constructor with stack push.
       
    53      *
       
    54      * @return Constructed object
       
    55      */
       
    56     static CIpsSetUiCtrlPageResource* NewLC();
       
    57 
       
    58     /**
       
    59      * Create object from CIpsSetUiCtrlPageResource
       
    60      *
       
    61      * @return Constructed object
       
    62      */
       
    63     static CIpsSetUiCtrlPageResource* NewL();
       
    64 
       
    65     /**
       
    66      * Destructor
       
    67      */
       
    68     virtual ~CIpsSetUiCtrlPageResource();
       
    69 
       
    70 // New functions
       
    71 
       
    72     /**
       
    73      * Pushes resource to stack.
       
    74      *
       
    75      * @param aType Type of the resource.
       
    76      * @param aPageResource ID of the resource.
       
    77      */
       
    78     void PushResourceL(
       
    79         const TInt aType,
       
    80         const TInt aPageResource );
       
    81 
       
    82     /**
       
    83      * Retrieves the resource ID from the stack.
       
    84      *
       
    85      * @param aType Type of the resource to be retrieved.
       
    86      * @param aRemove Resource ID should be removed or not.
       
    87      */
       
    88     TInt Resource(
       
    89         const TInt aType,
       
    90         const TBool aRemove = ETrue );
       
    91 
       
    92     /**
       
    93      * @param aType Type of resource to be counted
       
    94      * @return Number of items for resource.
       
    95      */
       
    96     TInt Count( const TInt aType );
       
    97 
       
    98     /**
       
    99      * Creates resource stack.
       
   100      *
       
   101      * @param aPageResource Stack type for creation.
       
   102      * @return Stack object, which client owns.
       
   103      */
       
   104     CResourceStack* CreateStackL( const TInt aPageResource );
       
   105 
       
   106     /**
       
   107      * Accessor for page resource.
       
   108      *
       
   109      * @param aType Resource type.
       
   110      * @return Id of the resource.
       
   111      */
       
   112     TInt operator[]( const TInt aType );
       
   113 
       
   114 protected:  // Constructors
       
   115 
       
   116     /**
       
   117      * Default constructor for class CIpsSetUiCtrlPageResource
       
   118      *
       
   119      * @return, Constructed object
       
   120      */
       
   121     CIpsSetUiCtrlPageResource();
       
   122 
       
   123     /**
       
   124      * Symbian 2-phase constructor
       
   125      */
       
   126     void ConstructL();
       
   127 
       
   128 private:  // New functions
       
   129 
       
   130     // TOOLS
       
   131 
       
   132     /**
       
   133      * @param aType Type of resource.
       
   134      * @return Resource stack of the type.
       
   135      */
       
   136     CResourceStack& Stack( const TInt aType );
       
   137 
       
   138 private:    // Data
       
   139 
       
   140     /**
       
   141      * Page resource array.
       
   142      * Owned.
       
   143      */
       
   144     CResourceStackArray*    iPageResources;
       
   145     };
       
   146 
       
   147 #endif /* IPSSETUICTRLPAGERESOURCE_H */
       
   148 
       
   149 // End of File
       
   150 
       
   151