williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description: Virtual Phonebook contact field iterator interface.
|
williamr@4
|
15 |
*
|
williamr@4
|
16 |
*/
|
williamr@4
|
17 |
|
williamr@4
|
18 |
|
williamr@4
|
19 |
#ifndef CVPBKCONTACTFIELDITERATOR_H
|
williamr@4
|
20 |
#define CVPBKCONTACTFIELDITERATOR_H
|
williamr@4
|
21 |
|
williamr@4
|
22 |
// INCLUDES
|
williamr@4
|
23 |
#include <e32base.h>
|
williamr@4
|
24 |
#include <mvpbkstorecontactfield.h>
|
williamr@4
|
25 |
|
williamr@4
|
26 |
// FORWARD DECLARATIONS
|
williamr@4
|
27 |
class MVPbkStoreContactFieldCollection;
|
williamr@4
|
28 |
class MVPbkBaseContactFieldCollection;
|
williamr@4
|
29 |
class MVPbkFieldType;
|
williamr@4
|
30 |
class MVPbkFieldTypeList;
|
williamr@4
|
31 |
class MVPbkStoreContactField;
|
williamr@4
|
32 |
class CStoreFieldByTypeIterator;
|
williamr@4
|
33 |
class CBaseFieldByTypeIterator;
|
williamr@4
|
34 |
class CBaseFieldByTypeListIterator;
|
williamr@4
|
35 |
class MVPbkBaseContactField;
|
williamr@4
|
36 |
|
williamr@4
|
37 |
/**
|
williamr@4
|
38 |
* Virtual Phonebook contact field iterator interface.
|
williamr@4
|
39 |
*/
|
williamr@4
|
40 |
class MVPbkBaseContactFieldIterator
|
williamr@4
|
41 |
{
|
williamr@4
|
42 |
public: // Construction
|
williamr@4
|
43 |
/**
|
williamr@4
|
44 |
* Destructor.
|
williamr@4
|
45 |
*/
|
williamr@4
|
46 |
virtual ~MVPbkBaseContactFieldIterator() { }
|
williamr@4
|
47 |
|
williamr@4
|
48 |
public: // Interface
|
williamr@4
|
49 |
/**
|
williamr@4
|
50 |
* Returns the next field, otherwise NULL.
|
williamr@4
|
51 |
*
|
williamr@4
|
52 |
* @return The next field, otherwise NULL.
|
williamr@4
|
53 |
*/
|
williamr@4
|
54 |
virtual const MVPbkBaseContactField* Next() const =0;
|
williamr@4
|
55 |
|
williamr@4
|
56 |
/**
|
williamr@4
|
57 |
* Returns ETrue if there exists a next field, else EFalse.
|
williamr@4
|
58 |
*/
|
williamr@4
|
59 |
virtual TBool HasNext() const =0;
|
williamr@4
|
60 |
|
williamr@4
|
61 |
};
|
williamr@4
|
62 |
|
williamr@4
|
63 |
/**
|
williamr@4
|
64 |
* Virtual Phonebook contact field iterator interface.
|
williamr@4
|
65 |
*/
|
williamr@4
|
66 |
class MVPbkContactFieldIterator : public MVPbkBaseContactFieldIterator
|
williamr@4
|
67 |
{
|
williamr@4
|
68 |
public: // Construction
|
williamr@4
|
69 |
/**
|
williamr@4
|
70 |
* Destructor.
|
williamr@4
|
71 |
*/
|
williamr@4
|
72 |
virtual ~MVPbkContactFieldIterator() { }
|
williamr@4
|
73 |
|
williamr@4
|
74 |
public: // Interface
|
williamr@4
|
75 |
// From MVPbkBaseContactFieldIterator (covariant return types))
|
williamr@4
|
76 |
const MVPbkStoreContactField* Next() const =0;
|
williamr@4
|
77 |
|
williamr@4
|
78 |
/**
|
williamr@4
|
79 |
* Returns the next field, otherwise NULL.
|
williamr@4
|
80 |
*
|
williamr@4
|
81 |
* @return The next field, otherwise NULL. Ownership doesn't change.
|
williamr@4
|
82 |
*/
|
williamr@4
|
83 |
virtual MVPbkStoreContactField* Next() =0;
|
williamr@4
|
84 |
};
|
williamr@4
|
85 |
|
williamr@4
|
86 |
/**
|
williamr@4
|
87 |
* Virtual Phonebook contact field type iterator.
|
williamr@4
|
88 |
* Iterates the contact fields according to the field type specified.
|
williamr@4
|
89 |
*/
|
williamr@4
|
90 |
class CVPbkBaseContactFieldTypeIterator :
|
williamr@4
|
91 |
public CBase,
|
williamr@4
|
92 |
public MVPbkBaseContactFieldIterator
|
williamr@4
|
93 |
{
|
williamr@4
|
94 |
public: // Construction
|
williamr@4
|
95 |
/**
|
williamr@4
|
96 |
* Constructor for iterating store contact fields.
|
williamr@4
|
97 |
*.
|
williamr@4
|
98 |
* @param aFieldType Field type which is iterated.
|
williamr@4
|
99 |
* @param aFields Contact fields to iterate.
|
williamr@4
|
100 |
* @return A new instance of this class
|
williamr@4
|
101 |
*/
|
williamr@4
|
102 |
IMPORT_C static CVPbkBaseContactFieldTypeIterator* NewLC(
|
williamr@4
|
103 |
const MVPbkFieldType& aFieldType,
|
williamr@4
|
104 |
const MVPbkBaseContactFieldCollection& aFields);
|
williamr@4
|
105 |
|
williamr@4
|
106 |
/**
|
williamr@4
|
107 |
* Destructor.
|
williamr@4
|
108 |
*/
|
williamr@4
|
109 |
~CVPbkBaseContactFieldTypeIterator();
|
williamr@4
|
110 |
|
williamr@4
|
111 |
public: // from MVPbkContactFieldIterator
|
williamr@4
|
112 |
const MVPbkBaseContactField* Next() const;
|
williamr@4
|
113 |
TBool HasNext() const;
|
williamr@4
|
114 |
|
williamr@4
|
115 |
private: // implementation
|
williamr@4
|
116 |
void ConstructL(
|
williamr@4
|
117 |
const MVPbkFieldType& aFieldType,
|
williamr@4
|
118 |
const MVPbkBaseContactFieldCollection& aFields );
|
williamr@4
|
119 |
|
williamr@4
|
120 |
private: // Data
|
williamr@4
|
121 |
/// Own: the iterator implementation
|
williamr@4
|
122 |
CBaseFieldByTypeIterator* iIterator;
|
williamr@4
|
123 |
};
|
williamr@4
|
124 |
|
williamr@4
|
125 |
/**
|
williamr@4
|
126 |
* Virtual Phonebook contact field type list iterator.
|
williamr@4
|
127 |
* Iterates the contact fields according to the field types specified.
|
williamr@4
|
128 |
*/
|
williamr@4
|
129 |
class CVPbkBaseContactFieldTypeListIterator :
|
williamr@4
|
130 |
public CBase,
|
williamr@4
|
131 |
public MVPbkBaseContactFieldIterator
|
williamr@4
|
132 |
{
|
williamr@4
|
133 |
public: // Construction
|
williamr@4
|
134 |
/**
|
williamr@4
|
135 |
* Constructor for iterating store contact fields.
|
williamr@4
|
136 |
*.
|
williamr@4
|
137 |
* @param aFieldTypeList Field type list which is iterated.
|
williamr@4
|
138 |
* @param aFields Contact fields to iterate.
|
williamr@4
|
139 |
* @return A new instance of this class
|
williamr@4
|
140 |
*/
|
williamr@4
|
141 |
IMPORT_C static CVPbkBaseContactFieldTypeListIterator* NewLC(
|
williamr@4
|
142 |
const MVPbkFieldTypeList& aFieldTypeList,
|
williamr@4
|
143 |
const MVPbkBaseContactFieldCollection& aFields);
|
williamr@4
|
144 |
|
williamr@4
|
145 |
/**
|
williamr@4
|
146 |
* Destructor.
|
williamr@4
|
147 |
*/
|
williamr@4
|
148 |
~CVPbkBaseContactFieldTypeListIterator();
|
williamr@4
|
149 |
|
williamr@4
|
150 |
public: // from MVPbkContactFieldIterator
|
williamr@4
|
151 |
const MVPbkBaseContactField* Next() const;
|
williamr@4
|
152 |
TBool HasNext() const;
|
williamr@4
|
153 |
|
williamr@4
|
154 |
private: // implementation
|
williamr@4
|
155 |
void ConstructL(
|
williamr@4
|
156 |
const MVPbkFieldTypeList& aFieldTypeList,
|
williamr@4
|
157 |
const MVPbkBaseContactFieldCollection& aFields );
|
williamr@4
|
158 |
|
williamr@4
|
159 |
private: // Data
|
williamr@4
|
160 |
/// Own: the iterator implementation
|
williamr@4
|
161 |
CBaseFieldByTypeListIterator* iIterator;
|
williamr@4
|
162 |
};
|
williamr@4
|
163 |
|
williamr@4
|
164 |
/**
|
williamr@4
|
165 |
* Virtual Phonebook contact field type iterator.
|
williamr@4
|
166 |
* Iterates the store contact fields according to the
|
williamr@4
|
167 |
* field type specified.
|
williamr@4
|
168 |
*/
|
williamr@4
|
169 |
class CVPbkContactFieldTypeIterator :
|
williamr@4
|
170 |
public CBase,
|
williamr@4
|
171 |
public MVPbkContactFieldIterator
|
williamr@4
|
172 |
{
|
williamr@4
|
173 |
public: // Construction
|
williamr@4
|
174 |
/**
|
williamr@4
|
175 |
* Constructor for iterating store contact fields.
|
williamr@4
|
176 |
*.
|
williamr@4
|
177 |
* @param aFieldType Field type which is iterated.
|
williamr@4
|
178 |
* @param aFields Contact fields to iterate.
|
williamr@4
|
179 |
* @return A new instance of this class
|
williamr@4
|
180 |
*/
|
williamr@4
|
181 |
IMPORT_C static CVPbkContactFieldTypeIterator* NewLC(
|
williamr@4
|
182 |
const MVPbkFieldType& aFieldType,
|
williamr@4
|
183 |
MVPbkStoreContactFieldCollection& aFields);
|
williamr@4
|
184 |
|
williamr@4
|
185 |
/**
|
williamr@4
|
186 |
* Destructor.
|
williamr@4
|
187 |
*/
|
williamr@4
|
188 |
~CVPbkContactFieldTypeIterator();
|
williamr@4
|
189 |
|
williamr@4
|
190 |
public: // from MVPbkContactFieldIterator
|
williamr@4
|
191 |
const MVPbkStoreContactField* Next() const;
|
williamr@4
|
192 |
TBool HasNext() const;
|
williamr@4
|
193 |
MVPbkStoreContactField* Next();
|
williamr@4
|
194 |
|
williamr@4
|
195 |
private: // implementation
|
williamr@4
|
196 |
void ConstructL(
|
williamr@4
|
197 |
const MVPbkFieldType& aFieldType,
|
williamr@4
|
198 |
MVPbkStoreContactFieldCollection& aStoreFields );
|
williamr@4
|
199 |
|
williamr@4
|
200 |
private: // Data
|
williamr@4
|
201 |
/// Own: the iterator implementation
|
williamr@4
|
202 |
CStoreFieldByTypeIterator* iIterator;
|
williamr@4
|
203 |
};
|
williamr@4
|
204 |
|
williamr@4
|
205 |
#endif // CVPBKCONTACTFIELDITERATOR_H
|
williamr@4
|
206 |
|
williamr@4
|
207 |
// End of file
|