Files
Upsilon/apps/calculation/history_controller.h
Émilie Feral e96732352b [apps/caculation] Use a selectable table view instead of table view in
history controller

Change-Id: I0d7533ba055ed03547a20b3bef7936ed2ea0759f
2016-10-25 17:55:28 +02:00

44 lines
1.3 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"
namespace Calculation {
class App;
class HistoryController : public ViewController, ListViewDataSource {
public:
HistoryController(Responder * parentResponder, CalculationStore * calculationStore);
View * view() override;
const char * title() const override;
bool handleEvent(Ion::Events::Event event) override;
void setFunction(Function * function);
void didBecomeFirstResponder() override;
void reload();
int numberOfRows() override;
TableViewCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
void willDisplayCellForIndex(TableViewCell * 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;
private:
constexpr static int k_maxNumberOfDisplayedRows = 10;
constexpr static int k_defaultCalculationCellWidth = 320;
constexpr static int k_resultWidth = 7*14;
HistoryViewCell m_calculationHistory[k_maxNumberOfDisplayedRows];
SelectableTableView m_selectableTableView;
CalculationStore * m_calculationStore;
};
}
#endif