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