aboutsummaryrefslogtreecommitdiff
path: root/src/InputMediator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/InputMediator.hpp')
-rw-r--r--src/InputMediator.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/InputMediator.hpp b/src/InputMediator.hpp
new file mode 100644
index 0000000..7194ff9
--- /dev/null
+++ b/src/InputMediator.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <QWidget>
+#include <QtCore>
+
+#include "LuaRuntime.hpp"
+#include "keymap/KeymapEvaluator.hpp"
+#include "utils.hpp"
+#include "widgets/WebViewStack.hpp"
+
+class InputMediator : public QObject {
+ Q_OBJECT
+
+public:
+ InputMediator(WebViewStack *webViewStack, LuaRuntime *luaRuntime,
+ KeymapEvaluator *keymapEvaluator);
+ ~InputMediator();
+
+ DELEGATE(webViewStack, openUrl, openUrl)
+ DELEGATE(webViewStack, currentUrl, currentUrl)
+ DELEGATE(webViewStack, next, nextWebView)
+ DELEGATE(webViewStack, previous, previousWebView)
+ DELEGATE(webViewStack, closeCurrent, closeCurrentWebView)
+ DELEGATE(keymapEvaluator, evaluate, evaluateKeymap)
+
+private:
+ void evaluateCommand(QString command);
+
+private:
+ WebViewStack *webViewStack;
+ LuaRuntime *luaRuntime;
+ KeymapEvaluator *keymapEvaluator;
+};