Numworks Epsilon  1.4.1
Graphing Calculator Operating System
battery_view.h
Go to the documentation of this file.
1 #ifndef APPS_BATTERY_VIEW_H
2 #define APPS_BATTERY_VIEW_H
3 
4 #include <escher.h>
5 
6 class BatteryView : public View {
7 public:
8  BatteryView();
9  bool setChargeState(Ion::Battery::Charge chargeState);
10  bool setIsCharging(bool isCharging);
11  bool setIsPlugged(bool isPlugged);
12  void drawRect(KDContext * ctx, KDRect rect) const override;
13  KDSize minimalSizeForOptimalDisplay() const override;
14  constexpr static int k_flashHeight = 8;
15  constexpr static int k_flashWidth = 4;
16  constexpr static int k_tickHeight = 6;
17  constexpr static int k_tickWidth = 8;
18 private:
19  constexpr static KDCoordinate k_batteryHeight = 8;
20  constexpr static KDCoordinate k_batteryWidth = 15;
21  constexpr static KDCoordinate k_elementWidth = 1;
22  constexpr static KDCoordinate k_capHeight = 4;
23  constexpr static KDCoordinate k_separatorThickness = 1;
24  Ion::Battery::Charge m_chargeState;
25  bool m_isCharging;
26  bool m_isPlugged;
27 };
28 
29 #endif
bool isPlugged()
Definition: usb.cpp:12
bool isCharging()
Definition: battery.cpp:16
int16_t KDCoordinate
Definition: coordinate.h:6
bool setIsCharging(bool isCharging)
bool setIsPlugged(bool isPlugged)
static constexpr int k_flashHeight
Definition: battery_view.h:14
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: size.h:6
KDSize minimalSizeForOptimalDisplay() const override
static constexpr int k_tickHeight
Definition: battery_view.h:16
static constexpr int k_flashWidth
Definition: battery_view.h:15
Definition: rect.h:26
Definition: view.h:23
static constexpr int k_tickWidth
Definition: battery_view.h:17
bool setChargeState(Ion::Battery::Charge chargeState)