epoc32/include/app/CVPbkContactFieldIterator.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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:  Virtual Phonebook contact field iterator interface.
    15 *
    16 */
    17 
    18 
    19 #ifndef CVPBKCONTACTFIELDITERATOR_H
    20 #define CVPBKCONTACTFIELDITERATOR_H
    21 
    22 // INCLUDES
    23 #include <e32base.h>
    24 #include <mvpbkstorecontactfield.h>
    25 
    26 // FORWARD DECLARATIONS
    27 class MVPbkStoreContactFieldCollection;
    28 class MVPbkBaseContactFieldCollection;
    29 class MVPbkFieldType;
    30 class MVPbkFieldTypeList;
    31 class MVPbkStoreContactField;
    32 class CStoreFieldByTypeIterator;
    33 class CBaseFieldByTypeIterator;
    34 class CBaseFieldByTypeListIterator;
    35 class MVPbkBaseContactField;
    36 
    37 /**
    38  * Virtual Phonebook contact field iterator interface.
    39  */
    40 class MVPbkBaseContactFieldIterator
    41     {
    42     public: // Construction
    43 	    /**
    44     	 * Destructor.
    45     	 */ 
    46         virtual ~MVPbkBaseContactFieldIterator() { }
    47 
    48     public: // Interface
    49         /**
    50          * Returns the next field, otherwise NULL.
    51          *
    52          * @return The next field, otherwise NULL.
    53          */
    54         virtual const MVPbkBaseContactField* Next() const =0;
    55 
    56         /**
    57          * Returns ETrue if there exists a next field, else EFalse.
    58          */
    59         virtual TBool HasNext() const =0;
    60 
    61     };
    62 
    63 /**
    64  * Virtual Phonebook contact field iterator interface.
    65  */
    66 class MVPbkContactFieldIterator : public MVPbkBaseContactFieldIterator
    67     {
    68     public: // Construction
    69     	/**
    70     	 * Destructor.
    71     	 */
    72         virtual ~MVPbkContactFieldIterator() { }
    73 
    74     public: // Interface
    75         // From MVPbkBaseContactFieldIterator (covariant return types))
    76         const MVPbkStoreContactField* Next() const =0;
    77 
    78         /**
    79          * Returns the next field, otherwise NULL.
    80          *
    81          * @return The next field, otherwise NULL. Ownership doesn't change.
    82          */
    83         virtual MVPbkStoreContactField* Next() =0;
    84     };
    85 
    86 /**
    87  * Virtual Phonebook contact field type iterator.
    88  * Iterates the contact fields according to the field type specified.
    89  */
    90 class CVPbkBaseContactFieldTypeIterator :
    91         public CBase,
    92         public MVPbkBaseContactFieldIterator
    93     {
    94     public: // Construction
    95         /**
    96          * Constructor for iterating store contact fields.
    97          *.
    98          * @param aFieldType    Field type which is iterated.
    99          * @param aFields       Contact fields to iterate.
   100          * @return A new instance of this class
   101          */
   102         IMPORT_C static CVPbkBaseContactFieldTypeIterator* NewLC(
   103                 const MVPbkFieldType& aFieldType,
   104                 const MVPbkBaseContactFieldCollection& aFields);
   105 
   106         /**
   107          * Destructor.
   108          */
   109         ~CVPbkBaseContactFieldTypeIterator();
   110 
   111     public: // from MVPbkContactFieldIterator
   112         const MVPbkBaseContactField* Next() const;
   113         TBool HasNext() const;
   114 
   115     private: // implementation
   116         void ConstructL(
   117             const MVPbkFieldType& aFieldType,
   118             const MVPbkBaseContactFieldCollection& aFields );
   119 
   120     private: // Data
   121         /// Own: the iterator implementation
   122         CBaseFieldByTypeIterator* iIterator;
   123     };
   124 
   125 /**
   126  * Virtual Phonebook contact field type list iterator.
   127  * Iterates the contact fields according to the field types specified.
   128  */
   129 class CVPbkBaseContactFieldTypeListIterator :
   130         public CBase,
   131         public MVPbkBaseContactFieldIterator
   132     {
   133     public: // Construction
   134         /**
   135          * Constructor for iterating store contact fields.
   136          *.
   137          * @param aFieldTypeList    Field type list which is iterated.
   138          * @param aFields       Contact fields to iterate.
   139          * @return A new instance of this class
   140          */
   141         IMPORT_C static CVPbkBaseContactFieldTypeListIterator* NewLC(
   142                 const MVPbkFieldTypeList& aFieldTypeList,
   143                 const MVPbkBaseContactFieldCollection& aFields);
   144 
   145         /**
   146          * Destructor.
   147          */
   148         ~CVPbkBaseContactFieldTypeListIterator();
   149 
   150     public: // from MVPbkContactFieldIterator
   151         const MVPbkBaseContactField* Next() const;
   152         TBool HasNext() const;
   153 
   154     private: // implementation
   155         void ConstructL(
   156             const MVPbkFieldTypeList& aFieldTypeList,
   157             const MVPbkBaseContactFieldCollection& aFields );
   158 
   159     private: // Data
   160         /// Own: the iterator implementation
   161         CBaseFieldByTypeListIterator* iIterator;
   162     };
   163 
   164 /**
   165  * Virtual Phonebook contact field type iterator.
   166  * Iterates the store contact fields according to the 
   167  * field type specified.
   168  */
   169 class CVPbkContactFieldTypeIterator :
   170         public CBase,
   171         public MVPbkContactFieldIterator
   172     {
   173     public: // Construction
   174         /**
   175          * Constructor for iterating store contact fields.
   176          *.
   177          * @param aFieldType    Field type which is iterated.
   178          * @param aFields       Contact fields to iterate.
   179          * @return A new instance of this class
   180          */
   181         IMPORT_C static CVPbkContactFieldTypeIterator* NewLC(
   182                 const MVPbkFieldType& aFieldType,
   183                 MVPbkStoreContactFieldCollection& aFields);
   184 
   185         /**
   186          * Destructor.
   187          */
   188         ~CVPbkContactFieldTypeIterator();
   189 
   190     public: // from MVPbkContactFieldIterator
   191         const MVPbkStoreContactField* Next() const;
   192         TBool HasNext() const;
   193         MVPbkStoreContactField* Next();
   194 
   195     private: // implementation
   196         void ConstructL(
   197             const MVPbkFieldType& aFieldType,
   198             MVPbkStoreContactFieldCollection& aStoreFields );
   199 
   200     private: // Data
   201         /// Own: the iterator implementation
   202         CStoreFieldByTypeIterator* iIterator;
   203     };
   204 
   205 #endif // CVPBKCONTACTFIELDITERATOR_H
   206 
   207 // End of file