|
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: A basic field Versit property. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TVPBKFIELDVERSITPROPERTY_H |
|
20 #define TVPBKFIELDVERSITPROPERTY_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <VPbkFieldType.hrh> |
|
26 #include <TVPbkFieldTypeParameters.h> |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class TResourceReader; |
|
31 /// Reserved name for class TVPbkFieldVersitProperty future extension. |
|
32 class TVPbkFieldVersitPropertyExt; |
|
33 |
|
34 |
|
35 // CLASS DECLARATIONS |
|
36 |
|
37 /** |
|
38 * A basic field Versit property. |
|
39 * |
|
40 * The structure of Versit property is defined in VBK_FIELD_VERSIT_PROPERTY |
|
41 * in VPbkFieldType.rh. |
|
42 * |
|
43 * @see MVPbkFieldType |
|
44 * @see MVPbkFieldType::Matches |
|
45 * @lib VPbkEng.lib |
|
46 */ |
|
47 class TVPbkFieldVersitProperty |
|
48 { |
|
49 public: // Constructors |
|
50 /** |
|
51 * Default constructor. Resets all fields to null values. |
|
52 */ |
|
53 IMPORT_C TVPbkFieldVersitProperty(); |
|
54 |
|
55 /** |
|
56 * Constructs this object from a VBK_FIELD_VERSIT_PROPERTY resource. |
|
57 * |
|
58 * Sets also the Versit extension name. Only a reference to the |
|
59 * extension name is stored so the client must either keep the resource |
|
60 * buffer alive or make a copy of the extension name and use |
|
61 * SetExtensionName. The reference must be valid for the lifetime of |
|
62 * this object. |
|
63 * |
|
64 * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY |
|
65 * resource. |
|
66 */ |
|
67 IMPORT_C TVPbkFieldVersitProperty(TResourceReader& aResReader); |
|
68 |
|
69 public: // New functions |
|
70 /** |
|
71 * Returns the Versit property name. |
|
72 * |
|
73 * @return The Versit property name. |
|
74 */ |
|
75 inline TVPbkFieldTypeName Name() const; |
|
76 |
|
77 /** |
|
78 * Returns the Versit property subfield. |
|
79 * |
|
80 * @return The Versit property subfield. |
|
81 */ |
|
82 inline TVPbkSubFieldType SubField() const; |
|
83 |
|
84 /** |
|
85 * Returns the Versit property parameters (read-only). |
|
86 * |
|
87 * @return The Versit property parameters (read-only). |
|
88 */ |
|
89 inline const TVPbkFieldTypeParameters& Parameters() const; |
|
90 |
|
91 /** |
|
92 * Returns the Versit property parameters (read-write). |
|
93 * |
|
94 * @return The Versit property parameters (read-write). |
|
95 */ |
|
96 inline TVPbkFieldTypeParameters& Parameters(); |
|
97 |
|
98 /** |
|
99 * Returns the Versit extension name. |
|
100 * |
|
101 * @return The Versit extension name. |
|
102 */ |
|
103 inline TPtrC8 ExtensionName() const; |
|
104 |
|
105 /** |
|
106 * Sets the Versit property name. |
|
107 * |
|
108 * @param aName The name that is set to this property. |
|
109 */ |
|
110 inline void SetName(TVPbkFieldTypeName aName); |
|
111 |
|
112 /** |
|
113 * Sets the Versit property subfield. |
|
114 * |
|
115 * @param aSubField The sub field that is set to this property. |
|
116 */ |
|
117 inline void SetSubField(TVPbkSubFieldType aSubField); |
|
118 |
|
119 /** |
|
120 * Sets the Versit property parameters. |
|
121 * |
|
122 * @param aParameters Parameters that are set to this property. |
|
123 */ |
|
124 inline void SetParameters(const TVPbkFieldTypeParameters& aParameters); |
|
125 |
|
126 /** |
|
127 * Sets the Versit extension name. |
|
128 * |
|
129 * Only a reference to the name is stored. The reference must be |
|
130 * valid for the lifetime of this object. |
|
131 * |
|
132 * @param aExtensionName The extension name reference that is set to |
|
133 * this property. |
|
134 */ |
|
135 inline void SetExtensionName(const TDesC8& aExtensionName); |
|
136 |
|
137 /** |
|
138 * Reads this object's contents from a VBK_FIELD_VERSIT_PROPERTY |
|
139 * resource. |
|
140 * |
|
141 * Sets also the Versit extension name. Only a reference to the |
|
142 * extension name is stored so the client must either keep the resource |
|
143 * buffer alive or make a copy of the extension name and use |
|
144 * SetExtensionName. The reference must be valid for the lifetime of |
|
145 * this object. |
|
146 * |
|
147 * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY |
|
148 * resource. |
|
149 */ |
|
150 IMPORT_C void ReadFromResource(TResourceReader& aResReader); |
|
151 |
|
152 /** |
|
153 * Returns true if this versit property matches aOther. |
|
154 * |
|
155 * If aOther matches this property it doesn't necessary mean that |
|
156 * this property will match to aOther. |
|
157 * |
|
158 * @param aOther Another property that is matched to this property. |
|
159 */ |
|
160 IMPORT_C TBool Matches(const TVPbkFieldVersitProperty& aOther) const; |
|
161 |
|
162 private: // Friends |
|
163 /// For testing only |
|
164 friend class T_TVPbkFieldVersitProperty; |
|
165 |
|
166 |
|
167 private: // Data |
|
168 ///Own: Versit property name. |
|
169 TVPbkFieldTypeName iName; |
|
170 ///Own: Versit subfield. |
|
171 TVPbkSubFieldType iSubField; |
|
172 ///Own: Versit parameters. |
|
173 TVPbkFieldTypeParameters iParameters; |
|
174 ///Ref: Name of a versit extension property. |
|
175 TPtrC8 iExtensionName; |
|
176 ///Own: Extension point for this class. |
|
177 TVPbkFieldVersitPropertyExt* iExtension; |
|
178 }; |
|
179 |
|
180 |
|
181 inline TVPbkFieldTypeName TVPbkFieldVersitProperty::Name() const |
|
182 { |
|
183 return iName; |
|
184 } |
|
185 |
|
186 inline TVPbkSubFieldType TVPbkFieldVersitProperty::SubField() const |
|
187 { |
|
188 return iSubField; |
|
189 } |
|
190 |
|
191 inline const TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters |
|
192 ( ) const |
|
193 { |
|
194 return iParameters; |
|
195 } |
|
196 |
|
197 inline TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters() |
|
198 { |
|
199 return iParameters; |
|
200 } |
|
201 |
|
202 inline TPtrC8 TVPbkFieldVersitProperty::ExtensionName() const |
|
203 { |
|
204 return iExtensionName; |
|
205 } |
|
206 |
|
207 inline void TVPbkFieldVersitProperty::SetName(TVPbkFieldTypeName aName) |
|
208 { |
|
209 iName = aName; |
|
210 } |
|
211 |
|
212 inline void TVPbkFieldVersitProperty::SetSubField(TVPbkSubFieldType aSubField) |
|
213 { |
|
214 iSubField = aSubField; |
|
215 } |
|
216 |
|
217 inline void TVPbkFieldVersitProperty::SetParameters |
|
218 (const TVPbkFieldTypeParameters& aParameters) |
|
219 { |
|
220 iParameters = aParameters; |
|
221 } |
|
222 |
|
223 inline void TVPbkFieldVersitProperty::SetExtensionName |
|
224 (const TDesC8& aExtensionName) |
|
225 { |
|
226 iExtensionName.Set(aExtensionName); |
|
227 } |
|
228 |
|
229 #endif // TVPBKFIELDVERSITPROPERTY_H |
|
230 |
|
231 //End of file |
|
232 |