#ifndef FORMOFFLINEPRICE_H
#define FORMOFFLINEPRICE_H

#include <QWidget>
#include <QScopedPointer>

#include "BaseWidget.h"
#include "DataTypeDef.h"
#include "CcuSettings/FormPriceDetail.h"

namespace Ui {
class FormOfflinePrice;
}

class FormOfflinePrice : public BaseWidget
{
    Q_OBJECT

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

    bool returnParent() override;

private:
    void initWidget();
    void initComboBox();
    void initPriceType();
    void initTimezone();
    void initTableWidget();

    void initConnect();

    void refreshData();
    void refreshPriceInfo(const QList<OFFLINE_PRICE>& info);
    void addTableWidgetItem(const QString& period,
                            const QString& total,
                            const QString& electricity,
                            const QString& service);

    void updateData();

private slots:


protected:
    void showEvent(QShowEvent* event) override;

private:
    Ui::FormOfflinePrice *ui;

    PRICE_INFO m_price_info;

    QScopedPointer<FormPriceDetail> m_price_detail;
};

#endif // FORMOFFLINEPRICE_H
