Blame view

build3/apps/battery_view.h 916 Bytes
6663b6c9   adorian   projet complet av...
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
  #ifndef APPS_BATTERY_VIEW_H
  #define APPS_BATTERY_VIEW_H
  
  #include <escher.h>
  
  class BatteryView : public View {
  public:
    BatteryView();
    bool setChargeState(Ion::Battery::Charge chargeState);
    bool setIsCharging(bool isCharging);
    bool setIsPlugged(bool isPlugged);
    void drawRect(KDContext * ctx, KDRect rect) const override;
    KDSize minimalSizeForOptimalDisplay() const override;
    constexpr static int k_flashHeight = 8;
    constexpr static int k_flashWidth = 4;
    constexpr static int k_tickHeight = 6;
    constexpr static int k_tickWidth = 8;
  private:
    constexpr static KDCoordinate k_batteryHeight = 8;
    constexpr static KDCoordinate k_batteryWidth = 15;
    constexpr static KDCoordinate k_elementWidth = 1;
    constexpr static KDCoordinate k_capHeight = 4;
    constexpr static KDCoordinate k_separatorThickness = 1;
    Ion::Battery::Charge m_chargeState;
    bool m_isCharging;
    bool m_isPlugged;
  };
  
  #endif