summaryrefslogtreecommitdiff
path: root/browser/browserpage.h
diff options
context:
space:
mode:
Diffstat (limited to 'browser/browserpage.h')
-rw-r--r--browser/browserpage.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/browser/browserpage.h b/browser/browserpage.h
new file mode 100644
index 0000000..9922b72
--- /dev/null
+++ b/browser/browserpage.h
@@ -0,0 +1,46 @@
+/**
+ * Copyright (C) 2014, Pelagicore
+ *
+ * Author: Jonatan PĂ„lsson <jonatan.palsson@pelagicore.com>
+ *
+ * This file is part of the GENIVI project Browser Proof-Of-Concept
+ * For further information, see http://genivi.org/
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef BROWSERPAGE_H
+#define BROWSERPAGE_H
+
+#include <QWebPage>
+#include <QObject>
+
+#include "userinput.h"
+
+class BrowserPage : public QWebPage {
+Q_OBJECT
+
+public:
+ BrowserPage(QObject *parent, userinput *input)
+ : QWebPage (parent), m_userInput (input){}
+ ~BrowserPage(){}
+
+protected:
+ void javaScriptAlert(QWebFrame *frame, const QString &message);
+ bool javaScriptConfirm(QWebFrame *frame, const QString &message);
+ bool javaScriptPrompt (QWebFrame *, const QString &, const QString &, QString *);
+
+protected slots:
+ void confirm(bool b) {m_confirm = b;}
+ void prompt (QString s, bool b) {m_promptBool = b; m_promptStr = s;}
+
+private:
+ userinput *m_userInput;
+ bool m_confirm;
+ bool m_promptBool;
+ QString m_promptStr;
+};
+
+#endif /* BROWSERPAGE_H */