#ifndef FORMCHARGINGPROFILESSETTINGS_H
#define FORMCHARGINGPROFILESSETTINGS_H

#include <QWidget>
#include <QSharedPointer>

#include "BaseWidget.h"
#include "DataTypeDef.h"
#include "OcppSettings/ChargingProfiles/DialogChargingProfileEdit.h"

namespace Ui {
class FormChargingProfilesSettings;
}

class FormChargingProfilesSettings : public BaseWidget
{
    Q_OBJECT

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

    bool returnParent() override;

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

    void refreshData();
    void refreshTableWidget();
    void tableWidgetAppendRow(const int& connectorId,
                              const QString& chargingProfilePurpose,
                              const QString& chargingProfileKind,
                              const QString& recurrencyKind,
                              const int& stackLevel);
    void updateData();

protected:
    void showEvent(QShowEvent* event) override;

signals:
    void currentFormChanged(const charging_profiles_detail_info_t& info);
    void refreshChargingProfileNavigationBar(const QString& purpose);

private:
    Ui::FormChargingProfilesSettings *ui;
    CHARGING_PROFILES m_charging_profiles;
    QSharedPointer<DialogChargingProfileEdit> m_charging_profile_info;
};

#endif // FORMCHARGINGPROFILESSETTINGS_H
