#ifndef PLOTWINDOW_H
#define PLOTWINDOW_H

#include <gtkmm/box.h>
#include <gtkmm/liststore.h>
#include <gtkmm/treeview.h>
#include <gtkmm/window.h>

#include "../plot/plotwidget.h"

class PlotWindow : public Gtk::Window {
 public:
  explicit PlotWindow(class PlotManager& plotManager);

  ~PlotWindow();

 private:
  class PlotListColumns : public Gtk::TreeModel::ColumnRecord {
   public:
    PlotListColumns() {
      add(_index);
      add(_name);
    }

    Gtk::TreeModelColumn<unsigned int> _index;
    Gtk::TreeModelColumn<Glib::ustring> _name;
  } _plotListColumns;

  void onSelectedPlotChange();
  void onClearPlotsPressed();
  void onEditPlottingPropertiesPressed();
  void onPlotPropertiesChanged();

  void handleUpdate();

  void updatePlotList();

  PlotWidget _plotWidget;
  class PlotManager& _plotManager;
  Gtk::Box _hBox;
  Gtk::Box _sideBox{Gtk::Orientation::VERTICAL};
  Gtk::Box _toolbar;
  Gtk::Button _clearButton, _editButton;
  Glib::RefPtr<Gtk::ListStore> _plotListStore;
  Gtk::TreeView _plotListView;
  class PlotPropertiesWindow* _plotPropertiesWindow;
};

#endif
