1.1 --- a/epoc32/include/xmlengattr.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,192 +0,0 @@
1.4 -/*
1.5 -* Copyright (c) 2004-2006 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: Attribute node functions
1.18 -*
1.19 -*/
1.20 -
1.21 -
1.22 -
1.23 -
1.24 -
1.25 -
1.26 -
1.27 -#ifndef XMLENGINE_ATTR_H_INCLUDED
1.28 -#define XMLENGINE_ATTR_H_INCLUDED
1.29 -
1.30 -#include "xmlengnode.h"
1.31 -
1.32 -/**
1.33 - * Instance of TXmlEngAttr class represents an XML attribute in the DOM tree.
1.34 - *
1.35 - * Is a storage attributes properties. Implements DOM action for it.
1.36 - *
1.37 - * @lib XmlEngineDOM.lib
1.38 - * @since S60 v3.1
1.39 - */
1.40 -class TXmlEngAttr : public TXmlEngNode
1.41 -{
1.42 - public:
1.43 - /**
1.44 - * Default constructor
1.45 - *
1.46 - * @since S60 v3.1
1.47 - */
1.48 - inline TXmlEngAttr();
1.49 -
1.50 -
1.51 - /**
1.52 - * Clones attribute node
1.53 - *
1.54 - * @since S60 v3.1
1.55 - * @return A copy of the attribute with its value
1.56 - *
1.57 - * @note Namespace of the attribute is reset; use
1.58 - * TXmlEngNode::CopyToL(TXmlEngNode), which finds appropriate or creates
1.59 - * new namespace declaration on the new parent node (argument should be
1.60 - * an TXmlEngElement handle)
1.61 - *
1.62 - * @see CopyToL(TXmlEngNode)
1.63 - */
1.64 - IMPORT_C TXmlEngAttr CopyL() const;
1.65 -
1.66 - /**
1.67 - * Get owner element
1.68 - *
1.69 - * @since S60 v3.1
1.70 - * @return TXmlEngElement that contains the attribute
1.71 - *
1.72 - * Same as TXmlEngNode::ParentNode() but returns TXmlEngElement
1.73 - * instead of TXmlEngNode.
1.74 - *
1.75 - * @note Copies of attributes [TXmlEngAttr::CopyL()] and newly created
1.76 - * attribute nodes [RXmlEngDocument::CreateAttributeL(..)] do not have
1.77 - * parent element until they are attached to some element.
1.78 - */
1.79 - IMPORT_C const TXmlEngElement OwnerElement() const;
1.80 -
1.81 - /**
1.82 - * Check attribute name.
1.83 - *
1.84 - * @since S60 v3.1
1.85 - * @return Local name of the attribute
1.86 - *
1.87 - * @note Equal to TXmlEngNode::Name(), but works faster.
1.88 - *
1.89 - * Never call this on NULL object!
1.90 - * @see TXmlEngNode::Name()
1.91 - */
1.92 - IMPORT_C TPtrC8 Name() const;
1.93 -
1.94 - /**
1.95 - * Get element value.
1.96 - *
1.97 - * @since S60 v3.1
1.98 - * @return Attribute's contents
1.99 - *
1.100 - * @note For values consisting of more then one TXmlEngTextNode node
1.101 - * (as attribute's child) returns only the begining of the value;
1.102 - * this happens when the value is represented by list of TXmlEngTextNode
1.103 - * and TXmlEngEntityReference nodes.
1.104 - *
1.105 - * @see IsSimpleContents(), WholeValueCopyL()
1.106 - */
1.107 - IMPORT_C TPtrC8 Value() const;
1.108 -
1.109 - /**
1.110 - * Get copy of attribute content
1.111 - *
1.112 - * @since S60 v3.1
1.113 - * @return Complex value of the attribute,
1.114 - * probably consisting of text nodes and entity references
1.115 - *
1.116 - * Since the value may be composed from a set of TXmlEngTextNode
1.117 - * and EntityRefernce nodes, the returned result is newly allocated
1.118 - * string, which should be freed by caller.
1.119 - *
1.120 - * <B style="color: red">BE SURE TO FREE THE RESULT STRING!!!</B>
1.121 - *
1.122 - * Example usage of the API:
1.123 - * @code
1.124 - * RBuf8 value;
1.125 - * attr.WholeValueCopyL(value);
1.126 - * ...
1.127 - * value.Close();
1.128 - * @endcode
1.129 - *
1.130 - * @see TXmlEngAttr::Value(), TXmlEngNode::Value(),
1.131 - * TXmlEngNode::IsSimpleTextContents(),
1.132 - * TXmlEngNode::WholeTextContentsCopyL()
1.133 - *
1.134 - * @note In most cases using Value() is enough (and it needs no memory allocation).
1.135 - * Use IsSimpleTextContents() if there doubts can Value() be used or not safely.
1.136 - */
1.137 - IMPORT_C void WholeValueCopyL(RBuf8& aBuffer) const;
1.138 -
1.139 - /**
1.140 - * Sets new value of the attribute. Provided new value will be escaped
1.141 - * as needed.
1.142 - *
1.143 - * @ since S60 v3.1
1.144 - * @param aNewValue A string value for the attribute
1.145 - *
1.146 - * The new value should not contain entity references.
1.147 - * Entity references are not expanded, but used as text, because
1.148 - * the ampersand (&) character of reference is escaped.
1.149 - *
1.150 - * @see SetEscapedValueL(const TDesC8&)
1.151 - */
1.152 - IMPORT_C void SetValueL(const TDesC8& aNewValue);
1.153 -
1.154 - /**
1.155 - * Sets new value from escaped XML character data that may contain
1.156 - * entity references.
1.157 - *
1.158 - * The value as if it is an escaped contents from XML file.
1.159 - * If the value contains entity references, then the resulting
1.160 - * content of the attribute is a list of TXmlEngTextNode
1.161 - * and TXmlEngEntityRefeerence nodes.
1.162 - * Predefined entities are converted into characters they represent.
1.163 - *
1.164 - * @param aNewValue is a new attribute value
1.165 - * @since S60 v3.1
1.166 - *
1.167 - * @see TXmlEngAttr::SetValueL(const TDesC8&)
1.168 - */
1.169 - IMPORT_C void SetEscapedValueL(const TDesC8& aNewValue);
1.170 -
1.171 - /**
1.172 - * Sets new attribute value exactly as presented in the string.
1.173 - *
1.174 - * Predefined entities are not converted into characters they represent.
1.175 - *
1.176 - * @param aNewValue is a new attribute value
1.177 - * @since S60 v3.2
1.178 - *
1.179 - * @see TXmlEngAttr::SetValueL(const TDesC8&)
1.180 - */
1.181 - IMPORT_C void SetValueNoEncL(const TDesC8& aNewValue );
1.182 -
1.183 -protected:
1.184 - /**
1.185 - * Constructor
1.186 - *
1.187 - * @since S60 v3.1
1.188 - * @param aInternal attribute pointer
1.189 - */
1.190 - inline TXmlEngAttr(void* aInternal);
1.191 -};
1.192 -
1.193 -#include "xmlengattr.inl"
1.194 -
1.195 -#endif /* XMLENGINE_ATTR_H_INCLUDED */