1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/CVPbkContactFieldIterator.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,207 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Virtual Phonebook contact field iterator interface.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef CVPBKCONTACTFIELDITERATOR_H
1.23 +#define CVPBKCONTACTFIELDITERATOR_H
1.24 +
1.25 +// INCLUDES
1.26 +#include <e32base.h>
1.27 +#include <mvpbkstorecontactfield.h>
1.28 +
1.29 +// FORWARD DECLARATIONS
1.30 +class MVPbkStoreContactFieldCollection;
1.31 +class MVPbkBaseContactFieldCollection;
1.32 +class MVPbkFieldType;
1.33 +class MVPbkFieldTypeList;
1.34 +class MVPbkStoreContactField;
1.35 +class CStoreFieldByTypeIterator;
1.36 +class CBaseFieldByTypeIterator;
1.37 +class CBaseFieldByTypeListIterator;
1.38 +class MVPbkBaseContactField;
1.39 +
1.40 +/**
1.41 + * Virtual Phonebook contact field iterator interface.
1.42 + */
1.43 +class MVPbkBaseContactFieldIterator
1.44 + {
1.45 + public: // Construction
1.46 + /**
1.47 + * Destructor.
1.48 + */
1.49 + virtual ~MVPbkBaseContactFieldIterator() { }
1.50 +
1.51 + public: // Interface
1.52 + /**
1.53 + * Returns the next field, otherwise NULL.
1.54 + *
1.55 + * @return The next field, otherwise NULL.
1.56 + */
1.57 + virtual const MVPbkBaseContactField* Next() const =0;
1.58 +
1.59 + /**
1.60 + * Returns ETrue if there exists a next field, else EFalse.
1.61 + */
1.62 + virtual TBool HasNext() const =0;
1.63 +
1.64 + };
1.65 +
1.66 +/**
1.67 + * Virtual Phonebook contact field iterator interface.
1.68 + */
1.69 +class MVPbkContactFieldIterator : public MVPbkBaseContactFieldIterator
1.70 + {
1.71 + public: // Construction
1.72 + /**
1.73 + * Destructor.
1.74 + */
1.75 + virtual ~MVPbkContactFieldIterator() { }
1.76 +
1.77 + public: // Interface
1.78 + // From MVPbkBaseContactFieldIterator (covariant return types))
1.79 + const MVPbkStoreContactField* Next() const =0;
1.80 +
1.81 + /**
1.82 + * Returns the next field, otherwise NULL.
1.83 + *
1.84 + * @return The next field, otherwise NULL. Ownership doesn't change.
1.85 + */
1.86 + virtual MVPbkStoreContactField* Next() =0;
1.87 + };
1.88 +
1.89 +/**
1.90 + * Virtual Phonebook contact field type iterator.
1.91 + * Iterates the contact fields according to the field type specified.
1.92 + */
1.93 +class CVPbkBaseContactFieldTypeIterator :
1.94 + public CBase,
1.95 + public MVPbkBaseContactFieldIterator
1.96 + {
1.97 + public: // Construction
1.98 + /**
1.99 + * Constructor for iterating store contact fields.
1.100 + *.
1.101 + * @param aFieldType Field type which is iterated.
1.102 + * @param aFields Contact fields to iterate.
1.103 + * @return A new instance of this class
1.104 + */
1.105 + IMPORT_C static CVPbkBaseContactFieldTypeIterator* NewLC(
1.106 + const MVPbkFieldType& aFieldType,
1.107 + const MVPbkBaseContactFieldCollection& aFields);
1.108 +
1.109 + /**
1.110 + * Destructor.
1.111 + */
1.112 + ~CVPbkBaseContactFieldTypeIterator();
1.113 +
1.114 + public: // from MVPbkContactFieldIterator
1.115 + const MVPbkBaseContactField* Next() const;
1.116 + TBool HasNext() const;
1.117 +
1.118 + private: // implementation
1.119 + void ConstructL(
1.120 + const MVPbkFieldType& aFieldType,
1.121 + const MVPbkBaseContactFieldCollection& aFields );
1.122 +
1.123 + private: // Data
1.124 + /// Own: the iterator implementation
1.125 + CBaseFieldByTypeIterator* iIterator;
1.126 + };
1.127 +
1.128 +/**
1.129 + * Virtual Phonebook contact field type list iterator.
1.130 + * Iterates the contact fields according to the field types specified.
1.131 + */
1.132 +class CVPbkBaseContactFieldTypeListIterator :
1.133 + public CBase,
1.134 + public MVPbkBaseContactFieldIterator
1.135 + {
1.136 + public: // Construction
1.137 + /**
1.138 + * Constructor for iterating store contact fields.
1.139 + *.
1.140 + * @param aFieldTypeList Field type list which is iterated.
1.141 + * @param aFields Contact fields to iterate.
1.142 + * @return A new instance of this class
1.143 + */
1.144 + IMPORT_C static CVPbkBaseContactFieldTypeListIterator* NewLC(
1.145 + const MVPbkFieldTypeList& aFieldTypeList,
1.146 + const MVPbkBaseContactFieldCollection& aFields);
1.147 +
1.148 + /**
1.149 + * Destructor.
1.150 + */
1.151 + ~CVPbkBaseContactFieldTypeListIterator();
1.152 +
1.153 + public: // from MVPbkContactFieldIterator
1.154 + const MVPbkBaseContactField* Next() const;
1.155 + TBool HasNext() const;
1.156 +
1.157 + private: // implementation
1.158 + void ConstructL(
1.159 + const MVPbkFieldTypeList& aFieldTypeList,
1.160 + const MVPbkBaseContactFieldCollection& aFields );
1.161 +
1.162 + private: // Data
1.163 + /// Own: the iterator implementation
1.164 + CBaseFieldByTypeListIterator* iIterator;
1.165 + };
1.166 +
1.167 +/**
1.168 + * Virtual Phonebook contact field type iterator.
1.169 + * Iterates the store contact fields according to the
1.170 + * field type specified.
1.171 + */
1.172 +class CVPbkContactFieldTypeIterator :
1.173 + public CBase,
1.174 + public MVPbkContactFieldIterator
1.175 + {
1.176 + public: // Construction
1.177 + /**
1.178 + * Constructor for iterating store contact fields.
1.179 + *.
1.180 + * @param aFieldType Field type which is iterated.
1.181 + * @param aFields Contact fields to iterate.
1.182 + * @return A new instance of this class
1.183 + */
1.184 + IMPORT_C static CVPbkContactFieldTypeIterator* NewLC(
1.185 + const MVPbkFieldType& aFieldType,
1.186 + MVPbkStoreContactFieldCollection& aFields);
1.187 +
1.188 + /**
1.189 + * Destructor.
1.190 + */
1.191 + ~CVPbkContactFieldTypeIterator();
1.192 +
1.193 + public: // from MVPbkContactFieldIterator
1.194 + const MVPbkStoreContactField* Next() const;
1.195 + TBool HasNext() const;
1.196 + MVPbkStoreContactField* Next();
1.197 +
1.198 + private: // implementation
1.199 + void ConstructL(
1.200 + const MVPbkFieldType& aFieldType,
1.201 + MVPbkStoreContactFieldCollection& aStoreFields );
1.202 +
1.203 + private: // Data
1.204 + /// Own: the iterator implementation
1.205 + CStoreFieldByTypeIterator* iIterator;
1.206 + };
1.207 +
1.208 +#endif // CVPBKCONTACTFIELDITERATOR_H
1.209 +
1.210 +// End of file