equation_models_parameter_controller.h
2.01 KB
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
#ifndef SOLVER_EQUATION_MODELS_PARAMETER_CONTROLLER_H
#define SOLVER_EQUATION_MODELS_PARAMETER_CONTROLLER_H
#include <escher.h>
#include "equation_store.h"
namespace Solver {
class ListController;
class EquationModelsParameterController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource {
public:
EquationModelsParameterController(Responder * parentResponder, EquationStore * equationStore, ListController * listController);
~EquationModelsParameterController();
EquationModelsParameterController(const EquationModelsParameterController& other) = delete;
EquationModelsParameterController(EquationModelsParameterController&& other) = delete;
EquationModelsParameterController& operator=(const EquationModelsParameterController& other) = delete;
EquationModelsParameterController& operator=(EquationModelsParameterController&& other) = delete;
const char * title() override;
View * view() override;
void viewWillAppear() override;
void didBecomeFirstResponder() override;
bool handleEvent(Ion::Events::Event event) 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;
private:
constexpr static int k_numberOfModels = 6;
static constexpr const char * k_models[k_numberOfModels] = {
"", "x+y=0", "x^2+x+1=0", "x+y+z=0", "x^3+x^2+x+1=0", "x+y+z+t=0"
};
StackViewController * stackController() const;
constexpr static int k_numberOfExpressionCells = k_numberOfModels-1;
MessageTableCell m_emptyModelCell;
ExpressionTableCell m_modelCells[k_numberOfExpressionCells];
Poincare::ExpressionLayout * m_expressionLayouts[k_numberOfExpressionCells];
SelectableTableView m_selectableTableView;
EquationStore * m_equationStore;
ListController * m_listController;
};
}
#endif