#ifndef PORTAL_HPP_
#define PORTAL_HPP_

#include <Widget/Widget.hpp>

/**
 * @brief A widget which displays, but does not own, another widget, which can be dynamically changed.
 */
class Portal final : public Widget
{
public:
    using GetWidgetCallback = std::function<Widget*()>;

private:
    GetWidgetCallback getCurrentWidget;

public:
    Portal(GetWidgetCallback getCurrentWidget);

    virtual void draw(GraphicsContext &context) override;
    virtual glm::ivec2 getMinSize() override;
    virtual void onResize(glm::ivec2 newSize) override;
    virtual void onMouseMoved(glm::ivec2 pos) override;
    virtual void onMouseDown(Uint8 button) override;
    virtual void onMouseUp(Uint8 button) override;
    virtual void onScroll(int delta) override;
    virtual void getInternalTabOrder(std::vector<Widget*> &tabOrder) override;
};

#endif