Files
Upsilon/apps/calculation/history_controller.h
Lionel Debroux 1a8c6b6ae9 [poincare, escher, ion, apps] Split the huge umbrella header poincare.h, to reduce build time.
This should be a NFC, but surprisingly, it also reduces size... so what does it change ?
2018-10-23 11:49:09 +02:00

40 lines
1.5 KiB
C++

#ifndef CALCULATION_HISTORY_CONTROLLER_H
#define CALCULATION_HISTORY_CONTROLLER_H
#include <escher.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 SelectableTableViewDataSource, public SelectableTableViewDelegate {
public:
HistoryController(Responder * parentResponder, CalculationStore * calculationStore);
View * view() override { return &m_selectableTableView; }
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
void willExitResponderChain(Responder * nextFirstResponder) 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;
int typeAtLocation(int i, int j) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
void scrollToCell(int i, int j);
private:
CalculationSelectableTableView * selectableTableView();
constexpr static int k_maxNumberOfDisplayedRows = 5;
CalculationSelectableTableView m_selectableTableView;
HistoryViewCell m_calculationHistory[k_maxNumberOfDisplayedRows];
CalculationStore * m_calculationStore;
};
}
#endif