1// qwebelement.sip generated by MetaSIP
2//
3// This file is part of the QtWebKit Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QWebFrame /External/;
24
25class QWebElement
26{
27%TypeHeaderCode
28#include <qwebelement.h>
29%End
30
31public:
32    QWebElement();
33    QWebElement(const QWebElement &);
34    ~QWebElement();
35    bool operator==(const QWebElement &o) const;
36    bool operator!=(const QWebElement &o) const;
37    bool isNull() const;
38    QWebElementCollection findAll(const QString &selectorQuery) const;
39    QWebElement findFirst(const QString &selectorQuery) const;
40    void setPlainText(const QString &text);
41    QString toPlainText() const;
42    void setOuterXml(const QString &markup);
43    QString toOuterXml() const;
44    void setInnerXml(const QString &markup);
45    QString toInnerXml() const;
46    void setAttribute(const QString &name, const QString &value);
47    void setAttributeNS(const QString &namespaceUri, const QString &name, const QString &value);
48    QString attribute(const QString &name, const QString &defaultValue = QString()) const;
49    QString attributeNS(const QString &namespaceUri, const QString &name, const QString &defaultValue = QString()) const;
50    bool hasAttribute(const QString &name) const;
51    bool hasAttributeNS(const QString &namespaceUri, const QString &name) const;
52    void removeAttribute(const QString &name);
53    void removeAttributeNS(const QString &namespaceUri, const QString &name);
54    bool hasAttributes() const;
55    QStringList attributeNames(const QString &namespaceUri = QString()) const;
56    QStringList classes() const;
57    bool hasClass(const QString &name) const;
58    void addClass(const QString &name);
59    void removeClass(const QString &name);
60    void toggleClass(const QString &name);
61    bool hasFocus() const;
62    void setFocus();
63    QRect geometry() const;
64    QString tagName() const;
65    QString prefix() const;
66    QString localName() const;
67    QString namespaceUri() const;
68    QWebElement parent() const;
69    QWebElement firstChild() const;
70    QWebElement lastChild() const;
71    QWebElement nextSibling() const;
72    QWebElement previousSibling() const;
73    QWebElement document() const;
74    QWebFrame *webFrame() const;
75    void appendInside(const QString &markup);
76    void appendInside(const QWebElement &element);
77    void prependInside(const QString &markup);
78    void prependInside(const QWebElement &element);
79    void appendOutside(const QString &markup);
80    void appendOutside(const QWebElement &element);
81    void prependOutside(const QString &markup);
82    void prependOutside(const QWebElement &element);
83    void encloseContentsWith(const QWebElement &element);
84    void encloseContentsWith(const QString &markup);
85    void encloseWith(const QString &markup);
86    void encloseWith(const QWebElement &element);
87    void replace(const QString &markup);
88    void replace(const QWebElement &element);
89    QWebElement clone() const;
90    QWebElement &takeFromDocument();
91    void removeFromDocument();
92    void removeAllChildren();
93    QVariant evaluateJavaScript(const QString &scriptSource);
94
95    enum StyleResolveStrategy
96    {
97        InlineStyle,
98        CascadedStyle,
99        ComputedStyle,
100    };
101
102    QString styleProperty(const QString &name, QWebElement::StyleResolveStrategy strategy) const;
103    void setStyleProperty(const QString &name, const QString &value);
104    void render(QPainter *painter);
105    void render(QPainter *painter, const QRect &clip);
106};
107
108class QWebElementCollection
109{
110%TypeHeaderCode
111#include <qwebelement.h>
112%End
113
114public:
115    QWebElementCollection();
116    QWebElementCollection(const QWebElement &contextElement, const QString &query);
117    QWebElementCollection(const QWebElementCollection &);
118    ~QWebElementCollection();
119    QWebElementCollection operator+(const QWebElementCollection &other) const;
120    QWebElementCollection &operator+=(const QWebElementCollection &other);
121    void append(const QWebElementCollection &collection);
122    int count() const /__len__/;
123    QWebElement at(int i) const;
124    QWebElement operator[](int i) const;
125%MethodCode
126        Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
127
128        if (idx < 0)
129            sipIsErr = 1;
130        else
131            sipRes = new QWebElement(sipCpp->operator[]((int)idx));
132%End
133
134    QWebElement first() const;
135    QWebElement last() const;
136    QList<QWebElement> toList() const;
137};
138