Files
Upsilon/apps/calculation/edit_expression_controller.h
Émilie Feral d8179abd77 [apps/calculation] align the historic to the bottom
Change-Id: Ide539c753376ac1fa1cd60ecd3605f112b19f28d
2016-11-04 10:19:05 +01:00

44 lines
1.2 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"
namespace Calculation {
class HistoryController;
class EditExpressionController : public ViewController {
public:
EditExpressionController(Responder * parentResponder, HistoryController * historyController, CalculationStore * calculationStore);
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);
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