#ifndef FORMHOME_H
#define FORMHOME_H

#include <QWidget>
#include <QStackedWidget>
#include <QMap>

#include "login/FormLogin.h"
#include "DataTypeDef.h"

namespace Ui {
class FormHome;
}

class FormHome : public QWidget
{
    Q_OBJECT

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

    void init();

private:
    void initWidget();
    void setupConnections();
    void showForm(workspace_form_enum form);

    void setPrevForm();

private slots:

signals:
    void showLogin();
    void userInactive();

private:
    Ui::FormHome *ui;
    workspace_form_enum                 m_currentForm;
    workspace_form_enum                 m_prevForm;

    QMap<workspace_form_enum, QWidget*> m_formMap;

    // 登录页面
    FormLogin*                          m_login;
};

#endif // FORMHOME_H
