| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
#ifndef QBATTERYINFO_WIN_P_H |
| 53 |
#define QBATTERYINFO_WIN_P_H |
| 54 |
|
| 55 |
#include <qbatteryinfo.h> |
| 56 |
#include <QMap> |
| 57 |
#include <QTimer> |
| 58 |
|
| 59 |
|
| 60 |
QT_BEGIN_NAMESPACE |
| 61 |
|
| 62 |
class QTimer; |
| 63 |
|
| 64 |
class QBatteryInfoPrivate : public QObject |
| 65 |
{ |
| 66 |
Q_OBJECT |
| 67 |
|
| 68 |
public: |
| 69 |
QBatteryInfoPrivate(QBatteryInfo *parent); |
| 70 |
QBatteryInfoPrivate(int batteryIndex, QBatteryInfo *parent); |
| 71 |
~QBatteryInfoPrivate(); |
| 72 |
|
| 73 |
int batteryCount(); |
| 74 |
int batteryIndex() const; |
| 75 |
bool isValid(); |
| 76 |
int level(int battery); |
| 77 |
int level(); |
| 78 |
int currentFlow(int battery); |
| 79 |
int currentFlow(); |
| 80 |
int cycleCount(int battery); |
| 81 |
int cycleCount(); |
| 82 |
int maximumCapacity(int battery); |
| 83 |
int maximumCapacity(); |
| 84 |
int remainingCapacity(int battery); |
| 85 |
int remainingCapacity(); |
| 86 |
int remainingChargingTime(int battery); |
| 87 |
int remainingChargingTime(); |
| 88 |
int voltage(int battery); |
| 89 |
int voltage(); |
| 90 |
QBatteryInfo::ChargerType chargerType(); |
| 91 |
QBatteryInfo::ChargingState chargingState(int battery); |
| 92 |
QBatteryInfo::ChargingState chargingState(); |
| 93 |
QBatteryInfo::LevelStatus levelStatus(int battery); |
| 94 |
QBatteryInfo::LevelStatus levelStatus(); |
| 95 |
QBatteryInfo::Health health(int battery); |
| 96 |
QBatteryInfo::Health health(); |
| 97 |
float temperature(int battery); |
| 98 |
float temperature(); |
| 99 |
|
| 100 |
void setBatteryIndex(int batteryIndex); |
| 101 |
|
| 102 |
Q_SIGNALS: |
| 103 |
void batteryCountChanged(int count); |
| 104 |
void batteryIndexChanged(int batteryIndex); |
| 105 |
void validChanged(bool isValid); |
| 106 |
void chargerTypeChanged(QBatteryInfo::ChargerType type); |
| 107 |
void chargingStateChanged(QBatteryInfo::ChargingState state); |
| 108 |
void levelChanged(int level); |
| 109 |
void currentFlowChanged(int flow); |
| 110 |
void cycleCountChanged(int cycleCount); |
| 111 |
void remainingCapacityChanged(int capacity); |
| 112 |
void remainingChargingTimeChanged(int seconds); |
| 113 |
void voltageChanged(int voltage); |
| 114 |
void levelStatusChanged(QBatteryInfo::LevelStatus levelStatus); |
| 115 |
void healthChanged(QBatteryInfo::Health health); |
| 116 |
void temperatureChanged(float temperature); |
| 117 |
|
| 118 |
private: |
| 119 |
QBatteryInfo * const q_ptr; |
| 120 |
Q_DECLARE_PUBLIC(QBatteryInfo); |
| 121 |
|
| 122 |
int timeToFull; |
| 123 |
int numberOfBatteries; |
| 124 |
int index; |
| 125 |
|
| 126 |
QMap<int, int> currentFlows; |
| 127 |
QMap<int, int> voltages; |
| 128 |
QMap<int, int> remainingCapacities; |
| 129 |
QMap<int, int> remainingChargingTimes; |
| 130 |
QMap<int, int> maximumCapacities; |
| 131 |
QMap<int, QBatteryInfo::ChargingState> chargingStates; |
| 132 |
QBatteryInfo::ChargerType currentChargerType; |
| 133 |
QMap<int, QBatteryInfo::LevelStatus> levelStatuss; |
| 134 |
|
| 135 |
void initialize(); |
| 136 |
|
| 137 |
private Q_SLOTS: |
| 138 |
void getBatteryStatus(); |
| 139 |
|
| 140 |
}; |
| 141 |
|
| 142 |
QT_END_NAMESPACE |
| 143 |
|
| 144 |
#endif |