3 #include "../../i18n.h" 13 m_functionTitleCells{},
15 m_parameterController(
this, functionStore, I18n::Message::FunctionColor, I18n::Message::DeleteFunction)
35 if (function->layout() ==
nullptr) {
38 KDCoordinate functionSize =
function->layout()->size().height();
43 char * initialText =
nullptr;
46 strlcpy(initialTextContent, function->text(),
sizeof(initialTextContent));
47 initialText = initialTextContent;
51 inputController->
edit(
this, event,
function, initialText,
52 [](
void * context,
void * sender){
55 const char * textBody = myInputViewController->
textBody();
58 [](
void * context,
void * sender){
63 return &m_parameterController;
66 int ListController::maxNumberOfRows() {
67 return k_maxNumberOfRows;
71 assert(index >= 0 && index < k_maxNumberOfRows);
72 return m_functionTitleCells[index];
76 assert(index >= 0 && index < k_maxNumberOfRows);
77 return m_expressionCells[index];
81 void ListController::willDisplayTitleCellAtIndex(
HighlightCell * cell,
int j) {
83 CartesianFunction *
function = ((CartesianFunctionStore *)
m_functionStore)->functionAtIndex(j);
85 myFunctionCell->setText(bufferName);
87 myFunctionCell->
setColor(functionNameColor);
90 void ListController::willDisplayExpressionCellAtIndex(
HighlightCell * cell,
int j) {
99 bool ListController::removeFunctionRow(
Function *
function) {
107 View * ListController::loadView() {
108 for (
int i = 0; i < k_maxNumberOfRows; i++) {
115 void ListController::unloadView(
View * view) {
116 for (
int i = 0; i < k_maxNumberOfRows; i++) {
117 delete m_functionTitleCells[i];
118 m_functionTitleCells[i] =
nullptr;
119 delete m_expressionCells[i];
120 m_expressionCells[i] =
nullptr;
static constexpr KDCoordinate StoreRowHeight
virtual void setContent(const char *c)
static constexpr int maxBufferSize()
static constexpr KDColor GreyDark
size_t strlcpy(char *dst, const char *src, size_t len)
virtual void setColor(KDColor color)
FunctionStore * m_functionStore
virtual Function * functionAtIndex(int i)=0
KDCoordinate rowHeight(int j) override
enum Message uint16_t enum Language uint16_t const char * translate(Message m, Language l=(Language) 0)
virtual int maxNumberOfFunctions()=0
View * loadView() override
constexpr KDColor KDColorBlack
int numberOfRows() override
void setTextColor(KDColor color)
Poincare::ExpressionLayout * layout()
ListController(Responder *parentResponder, FunctionStore *functionStore, ButtonRowController *header, ButtonRowController *footer, I18n::Message text)
void unloadView(View *view) override
const char * title() override
static constexpr KDSize charSize(FontSize size=FontSize::Large)
void setExpression(Poincare::ExpressionLayout *expressionLayout)
virtual char symbol() const =0
virtual void removeFunction(Function *f)=0
constexpr KDCoordinate height() const