Files
Upsilon/apps/calculation/history_controller.h
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

42 lines
1.4 KiB
C++

#ifndef CALCULATION_HISTORY_CONTROLLER_H
#define CALCULATION_HISTORY_CONTROLLER_H
#include <escher.h>
#include <poincare.h>
#include "history_view_cell.h"
#include "calculation_store.h"
#include "selectable_table_view.h"
namespace Calculation {
class App;
class HistoryController : public ViewController, public ListViewDataSource, public SelectableTableViewDelegate {
public:
HistoryController(Responder * parentResponder, CalculationStore * calculationStore);
View * view() override;
const char * title() const override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
void reload();
int numberOfRows() override;
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
KDCoordinate rowHeight(int j) override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
int typeAtLocation(int i, int j) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
private:
constexpr static int k_maxNumberOfDisplayedRows = 10;
HistoryViewCell m_calculationHistory[k_maxNumberOfDisplayedRows];
CalculationSelectableTableView m_selectableTableView;
CalculationStore * m_calculationStore;
};
}
#endif