|
1 /* |
|
2 * Copyright (c) 2005,2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Represent single xmluiml attribute |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef XN_DOM_ATTRIBUTE_H |
|
21 #define XN_DOM_ATTRIBUTE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <s32strm.h> |
|
26 #include "mxndomlistitem.h" |
|
27 |
|
28 //CLASS FORWARD |
|
29 |
|
30 class CXnDomStringPool; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * @ingroup group_domdocument |
|
36 * Represent attribute name and value as strings. |
|
37 * |
|
38 * @lib xndomdocument.lib |
|
39 * @since Series 60 3.1 |
|
40 */ |
|
41 class CXnDomAttribute : public CBase, public MXnDomListItem |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor 8 bit. |
|
47 */ |
|
48 IMPORT_C static CXnDomAttribute* NewL( |
|
49 const TDesC8& aName, |
|
50 CXnDomStringPool& aStringPool ); |
|
51 |
|
52 /** |
|
53 * Two-phased stream constructor. |
|
54 */ |
|
55 static CXnDomAttribute* NewL( |
|
56 RReadStream& aStream, |
|
57 CXnDomStringPool& aStringPool ); |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 IMPORT_C virtual ~CXnDomAttribute(); |
|
62 |
|
63 public: // New functions |
|
64 /** |
|
65 * Makes a copy from original attribute. |
|
66 * @since Series 60 3.1 |
|
67 * @return Pointer to attribute. Attribute ownership is transferred to a caller |
|
68 */ |
|
69 IMPORT_C CXnDomAttribute* CloneL(); |
|
70 |
|
71 /** |
|
72 * Makes a copy from original property. |
|
73 * @since Series 60 3.1 |
|
74 * @param Original string pool clone. |
|
75 * @return Pointer to an attribute. Ownership is transferred to a caller. |
|
76 */ |
|
77 CXnDomAttribute* CloneL( CXnDomStringPool& aStringPool ); |
|
78 |
|
79 /** |
|
80 * Get the attribute value. |
|
81 * @since Series 60 3.1 |
|
82 * @return Pointer to a attribute value string. If value is not set KNullDesC8 is returned. |
|
83 */ |
|
84 IMPORT_C const TDesC8& Value(); |
|
85 |
|
86 /** |
|
87 * Set attribute value. |
|
88 * @since Series 60 3.1 |
|
89 * @param aValue Attribute string value |
|
90 */ |
|
91 IMPORT_C void SetValueL( const TDesC8& aValue ); |
|
92 |
|
93 /** |
|
94 * Get the attributes name string pool index. |
|
95 * @since Series 60 3.1 |
|
96 * @return String pool index. |
|
97 */ |
|
98 IMPORT_C TInt16 NameStringPoolIndex()const; |
|
99 |
|
100 /** |
|
101 * Get the attributes value string pool index. |
|
102 * @since Series 60 3.1 |
|
103 * @return String pool index. |
|
104 */ |
|
105 IMPORT_C TInt16 ValueStringPoolIndex()const; |
|
106 |
|
107 public: //From CXnDomListItem |
|
108 |
|
109 /** |
|
110 * Documented in CXnDomListItem::Size |
|
111 */ |
|
112 IMPORT_C const TDesC8& Name(); |
|
113 |
|
114 |
|
115 /** |
|
116 * Documented in CXnDomListItem::Size |
|
117 */ |
|
118 TInt Size() const; |
|
119 |
|
120 /** |
|
121 * Documented in CXnDomListItem::Size |
|
122 */ |
|
123 void ExternalizeL( RWriteStream& aStream ) const; |
|
124 |
|
125 /** |
|
126 * Internalize property. |
|
127 * @since Series 60 3.1 |
|
128 * @param aStream Input stream |
|
129 */ |
|
130 void InternalizeL( RReadStream& aStream ); |
|
131 private: |
|
132 |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 CXnDomAttribute( CXnDomStringPool& aStringPool ); |
|
137 |
|
138 /** |
|
139 * By default Symbian 2nd phase constructor is private. |
|
140 */ |
|
141 void ConstructL( const TDesC8& aName ); |
|
142 |
|
143 |
|
144 private: // Data |
|
145 //String pool to get string for references, not owned |
|
146 CXnDomStringPool& iStringPool; |
|
147 |
|
148 //Attribute name reference |
|
149 TInt16 iNameRef; |
|
150 |
|
151 //Attribute value reference |
|
152 TInt16 iValueRef; |
|
153 |
|
154 }; |
|
155 |
|
156 #endif // XN_DOM_ATTRIBUTE_H |
|
157 |
|
158 // End of File |