src/platform/qt/ShortcutView.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#pragma once
7
8#include "GamepadAxisEvent.h"
9
10#include <QWidget>
11
12#include "ui_ShortcutView.h"
13
14namespace QGBA {
15
16class InputController;
17class ShortcutController;
18class ShortcutModel;
19
20class ShortcutView : public QWidget {
21Q_OBJECT
22
23public:
24 ShortcutView(QWidget* parent = nullptr);
25 ~ShortcutView();
26
27 void setController(ShortcutController* controller);
28 void setInputController(InputController* input);
29
30protected:
31 virtual bool event(QEvent*) override;
32 virtual void closeEvent(QCloseEvent*) override;
33
34private slots:
35 void load(const QModelIndex&);
36 void clear();
37 void updateButton(int button);
38 void updateAxis(int axis, int direction);
39
40private:
41 Ui::ShortcutView m_ui;
42
43 ShortcutController* m_controller = nullptr;
44 ShortcutModel* m_model = nullptr;
45 InputController* m_input = nullptr;
46};
47
48}