#ifndef DIALOGCALENDAR_H
#define DIALOGCALENDAR_H

#include <QDialog>

#include "scalendarmenuview.h"

#include <vector>
using namespace std;

namespace Ui {
class DialogCalendar;
}

enum _CALENDAR_CHANGE
{
    CHANGE_DATE_START,
    CHANGE_DATE_END
};

class DialogCalendar : public QDialog
{
    Q_OBJECT

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

    void SetCalendarDate(int nYear, int nMonth, int nDay);

    void showEvent(QShowEvent *) override;

    void SetModeChangeStart();
    void SetModeChangeEnd();

    void SetDateStart(QDate date);
    void SetDateEnd(QDate date);

    int GetTypeSearchDuration();

protected:
    void resizeEvent(QResizeEvent *) override;
    virtual void keyReleaseEvent(QKeyEvent *event);
    //virtual void paintEvent(QPaintEvent *event);

public slots:
    void ExecuteMenu(int nID);
    void ExecuteClickDate();

signals:
    void SetSearchDateUpdate(int nTypeSearchDuration);

protected:
    int m_nModeChange;
    int m_nTypeSearchDuration;
    vector<SCalendarMenuView*> m_ListMenu;
    int m_nYear;
    int m_nMonth;
    QStringList m_ListMonthName;

    //QImage* m_pImageBackground;

private slots:
    void on_pushButton_MonthPrev_clicked();

    void on_pushButton_MonthNext_clicked();

    void on_pushButton_OK_clicked();

    void on_pushButton_Cancel_clicked();

private:
    Ui::DialogCalendar *ui;


};

#endif // DIALOGCALENDAR_H
