Files
Upsilon/apps/shared/list_parameter_controller.h
Émilie Feral af4d6b6e81 [escher] Divide class selectable table view delegate in 2: selectable
table view data source & selectable table view delegate

Change-Id: I90fbd61e271db3754c13bd0069b95c2026de6814
2017-05-18 14:16:41 +02:00

44 lines
1.3 KiB
C++

#ifndef SHARED_LIST_PARAM_CONTROLLER_H
#define SHARED_LIST_PARAM_CONTROLLER_H
#include <escher.h>
#include "function.h"
#include "function_store.h"
#include "../i18n.h"
namespace Shared {
class ListParameterController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDataSource {
public:
ListParameterController(Responder * parentResponder, FunctionStore * functionStore, I18n::Message functionColorMessage, I18n::Message deleteFunctionMessage);
View * view() override;
const char * title() override;
bool handleEvent(Ion::Events::Event event) override;
virtual void setFunction(Function * function);
void didBecomeFirstResponder() override;
int numberOfRows() override;
KDCoordinate cellHeight() override;
HighlightCell * reusableCell(int index) override;
int reusableCellCount() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
protected:
bool handleEnterOnRow(int rowIndex);
SelectableTableView m_selectableTableView;
FunctionStore * m_functionStore;
Function * m_function;
private:
#if FUNCTION_COLOR_CHOICE
constexpr static int k_totalNumberOfCell = 3;
MessageTableCellWithChevron m_colorCell;
#else
constexpr static int k_totalNumberOfCell = 2;
#endif
MessageTableCellWithSwitch m_enableCell;
MessageTableCell m_deleteCell;
};
}
#endif