#pragma once

#include "wxNode.h"

#include <dBus/dBus.h>
#include <wx/notebook.h>
#include <wx/wx.h>

namespace gui
{
class MenuBar;
class StatusBar;
class ToolBar;
class RequirementsPanel;
//--------------------------------------------------------------
class MainFrame : public wxFrame
  , public dBus::wxNode
{
  public:
  MainFrame()                                    = delete;      // Default constructor
  virtual ~MainFrame()                           = default;     // Default destructor
  MainFrame(const MainFrame &obj)                      = delete;      // Copy constructor
  MainFrame(MainFrame &&obj) noexcept            = delete;      // Move constructor
  MainFrame &operator=(const MainFrame &obj)     = delete;      // Copy assignment operator
  MainFrame &operator=(MainFrame &&obj) noexcept = delete;      // Move assignment operator

  explicit MainFrame(dBus::Bus &bus);     // Constructor

  protected:
  // Controls
  MenuBar    *m_menuBar      = nullptr;     // Menu bar handle
  StatusBar  *m_statusBar    = nullptr;     // Status bar handle
  ToolBar    *m_toolBar      = nullptr;     // Toolbar handle
  wxNotebook *m_pageNotebook = nullptr;     // Main notebook handle

  RequirementsPanel *m_requirementsPanel = nullptr;     // Requirements panel handle

  private:
  void createControls();     // Creating controls

  void createProject();     // Create a new project
  void openProject();       // Open an existing project
  void saveProject();       // Save the current project
  void saveProjectAs();     // Save the current project as...
  void closeProject();      // Close the current project

  // Events
  public:
  void on_menuBarItemClick(wxCommandEvent &event);                                     // Menu bar item click event
  void on_receiveMessageFromBus(MessageID messageID, MessagePtr message) override;     // dBus message reception handler
};
//--------------------------------------------------------------
}     // namespace gui
