2020-09-21 17:17:34 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-06-23 18:07:00 +00:00
|
|
|
//
|
2020-09-21 17:17:34 +00:00
|
|
|
// EmulationStation Desktop Edition
|
2020-06-23 18:07:00 +00:00
|
|
|
// GuiSettings.h
|
|
|
|
//
|
|
|
|
// User interface template for a settings GUI.
|
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_APP_GUIS_GUI_SETTINGS_H
|
|
|
|
#define ES_APP_GUIS_GUI_SETTINGS_H
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "components/MenuComponent.h"
|
|
|
|
|
|
|
|
// This is just a really simple template for a GUI that calls some save functions when closed.
|
|
|
|
class GuiSettings : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2020-06-23 18:07:00 +00:00
|
|
|
GuiSettings(Window* window, const char* title);
|
|
|
|
virtual ~GuiSettings(); // Just calls save()
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-23 18:07:00 +00:00
|
|
|
void save();
|
|
|
|
inline void addRow(const ComponentListRow& row) { mMenu.addRow(row); };
|
|
|
|
inline void addWithLabel(const std::string& label,
|
|
|
|
const std::shared_ptr<GuiComponent>& comp) { mMenu.addWithLabel(label, comp); };
|
|
|
|
inline void addSaveFunc(const std::function<void()>& func) { mSaveFuncs.push_back(func); };
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-23 18:07:00 +00:00
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
HelpStyle getHelpStyle() override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-23 18:07:00 +00:00
|
|
|
MenuComponent mMenu;
|
|
|
|
std::vector< std::function<void()> > mSaveFuncs;
|
2017-10-31 17:12:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ES_APP_GUIS_GUI_SETTINGS_H
|