phonebookui/Phonebook2/remotecontactlookup/contactactionservice/inc/CFscFieldPropertyGroup.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 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:  Field property group.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFSCFIELDPROPERTYGROUP_H
       
    20 #define CFSCFIELDPROPERTYGROUP_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <TPbk2IconId.h>
       
    25 #include <Pbk2FieldProperty.hrh>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class TResourceReader;
       
    29 class MPbk2FieldProperty;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * Field property group.
       
    35  * Field property group for field types.
       
    36  */
       
    37 class CFscFieldPropertyGroup : public CBase
       
    38     {
       
    39 public:
       
    40     // Constructors and destructor
       
    41 
       
    42     /**
       
    43      * Creates a new instance of this class.
       
    44      *
       
    45      * @param aReader   Resource reader pointed to a
       
    46      *                  PHONEBOOK2_FIELD_GROUP resource.
       
    47      * @return  A new instance of this class.
       
    48      */
       
    49     static CFscFieldPropertyGroup* NewLC(TResourceReader& aReader);
       
    50 
       
    51     /**
       
    52      * Destructor.
       
    53      */
       
    54     virtual ~CFscFieldPropertyGroup();
       
    55 
       
    56 public:
       
    57     // Interface
       
    58 
       
    59     /**
       
    60      * Returns the number of field properties in the group.
       
    61      *
       
    62      * @return  Number of field properties in the group.
       
    63      */
       
    64     TInt Count() const;
       
    65 
       
    66     /**
       
    67      * Returns the field property at given index.
       
    68      *
       
    69      * @param aIndex    The index of the property.
       
    70      * @return  Field property in given index.
       
    71      */
       
    72     const MPbk2FieldProperty& At(
       
    73             TInt aIndex ) const;
       
    74 
       
    75     /**
       
    76      * Returns the id of this group.
       
    77      *
       
    78      * @return  Id of the group.
       
    79      */
       
    80     inline TPbk2FieldGroupId GroupId() const;
       
    81 
       
    82     /**
       
    83      * Returns the label of this group.
       
    84      *
       
    85      * @return  The label of this group.
       
    86      */
       
    87     inline const TDesC& Label() const;
       
    88 
       
    89     /**
       
    90      * Returns the icon id of this group.
       
    91      *
       
    92      * @return  Icon id of this group.
       
    93      */
       
    94     inline const TPbk2IconId& IconId() const;
       
    95 
       
    96     /**
       
    97      * Returns the add item ordering of this group.
       
    98      *
       
    99      * @return  Add item ordering of this group.
       
   100      */
       
   101     inline TInt AddItemOrdering() const;
       
   102 
       
   103     /**
       
   104      * A private API function to add properties to the group.
       
   105      *
       
   106      * @param aProperty     A new property to add.
       
   107      */
       
   108     void AddFieldPropertyL(
       
   109             const MPbk2FieldProperty& aProperty );
       
   110 
       
   111 private: // Implementation
       
   112     CFscFieldPropertyGroup();
       
   113     void ConstructL(
       
   114             TResourceReader& aReader );
       
   115 
       
   116 private: // Data
       
   117     /// Own: The id of the group
       
   118     TPbk2FieldGroupId iGroupId;
       
   119     /// Own: Label of this group
       
   120     HBufC* iLabel;
       
   121     /// Own: Icon Id of this group
       
   122     TPbk2IconId iIconId;
       
   123     /// Own: Add item ordering of this group
       
   124     TInt iAddItemOrdering;
       
   125     /// Own: Does not own the instances
       
   126     RPointerArray<const MPbk2FieldProperty> iProperties;
       
   127     };
       
   128 
       
   129 // INLINE IMPLEMENTATION
       
   130 
       
   131 // --------------------------------------------------------------------------
       
   132 // CFscFieldPropertyGroup::GroupId
       
   133 // --------------------------------------------------------------------------
       
   134 //
       
   135 inline TPbk2FieldGroupId CFscFieldPropertyGroup::GroupId() const
       
   136     {
       
   137     return iGroupId;
       
   138     }
       
   139 
       
   140 // --------------------------------------------------------------------------
       
   141 // CFscFieldPropertyGroup::Label
       
   142 // --------------------------------------------------------------------------
       
   143 //
       
   144 inline const TDesC& CFscFieldPropertyGroup::Label() const
       
   145     {
       
   146     return *iLabel;
       
   147     }
       
   148 
       
   149 // --------------------------------------------------------------------------
       
   150 // CFscFieldPropertyGroup::IconId
       
   151 // --------------------------------------------------------------------------
       
   152 //
       
   153 inline const TPbk2IconId& CFscFieldPropertyGroup::IconId() const
       
   154     {
       
   155     return iIconId;
       
   156     }
       
   157 
       
   158 // --------------------------------------------------------------------------
       
   159 // CFscFieldPropertyGroup::AddItemOrdering
       
   160 // --------------------------------------------------------------------------
       
   161 //
       
   162 inline TInt CFscFieldPropertyGroup::AddItemOrdering() const
       
   163     {
       
   164     return iAddItemOrdering;
       
   165     }
       
   166 
       
   167 #endif // CFSCFIELDPROPERTYGROUP_H
       
   168 // End of File