KHtml

path.h
1 /*
2  * path.h - Copyright 2005 Frerich Raabe <[email protected]>
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 #ifndef PATH_H
26 #define PATH_H
27 
28 #include "expression.h"
29 #include "step.h"
30 
31 #include <QList>
32 
33 int khtmlxpathyyparse();
34 
35 namespace khtml
36 {
37 namespace XPath
38 {
39 
40 class Filter : public Expression
41 {
42 public:
43  Filter(Expression *expr,
44  const QList<Predicate *> &predicates = QList<Predicate *>());
45  virtual ~Filter();
46 
47  QString dump() const override;
48 
49 private:
50  Value doEvaluate() const override;
51 
52  Expression *m_expr;
53  QList<Predicate *> m_predicates;
54 };
55 
56 class LocationPath : public Expression
57 {
58  friend int ::khtmlxpathyyparse();
59 public:
60  LocationPath();
61  virtual ~LocationPath();
62 
63  void optimize();
64  QString dump() const override;
65 
66 private:
67  Value doEvaluate() const override;
68 
69  QList<Step *> m_steps;
70  bool m_absolute;
71 };
72 
73 class Path : public Expression
74 {
75 public:
76  Path(Filter *filter, LocationPath *path);
77  virtual ~Path();
78 
79  QString dump() const override;
80 
81 private:
82  Value doEvaluate() const override;
83 
84  Filter *m_filter;
85  LocationPath *m_path;
86 };
87 
88 } // namespace XPath
89 
90 } // namespace khtml
91 
92 #endif // PATH_H
93 
This file is part of the HTML rendering engine for KDE.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.