all repos — mgba @ 53c586044d76775bb0226a6c92ca61f0c1844467

mGBA Game Boy Advance Emulator

src/platform/qt/LoadSaveState.h (view raw)

 1/* Copyright (c) 2013-2014 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#ifndef QGBA_LOAD_SAVE_STATE
 7#define QGBA_LOAD_SAVE_STATE
 8
 9#include <QWidget>
10
11#include "ui_LoadSaveState.h"
12
13namespace QGBA {
14
15class GameController;
16class SavestateButton;
17
18enum class LoadSave {
19	LOAD,
20	SAVE
21};
22
23class LoadSaveState : public QWidget {
24Q_OBJECT
25
26public:
27	const static int NUM_SLOTS = 9;
28
29	LoadSaveState(GameController* controller, QWidget* parent = nullptr);
30
31	void setMode(LoadSave mode);
32
33signals:
34	void closed();
35
36protected:
37	virtual bool eventFilter(QObject*, QEvent*) override;
38	virtual void closeEvent(QCloseEvent*) override;
39	virtual void showEvent(QShowEvent*) override;
40	virtual void paintEvent(QPaintEvent*) override;
41
42private:
43	void loadState(int slot);
44	void triggerState(int slot);
45
46	Ui::LoadSaveState m_ui;
47	GameController* m_controller;
48	SavestateButton* m_slots[NUM_SLOTS];
49	LoadSave m_mode;
50
51	int m_currentFocus;
52	QPixmap m_currentImage;
53};
54
55}
56
57#endif