#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include <QTimer>
#include "awResumeExam.h"
#include "CHttpBll.h"
#include "courseList.h"

QT_BEGIN_NAMESPACE
namespace Ui { class login; }
QT_END_NAMESPACE

enum class LOGIN_TYPE
{
    lt_identity = 1,
    lt_studentCode
};

class login : public QWidget
{
    Q_OBJECT

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

private slots:
    void on_btn_close_clicked();

    void on_btn_login_clicked();

    void on_btn_studentCodeLogin_clicked();

    void on_btn_identityLogin_clicked();
	
	void onStudentClientConfig(CStudentClientConfig studentClientConfig);
	void onLoginLimit(CLoginLimit loginLimit); 
	void onLoginInfo(CLoginInfo loginInfo);
	void onLogout(CLogout logout);
	void onDownLoadFile(CDownLoadFileInfo downLoadFileInfo);
    void onTokenExpired();
private:
    void initUI();
    void initParam();
    void setBtnStyle();

    Ui::login *ui;
	std::shared_ptr<QTimer> m_pUiTimer; 
	LOGIN_TYPE m_loginType;
    int m_nloginTypeCount = 0;

    std::shared_ptr<courseList> m_pCourseList;
	std::shared_ptr<awResumeExam> m_pLoading;

    int m_nRetryCount;
	QString m_sStudentClientBgPictureUrl;
	QString m_sLogoFileUrl;

};
#endif // LOGIN_H
