#ifndef FORMSETTINGS_H
#define FORMSETTINGS_H

#include <QWidget>
#include <QMap>

#include "BaseWidget.h"
#include "DataTypeDef.h"

namespace Ui {
class FormSettings;
}

class FormSettings : public BaseWidget
{
    Q_OBJECT

public:
    explicit FormSettings(BaseWidget *parent = nullptr);
    ~FormSettings();

    bool returnParent() override;

public slots:
    void slotReturnPrevForm();

private:
    void initWidget();
    void refreshStackWidget();
    void initConnect();

    void refreshNavigationBar();
    void refreshGunSettingsNavigationBar();
    int getNodeDataByGunId(const int& gun_id);

    void initNavigationBar();

    void showForm(int form);

private slots:
    void onUpdateChargingProfileData(const charging_profiles_detail_info_t& info);

signals:
    void returnPrevForm();

protected:
    void hideEvent(QHideEvent* event) override;
    void showEvent(QShowEvent* event) override;

private:
    Ui::FormSettings *ui;
    CCU_CFG m_ccu_cfg;

    // 表单映射，存储不同类型的表单
    QMap<int, QWidget*> m_formMap;
};

#endif // FORMSETTINGS_H
