diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-18 21:19:28 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-18 21:19:47 +0530 |
| commit | 4c762b2516bc664293c2aec072074f1e34dda8c3 (patch) | |
| tree | ebe441f7af8c1f4c49f04630538312d55f18f63b /include/InputMediator.hpp | |
| parent | 056b0b16947ac19a0c425aa9d2ff8f589378d3bc (diff) | |
| download | null-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.tar.gz null-browser-4c762b2516bc664293c2aec072074f1e34dda8c3.zip | |
Remove all the ui bits because screw it, lets unix a bit more
Diffstat (limited to 'include/InputMediator.hpp')
| -rw-r--r-- | include/InputMediator.hpp | 38 |
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 {}; |
