Files
Upsilon/apps/graph/list/list_controller.h
Romain Goyet 53cf3e2ead [Escher] Responder can get a pointer to the parent App
We assume the root parent is the App. This works well because each view
controller is a Responder.

Change-Id: I5d90053949a4ffbdb78746cc85430a15138e48e7
2016-08-12 10:12:22 +02:00

35 lines
983 B
C++

#ifndef GRAPH_LIST_CONTROLLER_H
#define GRAPH_LIST_CONTROLLER_H
#include <escher.h>
#include "function_cell.h"
class ListController : public ViewController, public TableViewDataSource {
public:
ListController(Responder * parentResponder);
void setActiveCell(int index);
View * view() override;
const char * title() const override;
bool handleEvent(ion_event_t event) override;
int numberOfCells() override;
void willDisplayCellForIndex(View * cell, int index) override;
KDCoordinate cellHeight() override;
View * reusableCell(int index) override;
int reusableCellCount() override;
private:
constexpr static int k_totalNumberOfModels = 20;
constexpr static int k_maxNumberOfCells = 10;
// !!! CAUTION: The order here is important
// The cells should be initialized *before* the tableview!
FunctionCell m_cells[k_maxNumberOfCells];
TableView m_tableView;
const char ** m_messages;
int m_activeCell;
KDCoordinate m_manualScrolling;
};
#endif