phonebookengines/VirtualPhonebook/VPbkVCardEng/inc/CVPbkVCardContactFieldIterator.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Iterates contact field's fieldtype and data parsed from 
       
    15 *                CParserProperty.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CVPBKVCARDCONTACTFIELDITERATOR_H
       
    20 #define CVPBKVCARDCONTACTFIELDITERATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <VPbkFieldType.hrh>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CVPbkVCardContactFieldData;
       
    28 class MVPbkContactAttribute;
       
    29 class MVPbkFieldType;
       
    30 class CParserProperty;
       
    31 class CVPbkVCardData;
       
    32 class TVPbkFieldVersitProperty;
       
    33 
       
    34 // CLASS DECLARATIONS    
       
    35 /**
       
    36  * Class has fieldtype-data pairs which could be iterated.
       
    37  */
       
    38 NONSHARABLE_CLASS( CVPbkVCardContactFieldIterator ): public CBase
       
    39     {
       
    40     public: 
       
    41         static CVPbkVCardContactFieldIterator* NewLC
       
    42             ( CParserProperty& aProperty, CVPbkVCardData& aData );
       
    43             
       
    44         ~CVPbkVCardContactFieldIterator();
       
    45         
       
    46     public:
       
    47         void AppendVersitProperty( TVPbkFieldVersitProperty aVersitProperty );    
       
    48         void AppendAttribute( MVPbkContactAttribute* aAttribute );
       
    49         
       
    50         TBool HasNext();
       
    51         CVPbkVCardContactFieldData* NextLC();
       
    52         CVPbkVCardContactFieldData* CurrentLC();
       
    53         TInt FindVCardFieldL(
       
    54             TVPbkFieldTypeName aVCardFieldType, 
       
    55             TVPbkSubFieldType aVCardSubFieldType );
       
    56         
       
    57     private:
       
    58         CVPbkVCardContactFieldIterator( CParserProperty& aProperty, CVPbkVCardData& aData );
       
    59         const MVPbkFieldType* MatchFieldType
       
    60             ( TVPbkFieldVersitProperty& aProperty );
       
    61             
       
    62     private:
       
    63         /// Ref: property which holds data
       
    64         CParserProperty& iProperty;
       
    65         /// Own: field types parsed from iProperty
       
    66         RPointerArray< const MVPbkFieldType > iFieldTypes;
       
    67         /// Own: vcard field types 
       
    68         RArray<TVPbkFieldTypeName> iVCardFieldTypes;
       
    69         /// Own: vcard sub field types 
       
    70         RArray<TVPbkSubFieldType> iVCardSubFieldTypes;
       
    71         /// Ref: vcard engine data
       
    72         CVPbkVCardData& iData;
       
    73         /// Own: cursor pointing current index of iterator
       
    74         TInt iCursor;
       
    75         /// Ref: contact attribute
       
    76         MVPbkContactAttribute* iAttribute;
       
    77     };
       
    78 
       
    79 #endif // CVPBKVCARDCONTACTFIELDITERATOR_H
       
    80 
       
    81 // End of file