Blame view

build4/epsilon-master/apps/exam_pop_up_controller.h 1.72 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  #ifndef APPS_EXAM_POP_UP_CONTROLLER_H
  #define APPS_EXAM_POP_UP_CONTROLLER_H
  
  #include <escher.h>
  #include "exam_pop_up_controller_delegate.h"
  
  class HighContrastButton : public Button {
  public:
    using Button::Button;
    virtual KDColor highlightedBackgroundColor() const override { return Palette::YellowDark; }
  };
  
  class ExamPopUpController : public ViewController {
  public:
    ExamPopUpController(ExamPopUpControllerDelegate * delegate);
    void setActivatingExamMode(bool activingExamMode);
    bool isActivatingExamMode() const { return m_isActivatingExamMode; }
    // View Controller
    View * view() override;
    void viewDidDisappear() override;
    // Responder
    void didBecomeFirstResponder() override;
    bool handleEvent(Ion::Events::Event event) override;
  private:
    class ContentView : public View {
    public:
      ContentView(Responder * parentResponder);
      void drawRect(KDContext * ctx, KDRect rect) const override;
      void setSelectedButton(int selectedButton, App * app);
      int selectedButton();
      void setMessages(bool activingExamMode);
    private:
      constexpr static KDCoordinate k_buttonMargin = 10;
      constexpr static KDCoordinate k_buttonHeight = 20;
      constexpr static KDCoordinate k_topMargin = 12;
      constexpr static KDCoordinate k_paragraphHeight = 20;
      int numberOfSubviews() const override;
      View * subviewAtIndex(int index) override;
      void layoutSubviews() override;
      HighContrastButton m_cancelButton;
      HighContrastButton m_okButton;
      MessageTextView m_warningTextView;
      MessageTextView m_messageTextView1;
      MessageTextView m_messageTextView2;
      MessageTextView m_messageTextView3;
    };
    ContentView m_contentView;
    bool m_isActivatingExamMode;
    ExamPopUpControllerDelegate * m_delegate;
  };
  
  #endif