Files
Upsilon/apps/graph/list/list_controller.h
Émilie Feral 844d6f848e [apps/graph/list] clean the list controller (handle parameter controller)
Change-Id: I7c8e976ebcceb7071e0f57348af4b07203d35adb
2016-09-16 17:27:06 +02:00

42 lines
1.2 KiB
C++

#ifndef GRAPH_LIST_CONTROLLER_H
#define GRAPH_LIST_CONTROLLER_H
#include <escher.h>
#include "../function_store.h"
#include "function_cell.h"
#include "parameter_controller.h"
class ListController : public ViewController, public TableViewDataSource {
public:
ListController(Responder * parentResponder, Graph::FunctionStore * functionStore);
void setActiveCell(int index);
View * view() override;
const char * title() const override;
bool handleEvent(Ion::Events::Event event) override;
int numberOfCells() override;
void willDisplayCellForIndex(View * cell, int index) override;
KDCoordinate cellHeight() override;
View * reusableCell(int index) override;
int reusableCellCount() override;
void configureFunction(Graph::Function * function);
private:
Responder * tabController() const;
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;
int m_activeCell;
KDCoordinate m_manualScrolling;
Graph::FunctionStore * m_functionStore;
ParameterController m_parameterController;
};
#endif