Files
Upsilon/apps/calculation/edit_expression_controller.h
Émilie Feral 385161ffd9 [apps/calculation] use the calculation text field in edit expression
controller

Change-Id: Ib4b2665311144b9e26e0b3cf9348a77a35fb79ea
2016-11-04 16:53:08 +01:00

45 lines
1.3 KiB
C++

#ifndef CALCULATION_EDIT_EXPRESSION_CONTROLLER_H
#define CALCULATION_EDIT_EXPRESSION_CONTROLLER_H
#include <escher.h>
#include "history_controller.h"
#include "calculation_store.h"
#include "text_field.h"
namespace Calculation {
class HistoryController;
class EditExpressionController : public ViewController {
public:
EditExpressionController(Responder * parentResponder, HistoryController * historyController, CalculationStore * calculationStore, TextFieldDelegate * textFieldDelegate);
View * view() override;
const char * title() const override;
void didBecomeFirstResponder() override;
bool handleEvent(Ion::Events::Event event) override;
void edit(const char * initialContent);
const char * textBody();
void setTextBody(const char * text);
private:
class ContentView : public View {
public:
ContentView(TableView * subview, TextFieldDelegate * textFieldDelegate);
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
TextField * textField();
TableView * mainView();
private:
static constexpr KDCoordinate k_textFieldHeight = 20;
TableView * m_mainView;
TextField m_textField;
char m_textBody[255];
};
ContentView m_contentView;
HistoryController * m_historyController;
CalculationStore * m_calculationStore;
};
}
#endif