2020-09-15 20:57:54 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-05-24 08:29:29 +00:00
|
|
|
//
|
2020-09-15 20:57:54 +00:00
|
|
|
// EmulationStation Desktop Edition
|
2020-06-21 12:25:28 +00:00
|
|
|
// IGameListView.h
|
2020-05-24 08:29:29 +00:00
|
|
|
//
|
2020-06-21 12:25:28 +00:00
|
|
|
// Interface that defines the minimum for a GameListView.
|
2020-05-24 08:29:29 +00:00
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H
|
|
|
|
#define ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2019-08-08 20:16:11 +00:00
|
|
|
#include "renderers/Renderer.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "FileData.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "GuiComponent.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
class ThemeData;
|
2017-11-01 22:21:10 +00:00
|
|
|
class Window;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
// This is an interface that defines the minimum for a GameListView.
|
|
|
|
class IGameListView : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2020-06-21 12:25:28 +00:00
|
|
|
IGameListView(
|
|
|
|
Window* window,
|
|
|
|
FileData* root)
|
|
|
|
: GuiComponent(window),
|
|
|
|
mRoot(root)
|
2020-09-15 20:57:54 +00:00
|
|
|
{ setSize(static_cast<float>(Renderer::getScreenWidth()),
|
|
|
|
static_cast<float>(Renderer::getScreenHeight())); }
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual ~IGameListView() {}
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Called when a new file is added, a file is removed, a file's metadata changes,
|
|
|
|
// or a file's children are sorted.
|
2020-09-15 20:57:54 +00:00
|
|
|
// Note: FILE_SORTED is only reported for the topmost FileData, where the sort started.
|
|
|
|
// Since sorts are recursive, FileData's children probably changed too.
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual void onFileChanged(FileData* file, FileChangeType change) = 0;
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Called whenever the theme changes.
|
|
|
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
void setTheme(const std::shared_ptr<ThemeData>& theme);
|
|
|
|
inline const std::shared_ptr<ThemeData>& getTheme() const { return mTheme; }
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual FileData* getCursor() = 0;
|
|
|
|
virtual void setCursor(FileData*) = 0;
|
2020-09-20 08:05:03 +00:00
|
|
|
virtual FileData* getNextEntry() = 0;
|
|
|
|
virtual FileData* getPreviousEntry() = 0;
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual FileData* getFirstEntry() = 0;
|
|
|
|
virtual FileData* getLastEntry() = 0;
|
2020-09-20 08:05:03 +00:00
|
|
|
virtual FileData* getFirstGameEntry() = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual bool input(InputConfig* config, Input input) override;
|
|
|
|
virtual void remove(FileData* game, bool deleteFile) = 0;
|
2020-07-30 18:05:57 +00:00
|
|
|
virtual void removeMedia(FileData* game) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual const char* getName() const = 0;
|
|
|
|
virtual void launch(FileData* game) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual HelpStyle getHelpStyle() override;
|
2017-05-31 02:41:41 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2020-07-13 18:58:25 +00:00
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
protected:
|
2020-06-21 12:25:28 +00:00
|
|
|
FileData* mRoot;
|
|
|
|
std::shared_ptr<ThemeData> mTheme;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H
|