1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/TVPbkFieldVersitProperty.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,232 @@
1.4 +/*
1.5 +* Copyright (c) 2004-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: A basic field Versit property.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef TVPBKFIELDVERSITPROPERTY_H
1.23 +#define TVPBKFIELDVERSITPROPERTY_H
1.24 +
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32std.h>
1.28 +#include <vpbkfieldtype.hrh>
1.29 +#include <tvpbkfieldtypeparameters.h>
1.30 +
1.31 +
1.32 +// FORWARD DECLARATIONS
1.33 +class TResourceReader;
1.34 +/// Reserved name for class TVPbkFieldVersitProperty future extension.
1.35 +class TVPbkFieldVersitPropertyExt;
1.36 +
1.37 +
1.38 +// CLASS DECLARATIONS
1.39 +
1.40 +/**
1.41 + * A basic field Versit property.
1.42 + *
1.43 + * The structure of Versit property is defined in VBK_FIELD_VERSIT_PROPERTY
1.44 + * in VPbkFieldType.rh.
1.45 + *
1.46 + * @see MVPbkFieldType
1.47 + * @see MVPbkFieldType::Matches
1.48 + * @lib VPbkEng.lib
1.49 + */
1.50 +class TVPbkFieldVersitProperty
1.51 + {
1.52 + public: // Constructors
1.53 + /**
1.54 + * Default constructor. Resets all fields to null values.
1.55 + */
1.56 + IMPORT_C TVPbkFieldVersitProperty();
1.57 +
1.58 + /**
1.59 + * Constructs this object from a VBK_FIELD_VERSIT_PROPERTY resource.
1.60 + *
1.61 + * Sets also the Versit extension name. Only a reference to the
1.62 + * extension name is stored so the client must either keep the resource
1.63 + * buffer alive or make a copy of the extension name and use
1.64 + * SetExtensionName. The reference must be valid for the lifetime of
1.65 + * this object.
1.66 + *
1.67 + * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY
1.68 + * resource.
1.69 + */
1.70 + IMPORT_C TVPbkFieldVersitProperty(TResourceReader& aResReader);
1.71 +
1.72 + public: // New functions
1.73 + /**
1.74 + * Returns the Versit property name.
1.75 + *
1.76 + * @return The Versit property name.
1.77 + */
1.78 + inline TVPbkFieldTypeName Name() const;
1.79 +
1.80 + /**
1.81 + * Returns the Versit property subfield.
1.82 + *
1.83 + * @return The Versit property subfield.
1.84 + */
1.85 + inline TVPbkSubFieldType SubField() const;
1.86 +
1.87 + /**
1.88 + * Returns the Versit property parameters (read-only).
1.89 + *
1.90 + * @return The Versit property parameters (read-only).
1.91 + */
1.92 + inline const TVPbkFieldTypeParameters& Parameters() const;
1.93 +
1.94 + /**
1.95 + * Returns the Versit property parameters (read-write).
1.96 + *
1.97 + * @return The Versit property parameters (read-write).
1.98 + */
1.99 + inline TVPbkFieldTypeParameters& Parameters();
1.100 +
1.101 + /**
1.102 + * Returns the Versit extension name.
1.103 + *
1.104 + * @return The Versit extension name.
1.105 + */
1.106 + inline TPtrC8 ExtensionName() const;
1.107 +
1.108 + /**
1.109 + * Sets the Versit property name.
1.110 + *
1.111 + * @param aName The name that is set to this property.
1.112 + */
1.113 + inline void SetName(TVPbkFieldTypeName aName);
1.114 +
1.115 + /**
1.116 + * Sets the Versit property subfield.
1.117 + *
1.118 + * @param aSubField The sub field that is set to this property.
1.119 + */
1.120 + inline void SetSubField(TVPbkSubFieldType aSubField);
1.121 +
1.122 + /**
1.123 + * Sets the Versit property parameters.
1.124 + *
1.125 + * @param aParameters Parameters that are set to this property.
1.126 + */
1.127 + inline void SetParameters(const TVPbkFieldTypeParameters& aParameters);
1.128 +
1.129 + /**
1.130 + * Sets the Versit extension name.
1.131 + *
1.132 + * Only a reference to the name is stored. The reference must be
1.133 + * valid for the lifetime of this object.
1.134 + *
1.135 + * @param aExtensionName The extension name reference that is set to
1.136 + * this property.
1.137 + */
1.138 + inline void SetExtensionName(const TDesC8& aExtensionName);
1.139 +
1.140 + /**
1.141 + * Reads this object's contents from a VBK_FIELD_VERSIT_PROPERTY
1.142 + * resource.
1.143 + *
1.144 + * Sets also the Versit extension name. Only a reference to the
1.145 + * extension name is stored so the client must either keep the resource
1.146 + * buffer alive or make a copy of the extension name and use
1.147 + * SetExtensionName. The reference must be valid for the lifetime of
1.148 + * this object.
1.149 + *
1.150 + * @param aResReader A reader to the VBK_FIELD_VERSIT_PROPERTY
1.151 + * resource.
1.152 + */
1.153 + IMPORT_C void ReadFromResource(TResourceReader& aResReader);
1.154 +
1.155 + /**
1.156 + * Returns true if this versit property matches aOther.
1.157 + *
1.158 + * If aOther matches this property it doesn't necessary mean that
1.159 + * this property will match to aOther.
1.160 + *
1.161 + * @param aOther Another property that is matched to this property.
1.162 + */
1.163 + IMPORT_C TBool Matches(const TVPbkFieldVersitProperty& aOther) const;
1.164 +
1.165 + private: // Friends
1.166 + /// For testing only
1.167 + friend class T_TVPbkFieldVersitProperty;
1.168 +
1.169 +
1.170 + private: // Data
1.171 + ///Own: Versit property name.
1.172 + TVPbkFieldTypeName iName;
1.173 + ///Own: Versit subfield.
1.174 + TVPbkSubFieldType iSubField;
1.175 + ///Own: Versit parameters.
1.176 + TVPbkFieldTypeParameters iParameters;
1.177 + ///Ref: Name of a versit extension property.
1.178 + TPtrC8 iExtensionName;
1.179 + ///Own: Extension point for this class.
1.180 + TVPbkFieldVersitPropertyExt* iExtension;
1.181 + };
1.182 +
1.183 +
1.184 +inline TVPbkFieldTypeName TVPbkFieldVersitProperty::Name() const
1.185 + {
1.186 + return iName;
1.187 + }
1.188 +
1.189 +inline TVPbkSubFieldType TVPbkFieldVersitProperty::SubField() const
1.190 + {
1.191 + return iSubField;
1.192 + }
1.193 +
1.194 +inline const TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters
1.195 + ( ) const
1.196 + {
1.197 + return iParameters;
1.198 + }
1.199 +
1.200 +inline TVPbkFieldTypeParameters& TVPbkFieldVersitProperty::Parameters()
1.201 + {
1.202 + return iParameters;
1.203 + }
1.204 +
1.205 +inline TPtrC8 TVPbkFieldVersitProperty::ExtensionName() const
1.206 + {
1.207 + return iExtensionName;
1.208 + }
1.209 +
1.210 +inline void TVPbkFieldVersitProperty::SetName(TVPbkFieldTypeName aName)
1.211 + {
1.212 + iName = aName;
1.213 + }
1.214 +
1.215 +inline void TVPbkFieldVersitProperty::SetSubField(TVPbkSubFieldType aSubField)
1.216 + {
1.217 + iSubField = aSubField;
1.218 + }
1.219 +
1.220 +inline void TVPbkFieldVersitProperty::SetParameters
1.221 + (const TVPbkFieldTypeParameters& aParameters)
1.222 + {
1.223 + iParameters = aParameters;
1.224 + }
1.225 +
1.226 +inline void TVPbkFieldVersitProperty::SetExtensionName
1.227 + (const TDesC8& aExtensionName)
1.228 + {
1.229 + iExtensionName.Set(aExtensionName);
1.230 + }
1.231 +
1.232 +#endif // TVPBKFIELDVERSITPROPERTY_H
1.233 +
1.234 +//End of file
1.235 +