Blame view

build3/apps/shared/message_controller.h 1.24 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
  #ifndef SHARED_MESSAGE_CONTROLLER_H
  #define SHARED_MESSAGE_CONTROLLER_H
  
  #include <escher.h>
  #include "ok_view.h"
  
  class MessageController : public ViewController {
  public:
    MessageController(I18n::Message * messages, KDColor * colors);
    View * view() override;
    bool handleEvent(Ion::Events::Event event) override;
  private:
    class ContentView : public View {
    public:
      ContentView(I18n::Message * messages, KDColor * colors);
      void drawRect(KDContext * ctx, KDRect rect) const override;
    private:
      constexpr static KDCoordinate k_titleMargin = 40;
      constexpr static KDCoordinate k_paragraphHeight = 100;
      constexpr static KDCoordinate k_paragraphMargin = 13;
      constexpr static KDCoordinate k_bottomMargin = 13;
      constexpr static KDCoordinate k_okMargin = 10;
      constexpr static KDCoordinate k_skipMargin = 4;
      int numberOfSubviews() const override;
      View * subviewAtIndex(int index) override;
      void layoutSubviews() override;
      MessageTextView m_titleTextView;
      MessageTextView m_messageTextView1;
      MessageTextView m_messageTextView2;
      MessageTextView m_messageTextView3;
      MessageTextView m_messageTextView4;
      MessageTextView m_skipView;
      Shared::OkView m_okView;
    };
    ContentView m_contentView;
  };
  
  #endif