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#include "InputIndex.h"
10#include "InputModel.h"
11
12#include <QWidget>
13
14#include "ui_ShortcutView.h"
15
16namespace QGBA {
17
18class InputController;
19class ShortcutController;
20class ShortcutModel;
21
22class ShortcutView : public QWidget {
23Q_OBJECT
24
25public:
26 ShortcutView(QWidget* parent = nullptr);
27 ~ShortcutView();
28
29 void setController(ShortcutController* controller);
30 void setInputController(InputController* input);
31
32protected:
33 virtual bool event(QEvent*) override;
34 virtual void closeEvent(QCloseEvent*) override;
35
36private slots:
37 void load(const QModelIndex&);
38 void clear();
39 void updateButton(int button);
40 void updateAxis(int axis, int direction);
41
42private:
43 Ui::ShortcutView m_ui;
44
45 ShortcutController* m_controller = nullptr;
46 ShortcutModel* m_model = nullptr;
47 InputController* m_input = nullptr;
48};
49
50}