all repos — mgba @ 60577e83948647d36a2e6a8b4ec8f8556df3f72f

mGBA Game Boy Advance Emulator

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;
18
19class ShortcutView : public QWidget {
20Q_OBJECT
21
22public:
23	ShortcutView(QWidget* parent = nullptr);
24	~ShortcutView();
25
26	void setController(ShortcutController* controller);
27	void setInputController(InputController* input);
28
29protected:
30	virtual bool event(QEvent*) override;
31	virtual void closeEvent(QCloseEvent*) override;
32
33private slots:
34	void load(const QModelIndex&);
35	void clear();
36	void updateButton(int button);
37	void updateAxis(int axis, int direction);
38
39private:
40	Ui::ShortcutView m_ui;
41
42	ShortcutController* m_controller = nullptr;
43	InputController* m_input = nullptr;
44};
45
46}