Numworks Epsilon  1.4.1
Graphing Calculator Operating System
sub_controller.h
Go to the documentation of this file.
1 #ifndef SETTINGS_SUB_CONTROLLER_H
2 #define SETTINGS_SUB_CONTROLLER_H
3 
4 #include <escher.h>
6 #include "../hardware_test/pop_up_controller.h"
7 #include "../shared/parameter_text_field_delegate.h"
8 
9 namespace Settings {
10 
12 public:
15  SubController(const SubController& other) = delete;
16  SubController(SubController&& other) = delete;
17  SubController& operator=(const SubController& other) = delete;
18  SubController& operator=(SubController&& other) = delete;
19  View * view() override;
20  const char * title() override;
21  bool handleEvent(Ion::Events::Event event) override;
22  void didEnterResponderChain(Responder * previousFirstResponder) override;
23  void didBecomeFirstResponder() override;
24  int numberOfRows() override;
25  KDCoordinate rowHeight(int j) override;
26  KDCoordinate cumulatedHeightFromIndex(int j) override;
27  int indexFromCumulatedHeight(KDCoordinate offsetY) override;
28  HighlightCell * reusableCell(int index, int type) override;
29  int reusableCellCount(int type) override;
30  int typeAtLocation(int i, int j) override;
31  void willDisplayCellForIndex(HighlightCell * cell, int index) override;
32  void setMessageTreeModel(const MessageTree * messageTreeModel);
33  void viewWillAppear() override;
34  void viewDidDisappear() override;
35  bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override;
36  bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
37 private:
38  StackViewController * stackController() const;
39  void setPreferenceWithValueIndex(I18n::Message message, int valueIndex);
40  int valueIndexForPreference(I18n::Message message);
41  Shared::TextFieldDelegateApp * textFieldDelegateApp() override;
42  constexpr static KDCoordinate k_topBottomMargin = 13;
43  constexpr static int k_totalNumberOfCell = (Ion::Display::Height-2*k_topBottomMargin-Metric::TitleBarHeight-Metric::StackTitleHeight)/Metric::ParameterCellHeight;
44  MessageTableCellWithBuffer m_cells[k_totalNumberOfCell];
45  ExpressionTableCell m_complexFormatCells[2];
46  Poincare::ExpressionLayout * m_complexFormatLayout[2];
47  MessageTableCellWithEditableText m_editableCell;
49  SelectableTableView m_selectableTableView;
50  MessageTree * m_messageTreeModel;
51  HardwareTest::PopUpController m_hardwareTestPopUpController;
52 };
53 
54 }
55 
56 #endif
void didBecomeFirstResponder() override
static constexpr KDCoordinate StackTitleHeight
Definition: metric.h:28
static constexpr KDCoordinate TitleBarHeight
Definition: metric.h:14
SubController(Responder *parentResponder)
void willDisplayCellForIndex(HighlightCell *cell, int index) override
int16_t KDCoordinate
Definition: coordinate.h:6
void setMessageTreeModel(const MessageTree *messageTreeModel)
Responder * parentResponder() const
Definition: responder.cpp:12
int reusableCellCount(int type) override
KDCoordinate cumulatedHeightFromIndex(int j) override
bool textFieldDidFinishEditing(TextField *textField, const char *text, Ion::Events::Event event) override
HighlightCell * reusableCell(int index, int type) override
const char * title() override
void didEnterResponderChain(Responder *previousFirstResponder) override
int typeAtLocation(int i, int j) override
SubController & operator=(const SubController &other)=delete
static constexpr KDCoordinate ParameterCellHeight
Definition: metric.h:15
Definition: view.h:23
View * view() override
bool handleEvent(Ion::Events::Event event) override
int indexFromCumulatedHeight(KDCoordinate offsetY) override
void viewWillAppear() override
constexpr int Height
Definition: display.h:27
bool textFieldShouldFinishEditing(TextField *textField, Ion::Events::Event event) override
void viewDidDisappear() override
Definition: app.cpp:5
KDCoordinate rowHeight(int j) override