aboutsummaryrefslogtreecommitdiff
path: root/src/InputMediator.hpp
blob: 7194ff937338582feee2554f7482285903780768 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
};