phonebookui/Phonebook2/Presentation/inc/CPbk2FieldOrderingManager.h
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 field ordering manager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2FIELDORDERINGMANAGER_H
       
    20 #define CPBK2FIELDORDERINGMANAGER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h> // CBase
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MVPbkFieldType;
       
    27 class TResourceReader;
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 
       
    31 NONSHARABLE_CLASS( CPbk2FieldOrderingManager )
       
    32 :   public CBase
       
    33     {
       
    34     public:
       
    35         /**
       
    36          * Static constructor
       
    37          *
       
    38          * @param aReader a resource reader to the array of 
       
    39          *        PBK2_FIELDTYPE_PRESENTATION_ORDER structures.
       
    40          */
       
    41         static CPbk2FieldOrderingManager* NewL( TResourceReader& aReader );
       
    42 
       
    43         /**
       
    44          * Destructor
       
    45          */
       
    46         ~CPbk2FieldOrderingManager();
       
    47 
       
    48     public: // Interface
       
    49         /**
       
    50          * Returns field ordering of aFieldType based on feature manager.
       
    51          * @param aFieldType A field type which order will be resolved.
       
    52          * @return Ordering of the aFieldType.
       
    53          */
       
    54         TInt OrderingItem( const MVPbkFieldType& aFieldType );
       
    55 
       
    56         /**
       
    57          * Returns add field ordering of aFieldType based on feature manager.
       
    58          * @param aFieldType A field type which order will be resolved.
       
    59          * @return Add ordering of the aFieldType.
       
    60          */
       
    61         TInt AddItemOrdering( const MVPbkFieldType& aFieldType );
       
    62 
       
    63     private: // Implementation
       
    64         CPbk2FieldOrderingManager();
       
    65         void ConstructL( TResourceReader& aReader );
       
    66         TInt ItemIndex( TInt aFieldTypeResId );
       
    67 
       
    68     private: // Data
       
    69         class TFieldTypeOrder
       
    70         {
       
    71         public:
       
    72             /**
       
    73              * @param aReader a resource reader to the structure
       
    74              * PBK2_FIELDTYPE_PRESENTATION_ORDER
       
    75              */
       
    76             TFieldTypeOrder( TResourceReader& aReader );
       
    77             
       
    78             /**
       
    79              * Field type resource id from VPbkEng.rsg
       
    80              */
       
    81             TInt iFieldTypeResId;
       
    82             
       
    83             /**
       
    84              * The number that specifies the location of this field type
       
    85              * in contact presentation (defines the order of fields). 
       
    86              */
       
    87             TInt8 iOrderingItem;
       
    88             
       
    89             /**
       
    90              * The number that specifies the location of this field type
       
    91              * in the UI when adding an new fieldtype to the contact.
       
    92              */
       
    93             TInt8 iAddItemOrdering;
       
    94         };
       
    95         
       
    96         /// Own: an array of ordering items
       
    97         RArray<TFieldTypeOrder> iOrderingItems;
       
    98     };
       
    99 
       
   100 #endif // CPBK2FIELDORDERINGMANAGER_H
       
   101 
       
   102 // End of file