Numworks Epsilon  1.4.1
Graphing Calculator Operating System
values_controller.h
Go to the documentation of this file.
1 #ifndef SHARED_VALUES_CONTROLLER_H
2 #define SHARED_VALUES_CONTROLLER_H
3 
4 #include <escher.h>
5 #include "function_store.h"
6 #include "function_title_cell.h"
8 #include "interval.h"
12 #include "../i18n.h"
13 
14 namespace Shared {
15 
17 public:
19  const char * title() override;
20  Interval * interval();
21  int numberOfColumns() override;
22  virtual bool handleEvent(Ion::Events::Event event) override;
23  void didBecomeFirstResponder() override;
24  void willExitResponderChain(Responder * nextFirstResponder) override;
27  Button * buttonAtIndex(int index, ButtonRowController::Position position) const override;
28  virtual void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
29  KDCoordinate columnWidth(int i) override;
30  KDCoordinate cumulatedWidthFromIndex(int i) override;
31  int indexFromCumulatedWidth(KDCoordinate offsetX) override;
32  HighlightCell * reusableCell(int index, int type) override;
33  int reusableCellCount(int type) override;
34  int typeAtLocation(int i, int j) override;
35  bool isEmpty() const override;
36  Responder * defaultController() override;
37  void viewWillAppear() override;
38  void viewDidDisappear() override;
39  static constexpr KDCoordinate k_topMargin = 10;
40  static constexpr KDCoordinate k_bottomMargin = 15;
41  static constexpr KDCoordinate k_leftMargin = 1;
42  static constexpr KDCoordinate k_rightMargin = 15;
43  static constexpr KDCoordinate k_abscissaCellWidth = 100;
44  static constexpr KDCoordinate k_ordinateCellWidth = 100;
45 protected:
47  bool setDataAtLocation(double floatBody, int columnIndex, int rowIndex) override;
48  View * loadView() override;
49  void unloadView(View * view) override;
50  virtual void updateNumberOfColumns();
54 private:
55  virtual Function * functionAtColumn(int i);
56  Responder * tabController() const override;
57  void configureAbscissa();
58  void configureFunction();
59  bool cellAtLocationIsEditable(int columnIndex, int rowIndex) override;
60  double dataAtLocation(int columnIndex, int rowIndex) override;
61  int numberOfElements() override;
62  int maxNumberOfElements() const override;
63  virtual double evaluationOfAbscissaAtColumn(double abscissa, int columnIndex);
64  constexpr static int k_maxNumberOfAbscissaCells = 10;
65  virtual int maxNumberOfCells() = 0;
66  virtual int maxNumberOfFunctions() = 0;
67  EvenOddMessageTextCell * m_abscissaTitleCell;
68  virtual FunctionTitleCell * functionTitleCells(int j) = 0;
69  virtual EvenOddBufferTextCell * floatCells(int j) = 0;
70  char m_draftTextBuffer[TextField::maxBufferSize()];
71  EvenOddEditableTextCell * m_abscissaCells[k_maxNumberOfAbscissaCells];
72  virtual FunctionStore * functionStore() const = 0;
73  virtual ValuesFunctionParameterController * functionParameterController() = 0;
74  ValuesParameterController m_abscissaParameterController;
75  Button m_setIntervalButton;
76 };
77 
78 }
79 
80 #endif
81 
bool isEmpty() const override
int typeAtLocation(int i, int j) override
static constexpr KDCoordinate k_bottomMargin
KDCoordinate cumulatedWidthFromIndex(int i) override
static constexpr int maxBufferSize()
Definition: text_field.h:23
void didBecomeFirstResponder() override
StackViewController * stackController() const
int16_t KDCoordinate
Definition: coordinate.h:6
int numberOfButtons(ButtonRowController::Position) const override
Responder * parentResponder() const
Definition: responder.cpp:12
virtual void willDisplayCellAtLocation(HighlightCell *cell, int i, int j) override
static constexpr KDCoordinate k_abscissaCellWidth
ValuesController(Responder *parentResponder, ButtonRowController *header, I18n::Message parameterTitle, IntervalParameterController *intervalParameterController, Interval *interval)
HighlightCell * reusableCell(int index, int type) override
Responder * defaultController() override
bool setDataAtLocation(double floatBody, int columnIndex, int rowIndex) override
static constexpr KDCoordinate k_topMargin
virtual bool handleEvent(Ion::Events::Event event) override
Button * buttonAtIndex(int index, ButtonRowController::Position position) const override
ButtonRowController * header()
int reusableCellCount(int type) override
void willExitResponderChain(Responder *nextFirstResponder) override
virtual IntervalParameterController * intervalParameterController()=0
KDCoordinate columnWidth(int i) override
static constexpr KDCoordinate k_leftMargin
const char * title() override
virtual void updateNumberOfColumns()
Definition: view.h:23
static constexpr KDCoordinate k_ordinateCellWidth
Definition: button.h:10
static constexpr KDCoordinate k_rightMargin
void unloadView(View *view) override
int indexFromCumulatedWidth(KDCoordinate offsetX) override