1.1 --- a/epoc32/include/xml/attribute.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/xml/attribute.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,174 @@
1.4 -attribute.h
1.5 +// Copyright (c) 2003-2009 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __ATTRIBUTE_H__
1.21 +#define __ATTRIBUTE_H__
1.22 +
1.23 +#include <xml/taginfo.h>
1.24 +
1.25 +namespace Xml
1.26 +{
1.27 +
1.28 +enum TAttributeType
1.29 +/**
1.30 +Specifies the type of this attribute object.
1.31 +These values are defined in the xml specification.
1.32 +For other specifications they may also be used or 'none'.
1.33 +@see http://www.w3.org/TR/REC-xml#sec-attribute-types
1.34 +
1.35 +@publishedAll
1.36 +@released
1.37 +*/
1.38 + {
1.39 +/**
1.40 +Specifies a string type.
1.41 +*/
1.42 + EAttributeType_CDATA,
1.43 +
1.44 +/**
1.45 +Specifies a tokenized type.
1.46 +*/
1.47 + EAttributeType_ID,
1.48 +
1.49 +/**
1.50 +Specifies a tokenized type.
1.51 +*/
1.52 + EAttributeType_IDREF,
1.53 +
1.54 +/**
1.55 +Specifies a tokenized type.
1.56 +*/
1.57 + EAttributeType_IDREFS,
1.58 +
1.59 +/**
1.60 +Specifies a tokenized type.
1.61 +*/
1.62 + EAttributeType_NMTOKEN,
1.63 +
1.64 +/**
1.65 +Specifies a tokenized type.
1.66 +*/
1.67 + EAttributeType_NMTOKENS,
1.68 +
1.69 +/**
1.70 +Specifies a tokenized type.
1.71 +*/
1.72 + EAttributeType_ENTITY,
1.73 +
1.74 +/**
1.75 +Specifies a tokenized type.
1.76 +*/
1.77 + EAttributeType_ENTITIES,
1.78 +
1.79 +/**
1.80 +Specifies a tokenized type.
1.81 +*/
1.82 + EAttributeType_NOTATION,
1.83 +
1.84 +/**
1.85 +Specifies no type, or unsupported.
1.86 +*/
1.87 + EAttributeType_NONE,
1.88 +
1.89 + };
1.90 +
1.91 +
1.92 +
1.93 +
1.94 +class RAttribute
1.95 +/**
1.96 +The RAttribute class holds an attribute's description belonging to an element.
1.97 +@see RAttributeArray
1.98 +
1.99 +@publishedAll
1.100 +@released
1.101 +*/
1.102 + {
1.103 +public:
1.104 +
1.105 +/**
1.106 +@publishedPartner
1.107 +@released
1.108 +*/
1.109 + IMPORT_C RAttribute();
1.110 +
1.111 +/**
1.112 +@publishedPartner
1.113 +@released
1.114 +*/
1.115 + IMPORT_C RAttribute Copy();
1.116 +
1.117 +/**
1.118 +@publishedPartner
1.119 +@released
1.120 +*/
1.121 + IMPORT_C void Close();
1.122 +
1.123 +/**
1.124 +@publishedPartner
1.125 +@released
1.126 +*/
1.127 + IMPORT_C void Open(const RString& aUri, const RString& aPrefix, const RString& aLocalName,
1.128 + const TAttributeType aType = EAttributeType_NONE);
1.129 +
1.130 +/**
1.131 +@publishedPartner
1.132 +@released
1.133 +*/
1.134 + IMPORT_C void Open(const RString& aUri, const RString& aPrefix, const RString& aLocalName,
1.135 + const RString& aValue, const TAttributeType aType = EAttributeType_NONE);
1.136 +
1.137 + IMPORT_C const RTagInfo& Attribute() const;
1.138 + IMPORT_C const RString& Value() const;
1.139 + IMPORT_C TAttributeType Type() const;
1.140 +
1.141 +/**
1.142 +@publishedPartner
1.143 +@released
1.144 +*/
1.145 + IMPORT_C void SetValue(const RString& aValue);
1.146 +
1.147 +private:
1.148 +
1.149 +/**
1.150 +Holds information about the attribute.
1.151 +*/
1.152 + RTagInfo iAttribute;
1.153 +
1.154 +/**
1.155 +Holds the attribute's value.
1.156 +*/
1.157 + RString iValue;
1.158 +
1.159 +/**
1.160 +Holds the attribute's type.
1.161 +*/
1.162 + TAttributeType iType;
1.163 +
1.164 + };
1.165 +
1.166 +
1.167 +/**
1.168 +Defines a list of attributes for an element.
1.169 +@see MContentHandler
1.170 +
1.171 +@publishedAll
1.172 +@released
1.173 +*/
1.174 +typedef RArray<RAttribute> RAttributeArray;
1.175 +
1.176 +}
1.177 +
1.178 +#endif //__ATTRIBUTE_H__