Numworks Epsilon  1.4.1
Graphing Calculator Operating System
list_controller.h
Go to the documentation of this file.
1 #ifndef SHARED_LIST_CONTROLLER_H
2 #define SHARED_LIST_CONTROLLER_H
3 
4 #include <escher.h>
5 #include "function_store.h"
7 #include "new_function_cell.h"
8 #include "../i18n.h"
9 
10 namespace Shared {
11 
13 public:
15  int numberOfColumns() override;
16  KDCoordinate columnWidth(int i) override;
17  KDCoordinate cumulatedWidthFromIndex(int i) override;
18  KDCoordinate cumulatedHeightFromIndex(int j) override;
19  int indexFromCumulatedWidth(KDCoordinate offsetX) override;
20  int indexFromCumulatedHeight(KDCoordinate offsetY) override;
21  int typeAtLocation(int i, int j) override;
22  HighlightCell * reusableCell(int index, int type) override;
23  int reusableCellCount(int type) override;
24  void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
25  int numberOfButtons(ButtonRowController::Position position) const override;
26  Button * buttonAtIndex(int index, ButtonRowController::Position position) const override;
27  void didBecomeFirstResponder() override;
28  bool handleEvent(Ion::Events::Event event) override;
29  void didEnterResponderChain(Responder * previousFirstResponder) override;
30  void willExitResponderChain(Responder * nextFirstResponder) override;
31  void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
32 protected:
34  void configureFunction(Function * function);
35  virtual void reinitExpression(Function * function);
37  View * loadView() override;
38  void unloadView(View * view) override;
40 private:
41  static constexpr KDCoordinate k_functionNameWidth = 65;
42  TabViewController * tabController() const;
43  virtual int functionIndexForRow(int j);
44  virtual const char * textForRow(int j);
45  virtual void addEmptyFunction();
46  virtual bool removeFunctionRow(Function * function) = 0;
47  virtual void editExpression(Function * function, Ion::Events::Event event) = 0;
48  virtual ListParameterController * parameterController() = 0;
49  virtual int maxNumberOfRows() = 0;
50  virtual HighlightCell * titleCells(int index) = 0;
51  virtual HighlightCell * expressionCells(int index) = 0;
52  virtual void willDisplayTitleCellAtIndex(HighlightCell * cell, int j) = 0;
53  virtual void willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) = 0;
54  EvenOddCell * m_emptyCell;
55  I18n::Message m_addNewMessage;
56  NewFunctionCell * m_addNewFunction;
57  Button m_plotButton;
58  Button m_valuesButton;
59 };
60 
61 }
62 
63 #endif
int numberOfButtons(ButtonRowController::Position position) const override
void didBecomeFirstResponder() override
StackViewController * stackController() const
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
void tableViewDidChangeSelection(SelectableTableView *t, int previousSelectedCellX, int previousSelectedCellY) override
void configureFunction(Function *function)
KDCoordinate columnWidth(int i) override
int indexFromCumulatedHeight(KDCoordinate offsetY) override
int reusableCellCount(int type) override
FunctionStore * m_functionStore
View * loadView() override
ButtonRowController * header()
ButtonRowController * footer()
int numberOfColumns() override
void willExitResponderChain(Responder *nextFirstResponder) override
KDCoordinate cumulatedHeightFromIndex(int j) override
HighlightCell * reusableCell(int index, int type) override
Button * buttonAtIndex(int index, ButtonRowController::Position position) const override
void willDisplayCellAtLocation(HighlightCell *cell, int i, int j) override
int indexFromCumulatedWidth(KDCoordinate offsetX) override
ListController(Responder *parentResponder, FunctionStore *functionStore, ButtonRowController *header, ButtonRowController *footer, I18n::Message text)
void unloadView(View *view) override
Definition: view.h:23
SelectableTableView * selectableTableView()
int typeAtLocation(int i, int j) override
virtual void reinitExpression(Function *function)
Definition: button.h:10
bool handleEvent(Ion::Events::Event event) override
void didEnterResponderChain(Responder *previousFirstResponder) override
KDCoordinate cumulatedWidthFromIndex(int i) override