Files
Upsilon/apps/graph/list/list_controller.h
Romain Goyet 682c3bbc20 App: Move the app in the apps/ folder
Change-Id: I9c6a3eb58c718f1c796652e94534b53a2a302f8b
2016-06-20 18:04:31 +02:00

35 lines
956 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();
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