1 /* |
|
2 * Copyright (c) 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: CLocalDocumentNode |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __LOCALDOCUMENTNODE__ |
|
22 #define __LOCALDOCUMENTNODE__ |
|
23 |
|
24 #include "XdmNodeFactory.h" |
|
25 #include "XdmDocumentNode.h" |
|
26 |
|
27 class CLocalProtocol; |
|
28 class CXdmNodeAttribute; |
|
29 |
|
30 //CLASS DECLARATION |
|
31 NONSHARABLE_CLASS( CLocalDocumentNode ) : public CXdmDocumentNode, |
|
32 public MXdmNodeFactory |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Destructor. |
|
38 */ |
|
39 IMPORT_C virtual ~CLocalDocumentNode(); |
|
40 |
|
41 public: // New functions |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * |
|
46 * @param TDesC8& Name of the new element |
|
47 * @return CXdmDocumentNode* |
|
48 */ |
|
49 static CLocalDocumentNode* NewL( CXdmEngine& aXdmEngine, |
|
50 CLocalProtocol& aLocalProtocol ); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * |
|
55 * @param TDesC8& Name of the new element |
|
56 * @return CXdmDocumentNode* |
|
57 */ |
|
58 static CLocalDocumentNode* NewL( CXdmEngine& aXdmEngine, |
|
59 const TDesC& aNodeName, |
|
60 CLocalProtocol& aLocalProtocol ); |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * |
|
65 * @param TDesC8& Name of the new element |
|
66 * @return CXdmDocumentNode* |
|
67 */ |
|
68 static CLocalDocumentNode* NewL( CXdmEngine& aXdmEngine, |
|
69 CLocalProtocol& aLocalProtocol, |
|
70 const CXdmDocumentNode& aAnotherNode, |
|
71 const CXdmDocumentNode& aParentNode ); |
|
72 |
|
73 /** |
|
74 * Two-phased constructor. |
|
75 * |
|
76 * @param TDesC8& Name of the new element |
|
77 * @param CXdmDocumentNode* The parent of the new node |
|
78 * @return CXdmDocumentNode* |
|
79 */ |
|
80 static CLocalDocumentNode* NewL( CXdmEngine& aXdmEngine, |
|
81 const TDesC& aNodeName, |
|
82 CXdmDocumentNode* aParentNode, |
|
83 CLocalProtocol& aLocalProtocol ); |
|
84 |
|
85 /** |
|
86 * Two-phased constructor. |
|
87 * |
|
88 * @param TBool Leaf node indicator |
|
89 * @param TDesC8& Name of the new element |
|
90 * @param CXdmDocumentNode* The parent of the new node |
|
91 * @return CXdmDocumentNode* |
|
92 */ |
|
93 static CLocalDocumentNode* NewL( const TBool aLeafNode, |
|
94 CXdmEngine& aXdmEngine, |
|
95 const TDesC& aNodeName, |
|
96 CXdmDocumentNode* aParentNode, |
|
97 CLocalProtocol& aLocalProtocol ); |
|
98 |
|
99 /** |
|
100 * Two-phased constructor. |
|
101 * |
|
102 * @param TBool Leaf node indicator |
|
103 * @param TDesC8& Name of the new element |
|
104 * @param CXdmDocumentNode* The parent of the new node |
|
105 * @return CXdmDocumentNode* |
|
106 */ |
|
107 static CLocalDocumentNode* NewL( const TBool aLeafNode, |
|
108 CXdmEngine& aXdmEngine, |
|
109 CXdmDocumentNode* aParentNode, |
|
110 CLocalProtocol& aLocalProtocol ); |
|
111 |
|
112 /** |
|
113 * Set the next node in the list |
|
114 * @param The next node in the list |
|
115 * @return void |
|
116 */ |
|
117 void SetParentNode( CLocalDocumentNode*& aParentNode ); |
|
118 |
|
119 public: |
|
120 |
|
121 /** |
|
122 * Set the next node in the list |
|
123 * @param The next node in the list |
|
124 * @return void |
|
125 */ |
|
126 IMPORT_C void RemoveLocalL( CXdmDocumentNode* aChileNode ); |
|
127 |
|
128 /** |
|
129 * Set the next node in the list |
|
130 * @param The next node in the list |
|
131 * @return void |
|
132 */ |
|
133 IMPORT_C void AppendLocalL( CXdmDocumentNode* aChileNode ); |
|
134 |
|
135 /** |
|
136 * Set the next node in the list |
|
137 * @param The next node in the list |
|
138 * @return void |
|
139 */ |
|
140 IMPORT_C void ReplaceLocalL( CXdmDocumentNode* aNewNode, |
|
141 CXdmDocumentNode* aTargetNode ); |
|
142 |
|
143 private: |
|
144 |
|
145 /** |
|
146 * C++ constructor, private version. |
|
147 */ |
|
148 CLocalDocumentNode( CXdmEngine& aXdmEngine, |
|
149 CLocalProtocol& aLocalProtocol ); |
|
150 |
|
151 /** |
|
152 * C++ constructor, protected version. |
|
153 * |
|
154 * @param CXdmDocumentNode* The parent node of this element |
|
155 */ |
|
156 CLocalDocumentNode( CXdmEngine& aXdmEngine, |
|
157 CXdmDocumentNode* aParentNode, |
|
158 CLocalProtocol& aLocalProtocol ); |
|
159 |
|
160 /** |
|
161 * C++ constructor, another private version. |
|
162 */ |
|
163 CLocalDocumentNode( const TBool aLeafNode, |
|
164 CXdmEngine& aXdmEngine, |
|
165 CXdmDocumentNode* aParentNode, |
|
166 CLocalProtocol& aLocalProtocol ); |
|
167 |
|
168 /** |
|
169 * By default Symbian OS constructor is private. |
|
170 * |
|
171 * @param TDesC8& Name of this node |
|
172 * @return void |
|
173 */ |
|
174 virtual void CopyConstructL( const CXdmDocumentNode& aAnotherNode, |
|
175 const CXdmDocumentNode& aParentNode ); |
|
176 |
|
177 private: //From MXdmNodeFactory |
|
178 |
|
179 /** |
|
180 * Create a new child element |
|
181 * |
|
182 * @param TDesC8& Name of the new element |
|
183 * @return CXdmDocumentNode* |
|
184 */ |
|
185 CXdmDocumentNode* ChileNodeL(); |
|
186 |
|
187 /** |
|
188 * Create a new child element |
|
189 * |
|
190 * @param TDesC8& Name of the new element |
|
191 * @return CXdmDocumentNode* |
|
192 */ |
|
193 CXdmDocumentNode* ChileNodeL( const TDesC& aChildName ); |
|
194 |
|
195 /** |
|
196 * Create a new child element |
|
197 * |
|
198 * @param TDesC8& Name of the new element |
|
199 * @return CXdmDocumentNode* |
|
200 */ |
|
201 CXdmDocumentNode* ChileNodeL( const CXdmDocumentNode* aAnotherNode ); |
|
202 |
|
203 /** |
|
204 * Create a new attribute |
|
205 * |
|
206 * @param TDesC8& Name of the new attribute |
|
207 * @return CXdmNodeAttribute* |
|
208 */ |
|
209 CXdmNodeAttribute* AttributeL(); |
|
210 |
|
211 /** |
|
212 * Create a new attribute |
|
213 * |
|
214 * @param TDesC8& Name of the new attribute |
|
215 * @return CXdmNodeAttribute* |
|
216 */ |
|
217 CXdmNodeAttribute* AttributeL( const TDesC& aAttributeName ); |
|
218 |
|
219 private: //From MXdmNodeInterface |
|
220 |
|
221 /** |
|
222 * Copies the request data |
|
223 * @param aRequestData Data to be sent |
|
224 */ |
|
225 TPtrC8 Prefix() const; |
|
226 |
|
227 /** |
|
228 * Copies the request data |
|
229 * @param aRequestData Data to be sent |
|
230 */ |
|
231 void SetPrefixL( const TDesC8& aNamespacePrefix ); |
|
232 |
|
233 private: |
|
234 |
|
235 HBufC8* iPrefix; |
|
236 CLocalProtocol& iLocalProtocol; |
|
237 CLocalDocumentNode* iNextNode; |
|
238 }; |
|
239 |
|
240 #endif //__LOCALDOCUMENTNODE__ |
|
241 |
|
242 // End of File |
|