Blame view

build3/apps/settings/sub_controller.h 2.46 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
53
54
55
56
  #ifndef SETTINGS_SUB_CONTROLLER_H
  #define SETTINGS_SUB_CONTROLLER_H
  
  #include <escher.h>
  #include "settings_message_tree.h"
  #include "../hardware_test/pop_up_controller.h"
  #include "../shared/parameter_text_field_delegate.h"
  
  namespace Settings {
  
  class SubController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource, public Shared::ParameterTextFieldDelegate {
  public:
    SubController(Responder * parentResponder);
    ~SubController();
    SubController(const SubController& other) = delete;
    SubController(SubController&& other) = delete;
    SubController& operator=(const SubController& other) = delete;
    SubController& operator=(SubController&& other) = delete;
    View * view() override;
    const char * title() override;
    bool handleEvent(Ion::Events::Event event) override;
    void didEnterResponderChain(Responder * previousFirstResponder) override;
    void didBecomeFirstResponder() override;
    int numberOfRows() override;
    KDCoordinate rowHeight(int j) override;
    KDCoordinate cumulatedHeightFromIndex(int j) override;
    int indexFromCumulatedHeight(KDCoordinate offsetY) override;
    HighlightCell * reusableCell(int index, int type) override;
    int reusableCellCount(int type) override;
    int typeAtLocation(int i, int j) override;
    void willDisplayCellForIndex(HighlightCell * cell, int index) override;
    void setMessageTreeModel(const MessageTree * messageTreeModel);
    void viewWillAppear() override;
    void viewDidDisappear() override;
    bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override;
    bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
  private:
    StackViewController * stackController() const;
    void setPreferenceWithValueIndex(I18n::Message message, int valueIndex);
    int valueIndexForPreference(I18n::Message message);
    Shared::TextFieldDelegateApp * textFieldDelegateApp() override;
    constexpr static int k_totalNumberOfCell = I18n::NumberOfLanguages;
    constexpr static KDCoordinate k_topBottomMargin = 13;
    MessageTableCellWithBuffer m_cells[k_totalNumberOfCell];
    ExpressionTableCell m_complexFormatCells[2];
    Poincare::ExpressionLayout * m_complexFormatLayout[2];
    MessageTableCellWithEditableText m_editableCell;
    char m_draftTextBuffer[MessageTableCellWithEditableText::k_bufferLength];
    SelectableTableView m_selectableTableView;
    MessageTree * m_messageTreeModel;
    HardwareTest::PopUpController m_hardwareTestPopUpController;
  };
  
  }
  
  #endif