#pragma once
#include "Plottable.h"
#include "../axis/Axis.h"
namespace renderive {
struct Selection_Rectangle_Overlay_Properties {
    Font label_font;
    Pen label_pen{Color::white()};
    Brush selection_brush{Color{0, 0, 255, 50}, Brush_Style::Solid};
    Pen selection_border_pen{Color::white(), 1.0, Line_Style::Dash};
};
namespace detail {
class LIB_DECL Selection_Rectangle_Overlay_Control : public Plottable_State<Selection_Rectangle_Overlay_Properties>, public Paint_Overlay, public Event_Handler {
public:
    Selection_Rectangle_Overlay_Control(const Selection_Rectangle_Overlay_Properties& properties, renderive_Owner<Abs_Axis> horizontal_axis, renderive_Owner<Abs_Axis> vertical_axis);
    ~Selection_Rectangle_Overlay_Control() override;
    [[nodiscard]] std::vector<RectF> selected_regions() const;
    void clear_selected_regions();
    void handle_event(const Event& event) override;
protected:
    void prepare_frame(const Prepare_Render_Context& context) override;
    void paint(Painter& painter, const Paint_Render_Context& context) override;
private:
    struct Impl;
    void publish() override;
};
}
using Selection_Rectangle_Overlay = detail::Attach_Plottable<detail::Selection_Rectangle_Overlay_Control, Selection_Rectangle_Overlay_Properties>;
}
