Numworks Epsilon  1.4.1
Graphing Calculator Operating System
float_parameter_controller.h
Go to the documentation of this file.
1 #ifndef SHARED_FLOAT_PARAMETER_CONTROLLER_H
2 #define SHARED_FLOAT_PARAMETER_CONTROLLER_H
3 
4 #include <escher.h>
7 
8 namespace Shared {
9 
10 /* This controller edits float parameter of any model (given through
11  * parameterAtIndex and setParameterAtIndex). */
12 
14 public:
16  void didBecomeFirstResponder() override;
17  void viewWillAppear() override;
18  void willExitResponderChain(Responder * nextFirstResponder) override;
19  bool handleEvent(Ion::Events::Event event) override;
20 
21  int typeAtLocation(int i, int j) override;
22  int reusableCellCount(int type) override;
23  HighlightCell * reusableCell(int index, int type) override;
24  KDCoordinate rowHeight(int j) override;
25  KDCoordinate cumulatedHeightFromIndex(int j) override;
26  int indexFromCumulatedHeight(KDCoordinate offsetY) override;
27  void willDisplayCellForIndex(HighlightCell * cell, int index) override;
28  bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override;
29  bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
30 protected:
31  int activeCell();
33  virtual double parameterAtIndex(int index) = 0;
35  View * loadView() override;
36  void unloadView(View * view) override;
37 private:
38  constexpr static int k_buttonMargin = 6;
39  virtual void buttonAction();
40  virtual I18n::Message okButtonText();
41  virtual int reusableParameterCellCount(int type) = 0;
42  virtual HighlightCell * reusableParameterCell(int index, int type) = 0;
43  TextFieldDelegateApp * textFieldDelegateApp() override;
44  virtual bool setParameterAtIndex(int parameterIndex, double f) = 0;
45  ButtonWithSeparator * m_okButton;
46 };
47 
48 }
49 
50 #endif
int indexFromCumulatedHeight(KDCoordinate offsetY) override
int16_t KDCoordinate
Definition: coordinate.h:6
Responder * parentResponder() const
Definition: responder.cpp:12
virtual SelectableTableView * selectableTableView()
FloatParameterController(Responder *parentResponder)
HighlightCell * reusableCell(int index, int type) override
void willExitResponderChain(Responder *nextFirstResponder) override
virtual double parameterAtIndex(int index)=0
bool textFieldShouldFinishEditing(TextField *textField, Ion::Events::Event event) override
void willDisplayCellForIndex(HighlightCell *cell, int index) override
Definition: view.h:23
bool handleEvent(Ion::Events::Event event) override
bool textFieldDidFinishEditing(TextField *textField, const char *text, Ion::Events::Event event) override
KDCoordinate cumulatedHeightFromIndex(int j) override