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
|
|
|
// ISimpleGameListView.h
|
2020-05-24 08:29:29 +00:00
|
|
|
//
|
2020-09-15 20:57:54 +00:00
|
|
|
// Interface that defines a simple gamelist view.
|
2020-05-24 08:29:29 +00:00
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_APP_VIEWS_GAME_LIST_ISIMPLE_GAME_LIST_VIEW_H
|
|
|
|
#define ES_APP_VIEWS_GAME_LIST_ISIMPLE_GAME_LIST_VIEW_H
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-09-21 16:13:27 +00:00
|
|
|
#include "views/gamelist/IGameListView.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "components/ImageComponent.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "components/TextComponent.h"
|
2020-09-15 20:57:54 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include <stack>
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
class ISimpleGameListView : public IGameListView
|
|
|
|
{
|
|
|
|
public:
|
2020-06-21 12:25:28 +00:00
|
|
|
ISimpleGameListView(Window* window, FileData* root);
|
2020-08-08 20:29:32 +00:00
|
|
|
virtual ~ISimpleGameListView();
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-10-27 18:07:35 +00:00
|
|
|
// Called when a FileData* is added, has its metadata changed, or is removed.
|
|
|
|
virtual void onFileChanged(FileData* file, bool reloadGameList) override;
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Called whenever the theme changes.
|
2020-06-25 17:52:38 +00:00
|
|
|
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-25 17:52:38 +00:00
|
|
|
virtual FileData* getCursor() override = 0;
|
|
|
|
virtual void setCursor(FileData*) override = 0;
|
2021-02-04 19:14:20 +00:00
|
|
|
virtual void addPlaceholder(FileData*) override = 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;
|
2020-06-25 17:52:38 +00:00
|
|
|
virtual void launch(FileData* game) override = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-10-30 17:34:05 +00:00
|
|
|
virtual const std::vector<std::string>& getFirstLetterIndex() override = 0;
|
|
|
|
|
2020-12-20 11:07:02 +00:00
|
|
|
// These functions are used to retain the folder cursor history, for instance
|
|
|
|
// during a view reload. The calling function stores the history temporarily.
|
|
|
|
void copyCursorHistory(std::vector<FileData*>& cursorHistory) override
|
|
|
|
{ cursorHistory = mCursorStackHistory; };
|
|
|
|
void populateCursorHistory(std::vector<FileData*>& cursorHistory) override
|
|
|
|
{ mCursorStackHistory = cursorHistory; };
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
protected:
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual std::string getQuickSystemSelectRightButton() = 0;
|
|
|
|
virtual std::string getQuickSystemSelectLeftButton() = 0;
|
2020-11-09 22:41:27 +00:00
|
|
|
virtual void populateList(const std::vector<FileData*>& files, FileData* firstEntry) = 0;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-11-09 22:41:27 +00:00
|
|
|
void generateGamelistInfo(FileData* cursor, FileData* firstEntry);
|
2020-10-30 17:34:05 +00:00
|
|
|
void generateFirstLetterIndex(const std::vector<FileData*>& files);
|
2020-10-30 13:19:21 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
TextComponent mHeaderText;
|
|
|
|
ImageComponent mHeaderImage;
|
|
|
|
ImageComponent mBackground;
|
2017-04-22 14:15:16 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
std::vector<GuiComponent*> mThemeExtras;
|
|
|
|
std::stack<FileData*> mCursorStack;
|
2020-12-20 11:07:02 +00:00
|
|
|
std::vector<FileData*> mCursorStackHistory;
|
2021-01-02 14:21:48 +00:00
|
|
|
// This game is randomly selected in the grouped custom collections view.
|
|
|
|
FileData* mRandomGame;
|
2020-10-30 13:19:21 +00:00
|
|
|
|
2020-10-30 17:34:05 +00:00
|
|
|
std::vector<std::string> mFirstLetterIndex;
|
|
|
|
|
2020-10-30 13:19:21 +00:00
|
|
|
unsigned int mGameCount;
|
|
|
|
unsigned int mFavoritesGameCount;
|
|
|
|
unsigned int mFilteredGameCount;
|
2020-11-08 18:04:43 +00:00
|
|
|
unsigned int mFilteredGameCountAll;
|
2020-10-30 13:19:21 +00:00
|
|
|
bool mIsFiltered;
|
|
|
|
bool mIsFolder;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_VIEWS_GAME_LIST_ISIMPLE_GAME_LIST_VIEW_H
|