1 #ifndef SHARED_SUM_GRAPH_CONTROLLER_H 2 #define SHARED_SUM_GRAPH_CONTROLLER_H 38 constexpr
static float k_cursorTopMarginRatio = 0.06f;
39 constexpr
static float k_cursorBottomMarginRatio = 0.28f;
40 virtual I18n::Message legendMessageAtStep(
Step step) = 0;
41 virtual double cursorNextStep(
double position,
int direction) = 0;
45 TextFieldDelegateApp * textFieldDelegateApp()
override {
46 return static_cast<TextFieldDelegateApp *
>(
app());
48 bool handleEnter()
override;
49 class LegendView :
public View {
53 LegendView(
const LegendView& other) =
delete;
54 LegendView(LegendView&& other) =
delete;
55 LegendView&
operator=(
const LegendView& other) =
delete;
56 LegendView&
operator=(LegendView&& other) =
delete;
57 TextField * textField() {
return &m_editableZone; }
58 KDSize minimalSizeForOptimalDisplay()
const override;
60 void setLegendMessage(I18n::Message message,
Step step);
61 void setEditableZone(
double d);
69 int numberOfSubviews()
const override;
70 View * subviewAtIndex(
int index)
override;
71 void layoutSubviews()
override;
72 void layoutSubviews(
Step step);
80 FunctionGraphView * m_graphView;
81 LegendView m_legendView;
82 VerticalCursorView m_cursorView;
View & operator=(const View &other)=delete
bool textFieldDidFinishEditing(TextField *textField, const char *text, Ion::Events::Event event) override
static constexpr int maxBufferSize()
constexpr KDCoordinate width() const
Responder * parentResponder() const
bool textFieldDidAbortEditing(TextField *textField, const char *text) override
void didEnterResponderChain(Responder *previousFirstResponder) override
InteractiveCurveViewRange * m_graphRange
bool textFieldDidReceiveEvent(TextField *textField, Ion::Events::Event event) override
void setFunction(Function *function)
static constexpr KDSize charSize(FontSize size=FontSize::Large)
bool handleEvent(Ion::Events::Event event) override
virtual bool moveCursorHorizontallyToPosition(double position)
SumGraphController(Responder *parentResponder, FunctionGraphView *curveView, InteractiveCurveViewRange *range, CurveViewCursor *cursor, char sumSymbol)
void viewWillAppear() override
constexpr KDCoordinate height() const