Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Attribute node functions
24 #ifndef XMLENGINE_ATTR_H_INCLUDED
25 #define XMLENGINE_ATTR_H_INCLUDED
27 #include "xmlengnode.h"
30 * Instance of TXmlEngAttr class represents an XML attribute in the DOM tree.
32 * Is a storage attributes properties. Implements DOM action for it.
34 * @lib XmlEngineDOM.lib
37 class TXmlEngAttr : public TXmlEngNode
49 * Clones attribute node
52 * @return A copy of the attribute with its value
54 * @note Namespace of the attribute is reset; use
55 * TXmlEngNode::CopyToL(TXmlEngNode), which finds appropriate or creates
56 * new namespace declaration on the new parent node (argument should be
57 * an TXmlEngElement handle)
59 * @see CopyToL(TXmlEngNode)
61 IMPORT_C TXmlEngAttr CopyL() const;
67 * @return TXmlEngElement that contains the attribute
69 * Same as TXmlEngNode::ParentNode() but returns TXmlEngElement
70 * instead of TXmlEngNode.
72 * @note Copies of attributes [TXmlEngAttr::CopyL()] and newly created
73 * attribute nodes [RXmlEngDocument::CreateAttributeL(..)] do not have
74 * parent element until they are attached to some element.
76 IMPORT_C const TXmlEngElement OwnerElement() const;
79 * Check attribute name.
82 * @return Local name of the attribute
84 * @note Equal to TXmlEngNode::Name(), but works faster.
86 * Never call this on NULL object!
87 * @see TXmlEngNode::Name()
89 IMPORT_C TPtrC8 Name() const;
95 * @return Attribute's contents
97 * @note For values consisting of more then one TXmlEngTextNode node
98 * (as attribute's child) returns only the begining of the value;
99 * this happens when the value is represented by list of TXmlEngTextNode
100 * and TXmlEngEntityReference nodes.
102 * @see IsSimpleContents(), WholeValueCopyL()
104 IMPORT_C TPtrC8 Value() const;
107 * Get copy of attribute content
110 * @return Complex value of the attribute,
111 * probably consisting of text nodes and entity references
113 * Since the value may be composed from a set of TXmlEngTextNode
114 * and EntityRefernce nodes, the returned result is newly allocated
115 * string, which should be freed by caller.
117 * <B style="color: red">BE SURE TO FREE THE RESULT STRING!!!</B>
119 * Example usage of the API:
122 * attr.WholeValueCopyL(value);
127 * @see TXmlEngAttr::Value(), TXmlEngNode::Value(),
128 * TXmlEngNode::IsSimpleTextContents(),
129 * TXmlEngNode::WholeTextContentsCopyL()
131 * @note In most cases using Value() is enough (and it needs no memory allocation).
132 * Use IsSimpleTextContents() if there doubts can Value() be used or not safely.
134 IMPORT_C void WholeValueCopyL(RBuf8& aBuffer) const;
137 * Sets new value of the attribute. Provided new value will be escaped
141 * @param aNewValue A string value for the attribute
143 * The new value should not contain entity references.
144 * Entity references are not expanded, but used as text, because
145 * the ampersand (&) character of reference is escaped.
147 * @see SetEscapedValueL(const TDesC8&)
149 IMPORT_C void SetValueL(const TDesC8& aNewValue);
152 * Sets new value from escaped XML character data that may contain
155 * The value as if it is an escaped contents from XML file.
156 * If the value contains entity references, then the resulting
157 * content of the attribute is a list of TXmlEngTextNode
158 * and TXmlEngEntityRefeerence nodes.
159 * Predefined entities are converted into characters they represent.
161 * @param aNewValue is a new attribute value
164 * @see TXmlEngAttr::SetValueL(const TDesC8&)
166 IMPORT_C void SetEscapedValueL(const TDesC8& aNewValue);
169 * Sets new attribute value exactly as presented in the string.
171 * Predefined entities are not converted into characters they represent.
173 * @param aNewValue is a new attribute value
176 * @see TXmlEngAttr::SetValueL(const TDesC8&)
178 IMPORT_C void SetValueNoEncL(const TDesC8& aNewValue );
185 * @param aInternal attribute pointer
187 inline TXmlEngAttr(void* aInternal);
190 #include "xmlengattr.inl"
192 #endif /* XMLENGINE_ATTR_H_INCLUDED */