Blame view

build3/apps/shared/list_parameter_controller.h 1.41 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  #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, SelectableTableViewDelegate * tableDelegate = nullptr);
  
    View * view() override;
    const char * title() override;
    bool handleEvent(Ion::Events::Event event) override;
    virtual void setFunction(Function * function);
    void didBecomeFirstResponder() override;
    void viewWillAppear() 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