|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #include <SenXmlElement.h> |
|
26 #include "MSenProperty.h" |
|
27 |
|
28 #ifndef SEN_PROPERTIES_ELEMENT_H |
|
29 #define SEN_PROPERTIES_ELEMENT_H |
|
30 |
|
31 class CSenPropertiesElement : public CSenXmlElement, public MSenProperty |
|
32 { |
|
33 friend class CSenPropertiesFragment; |
|
34 |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Standard constructor. |
|
39 * @param aLocalName the local name for this element. |
|
40 * Leave codes: |
|
41 * KErrSenInvalidCharacters if aLocalName contains illegal characters. |
|
42 * KErrSenZeroLengthDescriptor if aLocalName is zero length. |
|
43 */ |
|
44 |
|
45 IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aLocalName, |
|
46 RStringPool* aStringPool); |
|
47 /** |
|
48 * Standard constructor. |
|
49 * @param aNsUri the namespace URI for this element. |
|
50 * @param aLocalName the local name for this element. |
|
51 * Leave codes: |
|
52 * KErrSenInvalidCharacters if aLocalName contains illegal characters. |
|
53 * KErrSenZeroLengthDescriptor if aLocalName is zero length. |
|
54 */ |
|
55 IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri, |
|
56 const TDesC8& aLocalName, |
|
57 RStringPool* aStringPool); |
|
58 |
|
59 /** |
|
60 * Standard constructor. |
|
61 * @param aNsUri the namespace URI for this element. |
|
62 * @param aLocalName the local name for this element. |
|
63 * @param aQName the qualified name for this element. |
|
64 * Leave codes: |
|
65 * KErrSenInvalidCharacters if aLocalName or aQName contains |
|
66 * illegal characters. |
|
67 * KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length. |
|
68 */ |
|
69 IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri, |
|
70 const TDesC8& aLocalName, |
|
71 const TDesC8& aQName, |
|
72 RStringPool* aStringPool); |
|
73 |
|
74 /** |
|
75 * Standard constructor. |
|
76 * @param aNsUri the namespace URI for this element. |
|
77 * @param aLocalName the local name for this element. |
|
78 * @param aQName the qualified name for this element. |
|
79 * @param apAttrs the attributes for this element. |
|
80 * Leave codes: |
|
81 * KErrSenInvalidCharacters if aLocalName or aQName contains |
|
82 * illegal characters. |
|
83 * KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length. |
|
84 */ |
|
85 IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri, |
|
86 const TDesC8& aLocalName, |
|
87 const TDesC8& aQName, |
|
88 const RAttributeArray& apAttrs, |
|
89 RStringPool* aStringPool); |
|
90 |
|
91 /** |
|
92 * Standard constructor. |
|
93 * @param aNsUri the namespace URI for this element. |
|
94 * @param aLocalName the local name for this element. |
|
95 * @param aQName the qualified name for this element. |
|
96 * @param apAttrs the attributes for this element. |
|
97 * @param aParent: the parent element for the new element |
|
98 * Leave codes: |
|
99 * KErrSenInvalidCharacters if aLocalName or aQName contains |
|
100 * illegal characters. |
|
101 * KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length. |
|
102 */ |
|
103 IMPORT_C static CSenPropertiesElement* NewL(const TDesC8& aNsUri, |
|
104 const TDesC8& aLocalName, |
|
105 const TDesC8& aQName, |
|
106 const RAttributeArray& apAttrs, |
|
107 CSenElement& aParent, |
|
108 RStringPool* aStringPool); |
|
109 |
|
110 // From CSenXmlElement: |
|
111 |
|
112 virtual CSenElement* CreateElementL(const TDesC8& aNsPrefix, |
|
113 const TDesC8& aLocalName); |
|
114 |
|
115 virtual CSenElement& AddElementL(const TDesC8& aNsUri, |
|
116 const TDesC8& aLocalName); |
|
117 |
|
118 virtual CSenElement& AddElementL(const TDesC8& aNsUri, |
|
119 const TDesC8& aLocalName, |
|
120 const TDesC8& aQName); |
|
121 |
|
122 virtual CSenElement& AddElementL(const TDesC8& aLocalName); |
|
123 |
|
124 virtual void WriteAsXMLToL(RWriteStream& aWriteStream); |
|
125 |
|
126 void CopyFromL(CSenElement& aSource); |
|
127 |
|
128 virtual const TDesC8& LocalName() const; |
|
129 |
|
130 virtual void Set( const TDesC8& aNsUri, |
|
131 const TDesC8& aLocalname, |
|
132 const TDesC8& aQName ); |
|
133 |
|
134 virtual TBool HasContent() const; |
|
135 |
|
136 virtual TPtrC8 Content() const; |
|
137 |
|
138 virtual TPtrC8 SetContentL(const TDesC8& aContent); |
|
139 |
|
140 virtual RWriteStream& ContentWriteStreamL(); |
|
141 |
|
142 /** |
|
143 * Destructor. |
|
144 */ |
|
145 virtual ~CSenPropertiesElement(); |
|
146 |
|
147 // From MSenProperty |
|
148 virtual TPtrC8 Name(); |
|
149 virtual TPtrC8 Type(); |
|
150 virtual TPtrC8 Value(); |
|
151 virtual TInt IntValue(TInt& aValue); |
|
152 virtual TInt BoolValue(TBool& aValue); |
|
153 |
|
154 /** |
|
155 * @param aTokens will contain tokanized values, |
|
156 * which ownership is NOT transferred to the caller(!) |
|
157 */ |
|
158 virtual TInt ValueTokensL(const TDesC8& aDelimiter, |
|
159 RPointerArray<TPtrC8>& aTokens); |
|
160 |
|
161 virtual void SetStringPool(RStringPool& aStringPool); |
|
162 |
|
163 protected: // New functions |
|
164 |
|
165 /** |
|
166 * C++ default constructor |
|
167 */ |
|
168 CSenPropertiesElement(); |
|
169 |
|
170 void BaseConstructL(const TDesC8& aLocalName, |
|
171 RStringPool* aStringPool); |
|
172 |
|
173 void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName, |
|
174 RStringPool* aStringPool); |
|
175 |
|
176 void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName, |
|
177 const TDesC8& aQName, RStringPool* aStringPool); |
|
178 |
|
179 void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName, |
|
180 const TDesC8& aQName, |
|
181 const RAttributeArray& apAttrs, |
|
182 RStringPool* aStringPool); |
|
183 |
|
184 void BaseConstructL(const TDesC8& aNsUri, const TDesC8& aLocalName, |
|
185 const TDesC8& aQName, |
|
186 const RAttributeArray& apAttrs, |
|
187 CSenElement& aParent, |
|
188 RStringPool* aStringPool); |
|
189 |
|
190 virtual void WriteContentToL(RWriteStream& aWriteStream); |
|
191 |
|
192 virtual void AllocContentBufL(); |
|
193 |
|
194 virtual RStringPool& StringPool(); |
|
195 |
|
196 protected: // Data |
|
197 RStringPool* ipStringPool; // Not owned |
|
198 RString iLocalName; // Owned |
|
199 RString iContent; // Owned |
|
200 }; |
|
201 |
|
202 #endif // SEN_PROPERTIES_ELEMENT_H |
|
203 |
|
204 // End of File |
|
205 |