|
1 /* |
|
2 * Copyright (c) 2004-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: |
|
15 : |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef SCVPBKBASECONTACTFIELDCOLLECTION_H |
|
22 #define SCVPBKBASECONTACTFIELDCOLLECTION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <MVPbkStoreContactFieldCollection.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 |
|
30 // CLASS DECLARATIONS |
|
31 |
|
32 /** |
|
33 * Virtual Phonebook base contact field collection interface. |
|
34 * An abstract collection of read-only Virtual Phonebook contact fields. |
|
35 */ |
|
36 class CVPbkBaseContactFieldCollectionStub : public CBase, |
|
37 public MVPbkStoreContactFieldCollection |
|
38 { |
|
39 public: // Destructor |
|
40 CVPbkBaseContactFieldCollectionStub(); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CVPbkBaseContactFieldCollectionStub(); |
|
46 |
|
47 public: // From MVPbkBaseContactFieldCollection (covariant return types)) |
|
48 const MVPbkStoreContactField& FieldAt(TInt aIndex) const ; |
|
49 |
|
50 public: // New functions |
|
51 /** |
|
52 * Returns a field in this collection. |
|
53 * |
|
54 * @param aIndex A zero-based index of the field to return. |
|
55 * @return A reference to the field at aIndex. Reference is valid until |
|
56 * FieldAt is called again. If you need a permanent copy, |
|
57 * call MVPbkStoreContactField::CloneLC to the returned |
|
58 * field. |
|
59 * @see MVPbkStoreContactField::CloneLC |
|
60 * @precond aIndex >= 0 && aIndex < FieldCount() |
|
61 * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised |
|
62 * if the precondition does not hold. |
|
63 */ |
|
64 MVPbkStoreContactField& FieldAt( TInt aIndex ) ; |
|
65 |
|
66 /** |
|
67 * Returns a copy of the field in this collection. |
|
68 * |
|
69 * Client gets the ownership of the field. |
|
70 * |
|
71 * @param aIndex A zero-based index of the field to return. |
|
72 * @return A new instance to the field at aIndex. The field is valid |
|
73 * as long as the parent contact is valid |
|
74 * @precond aIndex >= 0 && aIndex < FieldCount() |
|
75 * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised |
|
76 * if the precondition does not hold. |
|
77 */ |
|
78 MVPbkStoreContactField* FieldAtLC( TInt aIndex ) const ; |
|
79 |
|
80 /** |
|
81 * Returns the parent contact of the field collection |
|
82 * |
|
83 * @return the parent contact of the field collection |
|
84 */ |
|
85 MVPbkStoreContact& ParentStoreContact() const ; |
|
86 |
|
87 /** |
|
88 * Returns a field in this collection identified by a contact field |
|
89 * link. |
|
90 * |
|
91 * A contact field link can be created using the MVPbkStoreContactField |
|
92 * interface. The same link works then as a contact link and |
|
93 * a field link. |
|
94 * |
|
95 * NOTE: implementations of stores are possibly using an index |
|
96 * of the field as an identifier so clients should prefer not |
|
97 * to save field links permanently. E.g modifying the contact |
|
98 * can invalidate the link in some store implementations. |
|
99 * A field link is practical in use cases where the link is |
|
100 * created and immediately given to another component. |
|
101 * |
|
102 * @param aContactLink A valid contact field link. |
|
103 * @return A field in this collection identified by aContactLink or NULL |
|
104 * if the link does not contain field information or if the |
|
105 * link does not refer to the parent contact of this field collection. |
|
106 */ |
|
107 MVPbkStoreContactField* RetrieveField( |
|
108 const MVPbkContactLink& aContactLink ) const ; |
|
109 |
|
110 |
|
111 public: // Interface |
|
112 /** |
|
113 * Returns the parent contact of this field set. |
|
114 * @return The parent contact of this field set. |
|
115 */ |
|
116 MVPbkBaseContact& ParentContact() const ; |
|
117 |
|
118 /** |
|
119 * Returns the number of fields in this collection. |
|
120 * @return The number of fields in this collection. |
|
121 */ |
|
122 TInt FieldCount() const ; |
|
123 |
|
124 /** |
|
125 * Returns a read-only field in this collection. |
|
126 * |
|
127 * @param aIndex Zero-based index of the field to return. |
|
128 * @return Reference to a field at aIndex. Reference is |
|
129 * valid until FieldAt is called again. |
|
130 * @see MVPbkBaseContactFieldCollection::ConstFieldAt |
|
131 * @precond aIndex >= 0 && aIndex < FieldCount() |
|
132 * Panic VPbkError::EInvalidFieldIndex is raised if the |
|
133 * precondition does not hold. |
|
134 */ |
|
135 //const MVPbkBaseContactField& FieldAt( |
|
136 // TInt aIndex) const ; |
|
137 |
|
138 }; |
|
139 |
|
140 |
|
141 #endif // SCVPBKBASECONTACTFIELDCOLLECTION_H |
|
142 |
|
143 //End of file |