//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      GUI/View/Canvas/SpecularDataCanvas.h
//! @brief     Defines class SpecularDataCanvas.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H
#define BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H

#include <QWidget>

class Data1DItem;
class SpecularPlotCanvas;

class SpecularDataCanvas : public QWidget {
public:
    SpecularDataCanvas();

    void setDataItem();

    QSize sizeHint() const override;
    QSize minimumSizeHint() const override;

    //! Enable or disable the onMousePress() handler.
    //! For legacy reasons the onMousePress handler is enabled.
    //! It is deprecated because of:
    //! * mousepress is the wrong event to listen to for opening a context menu
    //! * disables possibility to get context menu events for specific parts of the plot (e.g.
    //! context menu for axis configuration)
    void enableDeprecatedOnMousePress(bool b);

public slots:
    void onSavePlotAction();
    void onMousePress(QMouseEvent* event);

private:
    Data1DItem* dataItem();
    SpecularPlotCanvas* m_plot_canvas;
};

#endif // BORNAGAIN_GUI_VIEW_CANVAS_SPECULARDATACANVAS_H
