Numworks Epsilon  1.4.1
Graphing Calculator Operating System
usb_test_controller.h
Go to the documentation of this file.
1 #ifndef HARDWARE_TEST_USB_TEST_CONTROLLER_H
2 #define HARDWARE_TEST_USB_TEST_CONTROLLER_H
3 
4 #include <escher.h>
5 #include "reset_controller.h"
6 #include "arrow_view.h"
7 
8 namespace HardwareTest {
9 
10 class USBTestController : public ViewController, public Timer {
11 public:
13  View * view() override;
14  void viewWillAppear() override;
15  bool handleEvent(Ion::Events::Event e) override;
16 private:
17  bool fire() override;
18  class ContentView : public SolidColorView {
19  public:
20  ContentView();
21  BufferTextView * USBTextView();
22  ArrowView * arrowView();
23  private:
24  class USBView : public View {
25  public:
26  void drawRect(KDContext * ctx, KDRect rect) const override;
27  constexpr static KDCoordinate k_USBHoleWidth = 40;
28  constexpr static KDCoordinate k_USBHoleHeight = 20;
29  constexpr static KDCoordinate k_marginHeight = 50;
30  };
31  constexpr static KDCoordinate k_textHeight = 50;
32  void layoutSubviews() override;
33  int numberOfSubviews() const override;
34  View * subviewAtIndex(int index) override;
35  BufferTextView m_USBTextView;
36  USBView m_USBView;
37  ArrowView m_arrowView;
38  };
39  constexpr static const char * k_USBPlugText = "PLUG USB";
40  constexpr static const char * k_USBUnplugText = "OK, UNPLUG USB";
41  ContentView m_view;
42  bool m_shouldPlugUSB;
43  ResetController m_resetController;
44 };
45 
46 }
47 
48 #endif
49 
Definition: timer.h:15
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
bool handleEvent(Ion::Events::Event e) override
Definition: rect.h:26
Definition: view.h:23
USBTestController(Responder *parentResponder)