|
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: Represents a CSS property. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef XN_DOM_PROPERTY_H |
|
21 #define XN_DOM_PROPERTY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <s32strm.h> |
|
26 #include "mxndomlistitem.h" |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CXnDomPropertyValue; |
|
31 class CXnDomList; |
|
32 class CXnDomStringPool; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * @ingroup group_domdocument |
|
38 * Represents a CSS property. |
|
39 * |
|
40 * @lib xndomdocument.lib |
|
41 * @since Series 60 3.1 |
|
42 */ |
|
43 class CXnDomProperty : public CBase, public MXnDomListItem |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Property value's pseudo class type |
|
48 */ |
|
49 enum TPseudoClass |
|
50 { |
|
51 ENone=0, |
|
52 EFocus, |
|
53 EPassiveFocus, |
|
54 EActive, |
|
55 EHold, |
|
56 EEnabled, |
|
57 EDisabled, |
|
58 EHover, |
|
59 ELink, |
|
60 EVisited, |
|
61 EEdit, |
|
62 EPressedDown |
|
63 }; |
|
64 public: // Constructors and destructor |
|
65 /** |
|
66 * Two-phased constructor. |
|
67 */ |
|
68 IMPORT_C static CXnDomProperty* NewL( |
|
69 const TDesC8& aName, |
|
70 CXnDomStringPool* aStringPool ); |
|
71 |
|
72 /** |
|
73 * Two-phased stream constructor. |
|
74 */ |
|
75 static CXnDomProperty* NewL( |
|
76 RReadStream& aStream, |
|
77 CXnDomStringPool* aStringPool ); |
|
78 /** |
|
79 * Two-phased constructor. |
|
80 */ |
|
81 IMPORT_C static CXnDomProperty* NewL( |
|
82 TInt16 aStringPoolIndex, |
|
83 CXnDomStringPool* aStringPool ); |
|
84 /** |
|
85 * Destructor. |
|
86 */ |
|
87 IMPORT_C virtual ~CXnDomProperty(); |
|
88 |
|
89 public: // New functions |
|
90 /** |
|
91 * Make a copy from original property. |
|
92 * @since Series 60 3.1 |
|
93 * @return Pointer to a property. Ownership is transferred to a caller. |
|
94 */ |
|
95 IMPORT_C CXnDomProperty* CloneL(); |
|
96 |
|
97 /** |
|
98 * Make a copy from original property. |
|
99 * @since Series 60 3.1 |
|
100 * @param Original string pool clone. |
|
101 * @return Pointer to a property. Ownership is transferred to a caller. |
|
102 */ |
|
103 IMPORT_C CXnDomProperty* CloneL( CXnDomStringPool& aStringPool ); |
|
104 |
|
105 /** |
|
106 * Get property value list. |
|
107 * @since Series 60 3.1 |
|
108 * @return Reference to property value list. |
|
109 */ |
|
110 IMPORT_C CXnDomList& PropertyValueList(); |
|
111 |
|
112 /** |
|
113 * Test if property has any value. |
|
114 * @since Series 60 3.1 |
|
115 * @return ETrue if at least one value exist |
|
116 */ |
|
117 IMPORT_C TBool IsValueSet(); |
|
118 |
|
119 /** |
|
120 * Test property's capability to inherit value. |
|
121 * @since Series 60 3.1 |
|
122 * @return ETrue if property's value can be inherited |
|
123 */ |
|
124 IMPORT_C TBool Inherited(); |
|
125 |
|
126 /** |
|
127 * Set property to be capable to inherit value. |
|
128 * @since Series 60 3.1 |
|
129 * @param aInherited ETrue inherit capable |
|
130 */ |
|
131 IMPORT_C void SetInherited( TBool aInherited ); |
|
132 |
|
133 /** |
|
134 * Get pointer to the dom's string pool. |
|
135 * @since Series 60 3.1 |
|
136 * @return Reference to string pool |
|
137 */ |
|
138 IMPORT_C CXnDomStringPool* StringPool() const; |
|
139 |
|
140 /** |
|
141 * Get the property's string pool index. |
|
142 * @since Series 60 3.1 |
|
143 * @return String pool index. |
|
144 */ |
|
145 IMPORT_C TInt16 StringPoolIndex()const; |
|
146 |
|
147 /** |
|
148 * Swap used string pool. |
|
149 * |
|
150 * @param aStringPool New string pool to be used. |
|
151 * Ownership not transferred! |
|
152 */ |
|
153 IMPORT_C void SwapStringPoolL( CXnDomStringPool* aStringPool ); |
|
154 |
|
155 public: //Pseudo class utility |
|
156 /** |
|
157 * Get value's pseudo class |
|
158 * @since Series 60 3.1 |
|
159 * @return Value's pseudo class |
|
160 */ |
|
161 IMPORT_C TPseudoClass PseudoClass()const; |
|
162 |
|
163 /** |
|
164 * Set value's pseudo class |
|
165 * @since Series 60 3.1 |
|
166 * @param aPseudoClass Pseudo class enumeration |
|
167 */ |
|
168 IMPORT_C void SetPseudoClass( TPseudoClass aPseudoClass ); |
|
169 |
|
170 public: //From CXnDomListItem |
|
171 |
|
172 /** |
|
173 * Documented in CXnDomListItem::Name |
|
174 */ |
|
175 IMPORT_C const TDesC8& Name(); |
|
176 |
|
177 /** |
|
178 * Documented in CXnDomListItem::Size |
|
179 */ |
|
180 TInt Size() const; |
|
181 |
|
182 /** |
|
183 * Documented in CXnDomListItem::ExternalizeL |
|
184 */ |
|
185 void ExternalizeL( RWriteStream& aStream ) const; |
|
186 |
|
187 /** |
|
188 * Documented in CXnDomListItem::InternalizeL |
|
189 */ |
|
190 void InternalizeL( RReadStream& aStream ); |
|
191 |
|
192 private: |
|
193 |
|
194 /** |
|
195 * C++ default constructor. |
|
196 */ |
|
197 CXnDomProperty( CXnDomStringPool* aStringPool); |
|
198 |
|
199 /** |
|
200 * C++ constructor with string pool index. |
|
201 */ |
|
202 CXnDomProperty( TInt16 aStringPoolIndex, CXnDomStringPool* aStringPool); |
|
203 |
|
204 /** |
|
205 * By default Symbian 2nd phase constructor is private. |
|
206 */ |
|
207 void ConstructL( const TDesC8& aName ); |
|
208 |
|
209 /** |
|
210 * By default Symbian 2nd phase constructor is private. |
|
211 */ |
|
212 void ConstructL(); |
|
213 |
|
214 private: // Data |
|
215 //String pool to get string for references, not owned |
|
216 CXnDomStringPool* iStringPool; |
|
217 |
|
218 // Pseudo class type for value |
|
219 TPseudoClass iPseudoClass; |
|
220 |
|
221 //Property's name reference to string pool |
|
222 TInt16 iNameRef; |
|
223 |
|
224 //Property owns a value list which has property's values |
|
225 CXnDomList* iPropValList; |
|
226 |
|
227 //Property is capable to inherit |
|
228 TBool iInherited; |
|
229 |
|
230 |
|
231 }; |
|
232 |
|
233 #endif // XN_DOM_PROPERTY_H |
|
234 |
|
235 // End of File |