ES-DE/src/components/GuiMetaDataEd.h
Aloshi 3a3471cfe8 Combined FolderData and GameData into one class, FileData.
You don't need to dynamic_cast everywhere to check things anymore.
Folders can have metadata now (currently not set up).
Metadata is now a public member variable instead of a function that
returns a pointer to make actually using const possible.
2013-11-05 19:41:49 -06:00

48 lines
1.1 KiB
C++

#pragma once
#include "../GuiComponent.h"
#include "ComponentListComponent.h"
#include "../MetaData.h"
#include "TextComponent.h"
#include "NinePatchComponent.h"
#include "ButtonComponent.h"
#include <functional>
#include "../scrapers/Scraper.h"
class GuiMetaDataEd : public GuiComponent
{
public:
GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector<MetaDataDecl>& mdd, ScraperSearchParams params,
const std::string& header, std::function<void()> savedCallback, std::function<void()> deleteFunc);
virtual ~GuiMetaDataEd();
bool input(InputConfig* config, Input input) override;
private:
void save();
void fetch();
void fetchDone(MetaDataList result);
void populateList(const std::vector<MetaDataDecl>& mdd);
ScraperSearchParams mScraperParams;
NinePatchComponent mBox;
ComponentListComponent mList;
TextComponent mHeader;
std::vector<TextComponent*> mLabels;
std::vector<GuiComponent*> mEditors;
std::vector<MetaDataDecl> mMetaDataDecl;
MetaDataList* mMetaData;
std::function<void()> mSavedCallback;
std::function<void()> mDeleteFunc;
ButtonComponent mDeleteButton;
ButtonComponent mFetchButton;
ButtonComponent mSaveButton;
};