#ifndef ALARMEVENTMAINDIALOG_H
#define ALARMEVENTMAINDIALOG_H

#include <QDialog>
#include "global.h"
#include "alarmEventGlobal.h"
#include "alarmEventUtils.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class alarmEventMainDialog;
}
QT_END_NAMESPACE

class TransparentMask;
class MessageDialog;
class AlarmEventDataView;

class AlarmEventMainDialog : public QDialog
{
    Q_OBJECT

public:
    AlarmEventMainDialog(QWidget *parent = nullptr);
    ~AlarmEventMainDialog();

    void setMode(AlarmDataMode mode);

signals:
    void sgl_hide();
    void openConfigDialog();

protected:
    void showEvent(QShowEvent* event) override;
    void resizeEvent(QResizeEvent*) override;
    bool eventFilter(QObject*, QEvent*) override;

private slots:
    void onSignal_subDialogClose();
    void onSyncDataStatus(const PaginationInfo&);
    void onLoadDataError(const QString&);
    //搜索条件
    void onBeginTimeChanged();
    void onEndTimeChanged();

public slots:
    void onBtnClicked_close();
    void onBtnClicked_confirmAll();

    void onBtnClicked_firstPage();
    void onBtnClicked_previousPage();
    void onBtnClicked_nextPage();
    void onBtnClicked_lastPage();
    void onEditingFinished_page();

private:
    void showTransparentMask();
    void hideTransparentMask();
    void showMessageDialog(MessageDialogType,const QString&,const QString&);

    Ui::alarmEventMainDialog*  ui;
    TransparentMask* m_pTransparentMask;
    MessageDialog* m_pMessageDialog;
    AlarmEventDataView* m_tableView;
    AlarmDataMode m_mode;
    AlarmEventDataFilter m_eventFilter;

};

#endif
