#pragma once

#include <sdi_toolBox/desktop/eventBus/defs.h>
#include <sdi_toolBox/desktop/eventBus/message.h>
#include <wx/wx.h>

//--------------------------------------------------------------
class wxBusEvent : public wxCommandEvent
{
  using MessageTypeID = sdi_toolBox::desktop::eventBus::MessageTypeID;
  using message_t     = std::shared_ptr<sdi_toolBox::desktop::eventBus::Message>;

  public:
  wxBusEvent()                                       = delete;      // Default constructor
  virtual ~wxBusEvent()                              = default;     // Default destructor
  wxBusEvent(const wxBusEvent &other)                = default;     // Copy constructor
  wxBusEvent(wxBusEvent &&other) noexcept            = default;     // Move constructor
  wxBusEvent &operator=(const wxBusEvent &other)     = delete;      // Copy assignment
  wxBusEvent &operator=(wxBusEvent &&other) noexcept = delete;      // Move assignment

  explicit wxBusEvent(message_t message, int id = wxID_ANY);     // Constructor

  [[nodiscard]] wxEvent *Clone() const override;     // Clone method for wxWidgets event system

  // Data management
  [[nodiscard]] MessageTypeID getMessageTypeID() const;     // Get the message type ID
  [[nodiscard]] message_t     getMessage() const;           // Get the message data

  protected:
  message_t m_message;
};
//--------------------------------------------------------------
wxDECLARE_EVENT(wx_BUSEVENT_MESSAGE, wxBusEvent);
