Files
Upsilon/apps/graph/list/function_cell.h
Émilie Feral 52f30ddf28 [apps/graph/list] turn the childless function cell in a controller with two subviews
Change-Id: I7606a3c2b4ab81cba90b78ed70dac9ba6ebb09c2
2016-09-19 15:07:00 +02:00

36 lines
976 B
C++

#ifndef GRAPH_FUNCTION_CELL_H
#define GRAPH_FUNCTION_CELL_H
#include <escher.h>
#include "../function.h"
#include "function_expression_view.h"
#include "function_name_view.h"
class FunctionCell : public View, public Responder {
public:
FunctionCell();
void setFunction(Graph::Function * f);
void setEven(bool even);
bool isEven();
Graph::Function * function();
void didBecomeFirstResponder() override;
void didResignFirstResponder() override;
bool handleEvent(Ion::Events::Event event) override;
private:
static constexpr KDCoordinate k_functionNameWidth = 40;
static constexpr KDCoordinate k_functionExpressionWidth = 100;
static constexpr KDCoordinate k_functionCellHeight = 50;
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
FunctionExpressionView m_functionExpressionView;
FunctionNameView m_functionNameView;
Graph::Function * m_function;
bool m_even;
};
#endif