#ifndef FORMVIEWER_H
#define FORMVIEWER_H

#include <QWidget>

#include <vector>
using namespace std;

#include "common.h"

#include "formimageselect.h"

#include "sslidebar.h"

#include "dialogprogress.h"


namespace Ui {
class FormViewer;
}

class FormViewer : public QWidget
{
    Q_OBJECT

public:


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

    void ChangeViewMode(int nMode);

    virtual void Init();
    virtual void UpdateViewer();

    virtual void wheelEvent(QWheelEvent *event);

    void SetTotalImageCount(int nCount);

    void UpdateMakeDICOMInfo(int nCount, int nTotalCount);
    void UpdateSendInfo(int nCount, int nTotalCount);
    void UpdateSendComplete();
    void UpdateSendFailed();

    bool m_bExecMenu;

public:
    virtual void resizeEvent(QResizeEvent *event);

protected:
    DialogProgress* m_pDialogSendProgress;

    int m_nMode;
    vector<FormImageSelect*> m_ListFormImageSelect;
    vector<ImageSelect*> m_ListImageSelect;
    int m_nMaxItemShow;
    SSlideBar* m_pSlideBarVertical;
    int m_nCurrentPos;
    int m_nIndexCurrent;
    int m_nTotalImageCount;

    int m_nPageTotal;
    int m_nPageCurrent;

signals:
    void ExitViewer();
    void ChangeMenu(int nID);

    void BackupNetworkShareFolder(QString strFilename);

public slots:
    void SingleUp();
    void SingleDown();

    void valueChangedScrollBarVertical(int value);

    void actionTriggered(int action);

    void SetImageLoadInfo(int nLoad, int nTotal, ImageSelect* pImageSelect);

    void ImageLoadComplete();


private slots:
    void on_comboBox_ViewerMode_currentIndexChanged(int index);

    void on_pushButton_EXIT_clicked();

    void on_pushButton_SEND_clicked();

    void on_pushButton_Rotate_clicked();

    void on_pushButton_ZoomInOut_clicked();

    void on_pushButton_FlipHorizontal_clicked();

    void on_pushButton_FlipVertical_clicked();

    void on_pushButton_Move_clicked();

    void on_pushButton_DELETE_clicked();

    void on_pushButton_AddCapture_clicked();


private:
    Ui::FormViewer *ui;
};

#endif // FORMVIEWER_H
