1 /* |
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
3 * All rights reserved. |
3 // This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
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 |
5 // which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
7 // |
8 * |
8 // Initial Contributors: |
9 * Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
10 // |
11 * |
11 // Contributors: |
12 * Contributors: |
12 // |
13 * |
13 // Description: |
14 * Description: All text nodes functions |
14 // All text nodes functions |
15 * |
15 // |
16 */ |
|
17 |
16 |
18 |
17 |
19 |
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGCHARACTERDATA_H |
|
25 #define XMLENGCHARACTERDATA_H |
20 |
26 |
21 |
27 #include <xml/dom/xmlengnode.h> |
22 |
|
23 |
|
24 #ifndef XMLENGINE_CHARACTERDATA_H_INCLUDED |
|
25 #define XMLENGINE_CHARACTERDATA_H_INCLUDED |
|
26 |
|
27 #include "xmlengnode.h" |
|
28 |
28 |
29 /** |
29 /** |
30 * Instance of TXmlEngCharacterData class represents all kinds of XML text nodes |
30 This class represents XML text nodes in the DOM tree. Inherited classes |
31 * (i.e. text node, comment node) in the DOM tree. |
31 further specialize (e.g. TXmlEngTextNode, TXmlEngComment). |
32 * |
32 |
33 * Describe DOM action for nodes that contains text data. |
33 The CharacterData Interface is described by the DOM Spec here: |
34 * DOM spec: |
34 http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-FF21A306 |
35 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-FF21A306 |
|
36 * |
|
37 * @lib XmlEngineDOM.lib |
|
38 * @since S60 v3.1 |
|
39 */ |
35 */ |
40 class TXmlEngCharacterData : public TXmlEngNode |
36 class TXmlEngCharacterData : public TXmlEngNode |
41 { |
37 { |
42 public: |
38 public: |
43 |
39 |
44 /** |
40 /** Get contents of the node. |
45 * Get content of the node. |
41 @return The content of the node |
46 * |
42 */ |
47 * @since S60 v3.1 |
|
48 * @return String with nodes content |
|
49 * |
|
50 * This method applies to TXmlEngCDATASection, TXmlEngComment and TXmlEngTextNode nodes. |
|
51 */ |
|
52 IMPORT_C TPtrC8 Contents() const; |
43 IMPORT_C TPtrC8 Contents() const; |
53 |
44 |
54 /** |
45 /** |
55 * Sets contents of basic character nodes: TXmlEngTextNode, TXmlEngComment, TXmlEngCDATASection |
46 Sets contents of the node. |
56 * |
47 |
57 * @since S60 v3.1 |
48 The input is taken as non-escaped: for example, |
58 * @param aNewContents The actual value to store |
49 aNewContents = "123 > 34 && P" will be serialized as "123 > 34 && P" |
59 * |
50 |
60 * The input is taken as non-escaped: for example, |
51 @param aNewContents The actual value to store |
61 * aNewContents = "123 > 34 && P" will be serialized as "123 > 34 && P" |
52 @leave - One of the system-wide error codes |
62 * |
53 */ |
63 * Escaped contents may be set only for TXmlEngElement and TXmlEngAttr nodes. |
|
64 * @see TXmlEngAttr::SetEscapedValueL(const TDesC8&), TXmlEngElement::SetEscapedTextL(const TDesC8&), |
|
65 */ |
|
66 IMPORT_C void SetContentsL(const TDesC8& aNewContents); |
54 IMPORT_C void SetContentsL(const TDesC8& aNewContents); |
67 |
55 |
68 /** |
56 /** Append to the contents of the node |
69 * Extends the contents of the node by appending aString |
57 @param aString Content to be appended |
70 * |
58 @leave KXmlEngErrNullNode Node is NULL |
71 * @since S60 v3.1 |
59 @leave - One of the system-wide error codes |
72 * @param aString Content to be added to current content |
60 */ |
73 */ |
|
74 IMPORT_C void AppendContentsL(const TDesC8& aString); |
61 IMPORT_C void AppendContentsL(const TDesC8& aString); |
75 |
62 |
76 /** |
63 /** Get length of the content. |
77 * Get length of the content |
64 @return Number of characters in the contents |
78 * |
65 */ |
79 * @since S60 v3.1 |
|
80 * @return Number of characters in the contents |
|
81 */ |
|
82 IMPORT_C TUint Length() const; |
66 IMPORT_C TUint Length() const; |
83 |
67 |
84 protected: |
68 protected: |
85 /** |
69 /** Default constructor */ |
86 * Default constructor |
70 inline TXmlEngCharacterData(); |
87 * |
|
88 * @since S60 v3.1 |
|
89 */ |
|
90 inline TXmlEngCharacterData(); // protected from API users |
|
91 |
71 |
92 /** |
72 /** |
93 * Constructor |
73 Constructor |
94 * |
74 @param aInternal node pointer |
95 * @since S60 v3.1 |
75 */ |
96 * @param aInternal node pointer |
|
97 */ |
|
98 inline TXmlEngCharacterData(void* aInternal); |
76 inline TXmlEngCharacterData(void* aInternal); |
99 }; |
77 }; |
100 |
78 |
101 |
79 |
102 #include "xmlengcharacterdata.inl" |
80 #include <xml/dom/xmlengcharacterdata.inl> |
103 |
81 |
104 #endif /* XMLENGINE_CHARACTERDATA_H_INCLUDED */ |
82 #endif /* XMLENGCHARACTERDATA_H */ |
105 |
83 |