aboutsummaryrefslogtreecommitdiff
path: root/include/InputMediator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/InputMediator.hpp')
-rw-r--r--include/InputMediator.hpp38
1 files changed, 1 insertions, 37 deletions
diff --git a/include/InputMediator.hpp b/include/InputMediator.hpp
index 6025536..4aaa6c1 100644
--- a/include/InputMediator.hpp
+++ b/include/InputMediator.hpp
@@ -5,60 +5,24 @@
#include "LuaRuntime.hpp"
#include "utils.hpp"
-#include "widgets/InputLine.hpp"
#include "widgets/WebViewStack.hpp"
-// TODO: Rethink evaluation
-class EvaluationType {
-public:
- EvaluationType() {}
- virtual ~EvaluationType() = default;
-};
-class NoopEval : public EvaluationType {};
-
class InputMediator : public QObject {
Q_OBJECT
public:
- InputMediator(InputLine *inputLine, WebViewStack *webViewStack,
- LuaRuntime *luaRuntime);
-
- void showURLInput(QString url = "", OpenType openType = OpenType::OpenUrl);
- void showCommandInput(QString command = "");
- void showTabsInput(QString command = "");
- void hideInputLine();
+ InputMediator(WebViewStack *webViewStack, LuaRuntime *luaRuntime);
DELEGATE(webViewStack, openUrl, openUrl)
DELEGATE(webViewStack, currentUrl, currentUrl)
DELEGATE(webViewStack, next, nextWebView)
DELEGATE(webViewStack, previous, previousWebView)
DELEGATE(webViewStack, closeCurrent, closeCurrentWebView)
- DELEGATE(inputLine, getInputText, getInputText)
private:
- void showInputLine();
void evaluateCommand(QString command);
- void setEvaluationType(EvaluationType *);
-
-private slots:
- void onInputSubmit(QString input);
private:
- InputLine *inputLine;
WebViewStack *webViewStack;
LuaRuntime *luaRuntime;
- EvaluationType *currentEvaluationType = new NoopEval();
-};
-
-class UrlEval : public EvaluationType {
-public:
- UrlEval(OpenType type) : EvaluationType(), openType(type) {}
- OpenType type() { return openType; }
-
-private:
- OpenType openType;
};
-
-class CommandEval : public EvaluationType {};
-
-class TabsEval : public EvaluationType {};