dolphin/Source/Core/DolphinQt/Config/Mapping/MappingWidget.h

72 lines
1.4 KiB
C
Raw Normal View History

2017-05-20 15:53:17 +00:00
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <vector>
#include <QString>
#include <QWidget>
class ControlGroupBox;
class InputConfig;
class IOWindow;
2017-05-20 15:53:17 +00:00
class MappingBool;
class MappingButton;
class MappingNumeric;
class MappingWindow;
class MappingRadio;
2017-05-20 15:53:17 +00:00
class QGroupBox;
namespace ControllerEmu
{
class Control;
class ControlGroup;
class EmulatedController;
} // namespace ControllerEmu
2017-05-20 15:53:17 +00:00
namespace ciface
{
namespace Core
{
class Device;
}
} // namespace ciface
2017-05-20 15:53:17 +00:00
class MappingWidget : public QWidget
{
Q_OBJECT
public:
explicit MappingWidget(MappingWindow* window);
ControllerEmu::EmulatedController* GetController() const;
2017-05-20 15:53:17 +00:00
std::shared_ptr<ciface::Core::Device> GetDevice() const;
MappingWindow* GetParent() const;
2018-04-01 14:25:34 +00:00
bool IsIterativeInput() const;
void NextButton(MappingButton* button);
2017-05-20 15:53:17 +00:00
virtual void LoadSettings() = 0;
virtual void SaveSettings() = 0;
virtual InputConfig* GetConfig() = 0;
void Update();
protected:
int GetPort() const;
QGroupBox* CreateGroupBox(const QString& name, ControllerEmu::ControlGroup* group);
private:
void OnClearFields();
MappingWindow* m_parent;
bool m_first = true;
std::vector<MappingBool*> m_bools;
std::vector<MappingRadio*> m_radio;
2017-05-20 15:53:17 +00:00
std::vector<MappingButton*> m_buttons;
std::vector<MappingNumeric*> m_numerics;
};