2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: A basic field Versit property.
19 #ifndef TVPBKFIELDVERSITPROPERTY_H
20 #define TVPBKFIELDVERSITPROPERTY_H
25 #include <vpbkfieldtype.hrh>
26 #include <tvpbkfieldtypeparameters.h>
29 // FORWARD DECLARATIONS
30 class TResourceReader;
31 /// Reserved name for class TVPbkFieldVersitProperty future extension.
32 class TVPbkFieldVersitPropertyExt;
38 * A basic field Versit property.
40 * The structure of Versit property is defined in VBK_FIELD_VERSIT_PROPERTY
41 * in VPbkFieldType.rh.
44 * @see MVPbkFieldType::Matches
47 class TVPbkFieldVersitProperty
49 public: // Constructors
51 * Default constructor. Resets all fields to null values.
53 IMPORT_C TVPbkFieldVersitProperty();
56 * Constructs this object from a VBK_FIELD_VERSIT_PROPERTY resource.
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
64 * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY
67 IMPORT_C TVPbkFieldVersitProperty(TResourceReader& aResReader);
69 public: // New functions
71 * Returns the Versit property name.
73 * @return The Versit property name.
75 inline TVPbkFieldTypeName Name() const;
78 * Returns the Versit property subfield.
80 * @return The Versit property subfield.
82 inline TVPbkSubFieldType SubField() const;
85 * Returns the Versit property parameters (read-only).
87 * @return The Versit property parameters (read-only).
89 inline const TVPbkFieldTypeParameters& Parameters() const;
92 * Returns the Versit property parameters (read-write).
94 * @return The Versit property parameters (read-write).
96 inline TVPbkFieldTypeParameters& Parameters();
99 * Returns the Versit extension name.
101 * @return The Versit extension name.
103 inline TPtrC8 ExtensionName() const;
106 * Sets the Versit property name.
108 * @param aName The name that is set to this property.
110 inline void SetName(TVPbkFieldTypeName aName);
113 * Sets the Versit property subfield.
115 * @param aSubField The sub field that is set to this property.
117 inline void SetSubField(TVPbkSubFieldType aSubField);
120 * Sets the Versit property parameters.
122 * @param aParameters Parameters that are set to this property.
124 inline void SetParameters(const TVPbkFieldTypeParameters& aParameters);
127 * Sets the Versit extension name.
129 * Only a reference to the name is stored. The reference must be
130 * valid for the lifetime of this object.
132 * @param aExtensionName The extension name reference that is set to
135 inline void SetExtensionName(const TDesC8& aExtensionName);
138 * Reads this object's contents from a VBK_FIELD_VERSIT_PROPERTY
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
147 * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY
150 IMPORT_C void ReadFromResource(TResourceReader& aResReader);
153 * Returns true if this versit property matches aOther.
155 * If aOther matches this property it doesn't necessary mean that
156 * this property will match to aOther.
158 * @param aOther Another property that is matched to this property.
160 IMPORT_C TBool Matches(const TVPbkFieldVersitProperty& aOther) const;
164 friend class T_TVPbkFieldVersitProperty;
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;
181 inline TVPbkFieldTypeName TVPbkFieldVersitProperty::Name() const
186 inline TVPbkSubFieldType TVPbkFieldVersitProperty::SubField() const
191 inline const TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters
197 inline TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters()
202 inline TPtrC8 TVPbkFieldVersitProperty::ExtensionName() const
204 return iExtensionName;
207 inline void TVPbkFieldVersitProperty::SetName(TVPbkFieldTypeName aName)
212 inline void TVPbkFieldVersitProperty::SetSubField(TVPbkSubFieldType aSubField)
214 iSubField = aSubField;
217 inline void TVPbkFieldVersitProperty::SetParameters
218 (const TVPbkFieldTypeParameters& aParameters)
220 iParameters = aParameters;
223 inline void TVPbkFieldVersitProperty::SetExtensionName
224 (const TDesC8& aExtensionName)
226 iExtensionName.Set(aExtensionName);
229 #endif // TVPBKFIELDVERSITPROPERTY_H