history_view_cell.h
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef CALCULATION_HISTORY_VIEW_CELL_H
#define CALCULATION_HISTORY_VIEW_CELL_H
#include <escher.h>
#include "calculation.h"
#include "scrollable_expression_view.h"
#include "../shared/scrollable_exact_approximate_expressions_view.h"
namespace Calculation {
class HistoryViewCell : public ::EvenOddCell, public Responder {
public:
enum class SubviewType {
Input,
Output
};
HistoryViewCell(Responder * parentResponder);
~HistoryViewCell();
void reloadCell() override;
void reloadScroll();
void setEven(bool even) override;
void setHighlighted(bool highlight) override;
Responder * responder() override {
return this;
}
Poincare::ExpressionLayout * expressionLayout() const override;
KDColor backgroundColor() const override;
void setCalculation(Calculation * calculation);
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
void didBecomeFirstResponder() override;
bool handleEvent(Ion::Events::Event event) override;
constexpr static KDCoordinate k_digitVerticalMargin = 5;
SubviewType selectedSubviewType();
void setSelectedSubviewType(HistoryViewCell::SubviewType subviewType);
Shared::ScrollableExactApproximateExpressionsView * outputView();
private:
constexpr static KDCoordinate k_resultWidth = 80;
Poincare::ExpressionLayout * m_inputLayout;
Poincare::ExpressionLayout * m_exactOutputLayout;
Poincare::ExpressionLayout * m_approximateOutputLayout;
ScrollableExpressionView m_inputView;
Shared::ScrollableExactApproximateExpressionsView m_scrollableOutputView;
SubviewType m_selectedSubviewType;
};
}
#endif