phonebookui/Phonebook2/inc/TPbk2SortOrderFieldMapper.h
changeset 0 e686773b3f54
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 sort order field mapper.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TPBK2SORTORDERFIELDMAPPER_H
       
    20 #define TPBK2SORTORDERFIELDMAPPER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32def.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MVPbkFieldTypeList;
       
    27 class MVPbkBaseContactFieldCollection;
       
    28 class MVPbkBaseContactField;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  * Phonebook 2 sort order field mapper.
       
    34  * Maps fields in a contact to the same order than in the sort order.
       
    35  */
       
    36 class TPbk2SortOrderFieldMapper
       
    37     {
       
    38     public: // Construction
       
    39 
       
    40         /**
       
    41          * Constructor.
       
    42          */
       
    43         IMPORT_C TPbk2SortOrderFieldMapper();
       
    44 
       
    45     public: // Interface
       
    46 
       
    47         /**
       
    48          * Sets the current sort order that the fields are mapped against.
       
    49          *
       
    50          * @param aSortOrder    New sort order.
       
    51          */
       
    52         IMPORT_C void SetSortOrder(
       
    53                 const MVPbkFieldTypeList& aSortOrder );
       
    54 
       
    55         /**
       
    56          * Sets the contact fields that are mapped.
       
    57          *
       
    58          * @param aContactFields    Fields to be mapped to sort order.
       
    59          */
       
    60         IMPORT_C void SetContactFields(
       
    61                 const MVPbkBaseContactFieldCollection& aContactFields );
       
    62 
       
    63         /**
       
    64          * Returns the number of mapped fields.
       
    65          *
       
    66          * @return  Number of mapped fields.
       
    67          */
       
    68         IMPORT_C TInt FieldCount() const;
       
    69 
       
    70         /**
       
    71          * Returns a field in a contact that is of the same type than
       
    72          * the field at given index in the sort order.
       
    73          *
       
    74          * @param aIndex    Index of the field type in the sort order.
       
    75          * @return  Field that is of the same type than the field type
       
    76          *          at given index in the sort order.
       
    77          */
       
    78         IMPORT_C const MVPbkBaseContactField* FieldAt(
       
    79                 TInt aIndex ) const;
       
    80 
       
    81     private: // Data
       
    82         /// Ref: Current sort order
       
    83         const MVPbkFieldTypeList* iSortOrder;
       
    84         /// Ref: Fields that are mapped to sort order
       
    85         const MVPbkBaseContactFieldCollection* iContactFields;
       
    86     };
       
    87 
       
    88 #endif // TPBK2SORTORDERFIELDMAPPER_H
       
    89 
       
    90 // End of File