#ifndef FORMIMAGESELECT_H
#define FORMIMAGESELECT_H

#include <QWidget>

#include <QImage>

#include "common.h"

namespace Ui {
class FormImageSelect;
}


class FormImageSelect : public QWidget
{
    Q_OBJECT

public:
    explicit FormImageSelect(QWidget *parent = nullptr);
    virtual ~FormImageSelect();

    virtual void paintEvent(QPaintEvent *event);
    virtual void resizeEvent(QResizeEvent *event);

    void SetImageSelect(ImageSelect* pImageSelect);

    void UpdateImageSelect(bool bForce=false);

    void SetIndexViewer(int nIndex);

    void DisplayCheck();

    bool IsSelect();

    void Init();

    void DisplayRotate();

    void DisplayFlipHorizontal();
    void DisplayFlipVertical();

    void EnableZoom(bool bEnable);
    bool IsEnableZoom();

    void EnableMove(bool bEnable);
    bool IsEnableMove();


    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);
    virtual void mouseDoubleClickEvent(QMouseEvent *event);
    virtual void mouseMoveEvent(QMouseEvent *event);


protected:
    ImageSelect* m_pImageSelect;
    QImage* m_pImage;
    int m_nIndexViewer;

    bool m_bUseZoom;
    bool m_bUseMove;
    QPoint m_PointClicked;
    QPoint m_PointCurrent;

    QRect m_rectDisplay;
    QRect m_rectDisplayImage;

public slots:
    void ClickSelect();

private slots:


    void on_pushButton_Select_clicked();

private:
    Ui::FormImageSelect *ui;
};

#endif // FORMIMAGESELECT_H
