capybara-webkit/src/JavascriptInvocation.h

33 lines
984 B
C
Raw Normal View History

#include <QObject>
#include <QString>
#include <QStringList>
2012-12-11 03:53:03 +00:00
#include <QWebElement>
class WebPage;
2013-01-20 23:57:04 +00:00
class InvocationResult;
class JavascriptInvocation : public QObject {
Q_OBJECT
Q_PROPERTY(QString functionName READ functionName)
Q_PROPERTY(QStringList arguments READ arguments)
2013-02-02 22:32:54 +00:00
Q_PROPERTY(QVariant error READ getError WRITE setError)
public:
2012-12-11 03:53:03 +00:00
JavascriptInvocation(const QString &functionName, const QStringList &arguments, WebPage *page, QObject *parent = 0);
QString &functionName();
QStringList &arguments();
Q_INVOKABLE void click(int x, int y);
Q_INVOKABLE bool clickTest(QWebElement element, int absoluteX, int absoluteY);
Q_INVOKABLE QVariantMap clickPosition(QWebElement element, int left, int top, int width, int height);
2013-02-02 22:32:54 +00:00
QVariant getError();
void setError(QVariant error);
2013-01-20 23:57:04 +00:00
InvocationResult invoke(QWebFrame *);
private:
QString m_functionName;
QStringList m_arguments;
2012-12-11 03:53:03 +00:00
WebPage *m_page;
2013-02-02 22:32:54 +00:00
QVariant m_error;
};