/** * @RDE_HEADER@ * Gui Plugin for Battery Monitor * $Id$ * $HeadURL$ * $Author$ # Created by Mike Wille, NLE, 2019-01-21 */ #pragma once #include #include #include namespace LtsNotification { class LtsNotification; } namespace Battery { class GuiPlugin final : public QObject, public GuiPluginBase::Plugin { Q_PLUGIN_METADATA(IID "gui:3:bat") Q_INTERFACES(GuiPluginBase::Plugin) Q_OBJECT public: explicit GuiPlugin() = default; ~GuiPlugin() = default; QString pluginName() override { return QLatin1String("BatteryGuiPlugin"); } std::shared_ptr createGuiInterface(LtsSession::LtsSession *session) override; bool availableInPartition(IDL::PartitionType ) const override { return true; } }; class InterfaceImpl final : public QObject, public GuiPluginBase::Interface { Q_OBJECT public: explicit InterfaceImpl(LtsSession::LtsSession *session); QVector getActions() override; bool availableInPartition(IDL::PartitionType ) const override { return true; } public slots: void onInitDone(); private: bool getBatteryStatus(bool &hasAC, uint8_t &charge, int32_t &lifetime); void checkWlanStatus(); void setWlanStatus(bool isConnected); LtsNotification::LtsNotification *m_noti; LtsNotification::LtsNotification *m_notiWlan; bool m_warnedLow; bool m_warnedCritical; QString m_issi; int m_signal; QTimer m_timer; private slots: void slotCheckBatteryStatus(); }; } // namespace ExerciseManagement