class EE::UI::UIWidgetCreator

#include <uiwidgetcreator.hpp>

class UIWidgetCreator {
public:
    // typedefs

    typedef std::function<UIWidget*(const std::string&)> CustomWidgetCb;
    typedef std::function<UIWidget*()> RegisterWidgetCb;
    typedef std::unordered_map<std::string, UIWidgetCreator::CustomWidgetCb> WidgetCallbackMap;
    typedef std::unordered_map<std::string, UIWidgetCreator::RegisterWidgetCb> RegisteredWidgetCallbackMap;

    // methods

    static UIWidget* createFromName(const std::string& widgetName);
    static void addCustomWidgetCallback(const std::string& widgetName, const CustomWidgetCb& cb);
    static void removeCustomWidgetCallback(const std::string& widgetName);
    static bool existsCustomWidgetCallback(const std::string& widgetName);
    static void registerWidget(const std::string& widgetName, const RegisterWidgetCb& cb);
    static void unregisterWidget(const std::string& widgetName);
    static bool isWidgetRegistered(const std::string& widgetName);
    static const RegisteredWidgetCallbackMap& getRegisteredWidgets();
    static std::vector<std::string> getWidgetNames();
};