Numworks Epsilon
1.4.1
Graphing Calculator Operating System
edit_expression_controller.h
Go to the documentation of this file.
1
#ifndef CALCULATION_EDIT_EXPRESSION_CONTROLLER_H
2
#define CALCULATION_EDIT_EXPRESSION_CONTROLLER_H
3
4
#include <
escher.h
>
5
#include "../shared/text_field_delegate.h"
6
#include "
history_controller.h
"
7
#include "
calculation_store.h
"
8
#include "
text_field.h
"
9
10
namespace
Calculation
{
11
class
HistoryController;
12
13
/* TODO: implement a split view */
14
class
EditExpressionController
:
public
DynamicViewController
,
public
Shared::TextFieldDelegate
{
15
public
:
16
EditExpressionController
(
Responder
*
parentResponder
,
HistoryController
* historyController,
CalculationStore
* calculationStore);
17
void
didBecomeFirstResponder
()
override
;
18
void
viewDidDisappear
()
override
;
19
bool
handleEvent
(
Ion::Events::Event
event)
override
;
20
const
char
*
textBody
();
21
void
insertTextBody
(
const
char
* text);
22
bool
textFieldDidReceiveEvent
(::
TextField
* textField,
Ion::Events::Event
event)
override
;
23
bool
textFieldDidFinishEditing
(::
TextField
* textField,
const
char
* text,
Ion::Events::Event
event)
override
;
24
bool
textFieldDidAbortEditing
(::
TextField
* textField,
const
char
* text)
override
;
25
private
:
26
class
ContentView :
public
View
{
27
public
:
28
ContentView(
Responder
*
parentResponder
,
TableView
* subview,
TextFieldDelegate
* textFieldDelegate);
29
int
numberOfSubviews()
const override
;
30
View
* subviewAtIndex(
int
index)
override
;
31
void
layoutSubviews()
override
;
32
TextField
* textField();
33
TableView
* mainView();
34
void
drawRect(
KDContext
* ctx,
KDRect
rect)
const override
;
35
private
:
36
static
constexpr
KDCoordinate
k_textFieldHeight = 37;
37
static
constexpr
KDCoordinate
k_textMargin= 5;
38
constexpr
static
int
k_separatorThickness = 1;
39
TableView
* m_mainView;
40
TextField
m_textField;
41
char
m_textBody[
TextField::maxBufferSize
()];
42
};
43
View
* loadView()
override
;
44
void
unloadView(
View
*
view
)
override
;
45
Shared::TextFieldDelegateApp
* textFieldDelegateApp()
override
;
46
char
m_cacheBuffer[
TextField::maxBufferSize
()];
47
HistoryController
* m_historyController;
48
CalculationStore
* m_calculationStore;
49
};
50
51
}
52
53
#endif
Calculation::EditExpressionController::didBecomeFirstResponder
void didBecomeFirstResponder() override
Definition:
edit_expression_controller.cpp:79
Calculation::EditExpressionController::textBody
const char * textBody()
Definition:
edit_expression_controller.cpp:57
Calculation::HistoryController
Definition:
history_controller.h:14
Calculation::EditExpressionController::textFieldDidFinishEditing
bool textFieldDidFinishEditing(::TextField *textField, const char *text, Ion::Events::Event event) override
Definition:
edit_expression_controller.cpp:102
Calculation::CalculationStore
Definition:
calculation_store.h:8
TextField::maxBufferSize
static constexpr int maxBufferSize()
Definition:
text_field.h:23
KDCoordinate
int16_t KDCoordinate
Definition:
coordinate.h:6
Responder::parentResponder
Responder * parentResponder() const
Definition:
responder.cpp:12
DynamicViewController
Definition:
dynamic_view_controller.h:13
escher.h
Calculation
Definition:
app.cpp:10
TextFieldDelegate
Definition:
text_field_delegate.h:8
Ion::Events::Event
Definition:
events.h:9
Calculation::TextField
Definition:
text_field.h:8
Responder
Definition:
responder.h:9
Calculation::EditExpressionController
Definition:
edit_expression_controller.h:14
Calculation::EditExpressionController::handleEvent
bool handleEvent(Ion::Events::Event event) override
Definition:
edit_expression_controller.cpp:67
TableView
Definition:
table_view.h:9
KDContext
Definition:
context.h:8
Shared::TextFieldDelegateApp
Definition:
text_field_delegate_app.h:12
Calculation::EditExpressionController::insertTextBody
void insertTextBody(const char *text)
Definition:
edit_expression_controller.cpp:61
KDRect
Definition:
rect.h:26
Calculation::EditExpressionController::viewDidDisappear
void viewDidDisappear() override
Definition:
edit_expression_controller.cpp:131
View
Definition:
view.h:23
Calculation::EditExpressionController::textFieldDidAbortEditing
bool textFieldDidAbortEditing(::TextField *textField, const char *text) override
Definition:
edit_expression_controller.cpp:113
history_controller.h
Calculation::EditExpressionController::textFieldDidReceiveEvent
bool textFieldDidReceiveEvent(::TextField *textField, Ion::Events::Event event) override
Definition:
edit_expression_controller.cpp:86
Shared::TextFieldDelegate
Definition:
text_field_delegate.h:10
Calculation::EditExpressionController::EditExpressionController
EditExpressionController(Responder *parentResponder, HistoryController *historyController, CalculationStore *calculationStore)
Definition:
edit_expression_controller.cpp:49
text_field.h
calculation_store.h
DynamicViewController::view
View * view() override
Definition:
dynamic_view_controller.cpp:15
epsilon
apps
calculation
edit_expression_controller.h
Generated by
1.8.14