1 #ifndef __XPATHIMPL_H__
2 #define __XPATHIMPL_H__
4 /**
5 * Phoebe DOM Implementation.
6 *
7 * This is a C++ approximation of the W3C DOM model, which follows
8 * fairly closely the specifications in the various .idl files, copies of
9 * which are provided for reference. Most important is this one:
10 *
11 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
12 *
13 * Authors:
14 * Bob Jamison
15 *
16 * Copyright (C) 2005 Bob Jamison
17 *
18 * This library is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU Lesser General Public
20 * License as published by the Free Software Foundation; either
21 * version 2.1 of the License, or (at your option) any later version.
22 *
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 * Lesser General Public License for more details.
27 *
28 * You should have received a copy of the GNU Lesser General Public
29 * License along with this library; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 */
34 #include "xpath.h"
35 #include "domimpl.h"
38 namespace org
39 {
40 namespace w3c
41 {
42 namespace dom
43 {
44 namespace xpath
45 {
48 /*#########################################################################
49 ## XPathEvaluatorImpl
50 #########################################################################*/
52 /**
53 *
54 */
55 class XPathEvaluatorImpl : public XPathEvaluator
56 {
57 public:
59 /**
60 *
61 */
62 virtual XPathExpression *createExpression(
63 const DOMString &expression,
64 const XPathNSResolver *resolver)
65 throw (XPathException, dom::DOMException);
67 /**
68 *
69 */
70 virtual XPathNSResolver *createNSResolver(const Node *nodeResolver);
72 /**
73 *
74 */
75 virtual XPathResult *evaluate(
76 const DOMString &expression,
77 const Node *contextNode,
78 const XPathNSResolver *resolver,
79 const unsigned short type,
80 const XPathResult *result)
81 throw (XPathException, dom::DOMException);
83 //###################
84 //# Non-API methods
85 //###################
87 /**
88 *
89 */
90 virtual ~XPathEvaluatorImpl() {}
92 };
94 /*#########################################################################
95 ## XPathExpressionImpl
96 #########################################################################*/
98 /**
99 *
100 */
101 class XPathExpressionImpl : public XPathExpression
102 {
103 public:
106 /**
107 *
108 */
109 virtual XPathResult *evaluate(const Node *contextNode,
110 unsigned short type,
111 const XPathResult *result)
112 throw (XPathException, dom::DOMException);
115 //###################
116 //# Non-API methods
117 //###################
119 /**
120 *
121 */
122 virtual ~XPathExpressionImpl() {}
124 };
126 /*#########################################################################
127 ## XPathNSResolverImpl
128 #########################################################################*/
130 /**
131 *
132 */
133 class XPathNSResolverImpl : public XPathNSResolver
134 {
135 public:
137 /**
138 *
139 */
140 virtual DOMString lookupNamespaceURI(const DOMString &prefix);
143 //###################
144 //# Non-API methods
145 //###################
147 /**
148 *
149 */
150 virtual ~XPathNSResolverImpl() {}
152 };
154 /*#########################################################################
155 ## XPathResultImpl
156 #########################################################################*/
158 /**
159 *
160 */
161 class XPathResultImpl : public XPathResult
162 {
163 public:
165 /**
166 *
167 */
168 virtual unsigned short getResultType() throw (XPathException);
170 /**
171 *
172 */
173 virtual double getNumberValue() throw (XPathException);
175 /**
176 *
177 */
178 virtual DOMString getStringValue() throw (XPathException);
180 /**
181 *
182 */
183 virtual bool getBooleanValue() throw (XPathException);
185 /**
186 *
187 */
188 virtual Node *getSingleNodeValue() throw (XPathException);
190 /**
191 *
192 */
193 virtual bool getInvalidIteratorState() throw (XPathException);
195 /**
196 *
197 */
198 virtual unsigned long getSnapshotLength() throw (XPathException);
200 /**
201 *
202 */
203 virtual Node *iterateNext() throw (XPathException, dom::DOMException);;
205 /**
206 *
207 */
208 virtual Node *snapshotItem(unsigned long index) throw (XPathException);
210 //###################
211 //# Non-API methods
212 //###################
214 /**
215 *
216 */
217 virtual ~XPathResultImpl() {}
219 };
221 /*#########################################################################
222 ## XPathNamespaceImpl
223 #########################################################################*/
224 class XPathNamespaceImpl : public XPathNamespace, public NodeImpl
225 {
226 public:
228 /**
229 *
230 */
231 virtual Element *getOwnerElement() = 0;
234 //###################
235 //# Non-API methods
236 //###################
238 /**
239 *
240 */
241 virtual ~XPathNamespaceImpl() {}
243 };
249 } //namespace xpath
250 } //namespace dom
251 } //namespace w3c
252 } //namespace org
257 #endif /* __XPATHIMPL_H__ */
258 /*#########################################################################
259 ## E N D O F F I L E
260 #########################################################################*/