2014-06-25 16:29:58 +00:00
|
|
|
#pragma once
|
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
|
|
|
|
|
|
|
#include "FileData.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "GuiComponent.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "Renderer.h"
|
|
|
|
|
|
|
|
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:
|
|
|
|
IGameListView(Window* window, FileData* root) : GuiComponent(window), mRoot(root)
|
|
|
|
{ setSize((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight()); }
|
|
|
|
|
|
|
|
virtual ~IGameListView() {}
|
|
|
|
|
|
|
|
// Called when a new file is added, a file is removed, a file's metadata changes, or a file's children are sorted.
|
|
|
|
// NOTE: FILE_SORTED is only reported for the topmost FileData, where the sort started.
|
|
|
|
// Since sorts are recursive, that FileData's children probably changed too.
|
|
|
|
virtual void onFileChanged(FileData* file, FileChangeType change) = 0;
|
|
|
|
|
|
|
|
// Called whenever the theme changes.
|
|
|
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) = 0;
|
|
|
|
|
|
|
|
void setTheme(const std::shared_ptr<ThemeData>& theme);
|
|
|
|
inline const std::shared_ptr<ThemeData>& getTheme() const { return mTheme; }
|
|
|
|
|
|
|
|
virtual FileData* getCursor() = 0;
|
|
|
|
virtual void setCursor(FileData*) = 0;
|
|
|
|
|
|
|
|
virtual bool input(InputConfig* config, Input input) override;
|
2017-06-12 16:38:59 +00:00
|
|
|
virtual void remove(FileData* game, bool deleteFile) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
virtual const char* getName() const = 0;
|
2017-06-01 20:08:44 +00:00
|
|
|
virtual void launch(FileData* game) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
virtual HelpStyle getHelpStyle() override;
|
2017-05-31 02:41:41 +00:00
|
|
|
|
2017-10-28 20:24:35 +00:00
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2014-06-25 16:29:58 +00:00
|
|
|
protected:
|
|
|
|
FileData* mRoot;
|
|
|
|
std::shared_ptr<ThemeData> mTheme;
|
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H
|