#pragma once

#include "app_core/brush_ui.h"
#include "node_panel_brush.h"

namespace pp::panopainter {

void register_legacy_brush_preset_panel(NodePanelBrushPreset& panel);
void unregister_legacy_brush_preset_panel(NodePanelBrushPreset& panel);
const std::vector<NodePanelBrushPreset*>& legacy_brush_preset_panels();

class LegacyBrushPresetListServices final : public pp::app::BrushPresetListServices {
public:
    explicit LegacyBrushPresetListServices(NodePanelBrushPreset& owner);

    pp::foundation::Status add_current_brush_preset(int target_index) override;
    void remove_brush_preset(
        int current_index,
        int target_index,
        bool selects_target,
        bool clears_selection) override;
    void move_brush_preset(int from_index, int to_index) override;
    void select_brush_preset(int index, bool notify_brush_changed) override;
    void clear_brush_presets(bool clears_selection) override;
    void update_preset_empty_notification() override;
    void save_preset_list() override;

private:
    NodePanelBrushPreset& owner_;
};

} // namespace pp::panopainter
