2011-02-26 03:57:55 +00:00
|
|
|
#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;
|
2011-02-26 03:57:55 +00:00
|
|
|
|
|
|
|
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)
|
2011-02-26 03:57:55 +00:00
|
|
|
|
|
|
|
public:
|
2012-12-11 03:53:03 +00:00
|
|
|
JavascriptInvocation(const QString &functionName, const QStringList &arguments, WebPage *page, QObject *parent = 0);
|
2011-02-26 03:57:55 +00:00
|
|
|
QString &functionName();
|
|
|
|
QStringList &arguments();
|
2013-01-13 14:13:57 +00:00
|
|
|
Q_INVOKABLE bool click(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 *);
|
2011-02-26 03:57:55 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_functionName;
|
|
|
|
QStringList m_arguments;
|
2012-12-11 03:53:03 +00:00
|
|
|
WebPage *m_page;
|
2013-01-12 23:02:10 +00:00
|
|
|
void execClick(QPoint mousePos);
|
2013-02-02 22:32:54 +00:00
|
|
|
QVariant m_error;
|
2011-02-26 03:57:55 +00:00
|
|
|
};
|
|
|
|
|