File indexing completed on 2024-04-21 04:56:46
0001 /* 0002 * SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 * SPDX-FileCopyrightText: 2020 Piyush Aggarwal <piyushaggarwal002@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #ifndef BATTERYACTION_H 0009 #define BATTERYACTION_H 0010 0011 #include <KLocalizedString> 0012 #include <QFileDialog> 0013 #include <QMenu> 0014 0015 #include "interfaces/dbusinterfaces.h" 0016 0017 #include <dbushelper.h> 0018 0019 class BatteryAction : public QAction 0020 { 0021 Q_OBJECT 0022 public: 0023 BatteryAction(DeviceDbusInterface *device); 0024 void update(); 0025 private Q_SLOTS: 0026 void setCharge(int charge); 0027 void setCharging(bool charging); 0028 0029 private: 0030 BatteryDbusInterface m_batteryIface; 0031 int m_charge = -1; 0032 bool m_charging = false; 0033 }; 0034 0035 #endif // BATTERYACTION_H