#ifndef UPOWERHELPER_H
#define UPOWERHELPER_H

#include <QDBusConnection>
#include <QVariantMap>
#include <QObject>

class EngineDevice;

/**
 * @brief login1访问工具类
 *
 */
class UpowerHelper : public QObject
{
    Q_OBJECT
public:
    explicit UpowerHelper(QObject *parent = nullptr);

    virtual ~UpowerHelper();

    QStringList getBatteryArgs();

    QString getBatteryIconName();

    inline bool getIsBattery() { return m_isBattery; }

private Q_SLOTS:

    void onBatteryChanged(QStringList args);

    void dealMessage(QDBusMessage);

Q_SIGNALS:
    void batteryStatusChanged(QString iconName);

    void batteryChanged(QStringList args);

private:
    QDBusInterface *m_upowerInterface = nullptr;
    QDBusInterface *m_batInterface = nullptr;
    QDBusInterface *m_upowerService = nullptr;

    EngineDevice* m_engineDevice;

    bool m_isBattery = false;
};

#endif // UPOWERHELPER_H
