|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __ATTRIBUTE_H__ |
|
17 #define __ATTRIBUTE_H__ |
|
18 |
|
19 #include <xml/taginfo.h> |
|
20 |
|
21 namespace Xml |
|
22 { |
|
23 |
|
24 enum TAttributeType |
|
25 /** |
|
26 Specifies the type of this attribute object. |
|
27 These values are defined in the xml specification. |
|
28 For other specifications they may also be used or 'none'. |
|
29 @see http://www.w3.org/TR/REC-xml#sec-attribute-types |
|
30 |
|
31 @publishedAll |
|
32 @released |
|
33 */ |
|
34 { |
|
35 /** |
|
36 Specifies a string type. |
|
37 */ |
|
38 EAttributeType_CDATA, |
|
39 |
|
40 /** |
|
41 Specifies a tokenized type. |
|
42 */ |
|
43 EAttributeType_ID, |
|
44 |
|
45 /** |
|
46 Specifies a tokenized type. |
|
47 */ |
|
48 EAttributeType_IDREF, |
|
49 |
|
50 /** |
|
51 Specifies a tokenized type. |
|
52 */ |
|
53 EAttributeType_IDREFS, |
|
54 |
|
55 /** |
|
56 Specifies a tokenized type. |
|
57 */ |
|
58 EAttributeType_NMTOKEN, |
|
59 |
|
60 /** |
|
61 Specifies a tokenized type. |
|
62 */ |
|
63 EAttributeType_NMTOKENS, |
|
64 |
|
65 /** |
|
66 Specifies a tokenized type. |
|
67 */ |
|
68 EAttributeType_ENTITY, |
|
69 |
|
70 /** |
|
71 Specifies a tokenized type. |
|
72 */ |
|
73 EAttributeType_ENTITIES, |
|
74 |
|
75 /** |
|
76 Specifies a tokenized type. |
|
77 */ |
|
78 EAttributeType_NOTATION, |
|
79 |
|
80 /** |
|
81 Specifies no type, or unsupported. |
|
82 */ |
|
83 EAttributeType_NONE, |
|
84 |
|
85 }; |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 class RAttribute |
|
91 /** |
|
92 The RAttribute class holds an attribute's description belonging to an element. |
|
93 @see RAttributeArray |
|
94 |
|
95 @publishedAll |
|
96 @released |
|
97 */ |
|
98 { |
|
99 public: |
|
100 |
|
101 /** |
|
102 @publishedPartner |
|
103 @released |
|
104 */ |
|
105 IMPORT_C RAttribute(); |
|
106 |
|
107 /** |
|
108 @publishedPartner |
|
109 @released |
|
110 */ |
|
111 IMPORT_C RAttribute Copy(); |
|
112 |
|
113 /** |
|
114 @publishedPartner |
|
115 @released |
|
116 */ |
|
117 IMPORT_C void Close(); |
|
118 |
|
119 /** |
|
120 @publishedPartner |
|
121 @released |
|
122 */ |
|
123 IMPORT_C void Open(const RString& aUri, const RString& aPrefix, const RString& aLocalName, |
|
124 const TAttributeType aType = EAttributeType_NONE); |
|
125 |
|
126 /** |
|
127 @publishedPartner |
|
128 @released |
|
129 */ |
|
130 IMPORT_C void Open(const RString& aUri, const RString& aPrefix, const RString& aLocalName, |
|
131 const RString& aValue, const TAttributeType aType = EAttributeType_NONE); |
|
132 |
|
133 IMPORT_C const RTagInfo& Attribute() const; |
|
134 IMPORT_C const RString& Value() const; |
|
135 IMPORT_C TAttributeType Type() const; |
|
136 |
|
137 /** |
|
138 @publishedPartner |
|
139 @released |
|
140 */ |
|
141 IMPORT_C void SetValue(const RString& aValue); |
|
142 |
|
143 private: |
|
144 |
|
145 /** |
|
146 Holds information about the attribute. |
|
147 */ |
|
148 RTagInfo iAttribute; |
|
149 |
|
150 /** |
|
151 Holds the attribute's value. |
|
152 */ |
|
153 RString iValue; |
|
154 |
|
155 /** |
|
156 Holds the attribute's type. |
|
157 */ |
|
158 TAttributeType iType; |
|
159 |
|
160 }; |
|
161 |
|
162 |
|
163 /** |
|
164 Defines a list of attributes for an element. |
|
165 @see MContentHandler |
|
166 |
|
167 @publishedAll |
|
168 @released |
|
169 */ |
|
170 typedef RArray<RAttribute> RAttributeArray; |
|
171 |
|
172 } |
|
173 |
|
174 #endif //__ATTRIBUTE_H__ |