Blame view

build3/apps/code/script_parameter_controller.h 1.58 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
45
46
47
48
49
  #ifndef CODE_SCRIPT_PARAMETER_CONTROLLER_H
  #define CODE_SCRIPT_PARAMETER_CONTROLLER_H
  
  #include <escher.h>
  #include "../i18n.h"
  #include "script_store.h"
  
  namespace Code {
  
  class MenuController;
  
  class ScriptParameterController : public ViewController, public SimpleListViewDataSource, public SelectableTableViewDataSource {
  public:
    ScriptParameterController(Responder * parentResponder, I18n::Message title,  ScriptStore * scriptStore, MenuController * menuController);
    void setScript(int i);
    void dismissScriptParameterController();
  
    /* ViewController */
    View * view() override { return &m_selectableTableView; }
    const char * title() override;
    bool handleEvent(Ion::Events::Event event) override;
    void viewWillAppear() override;
    void didBecomeFirstResponder() override;
  
    /* SimpleListViewDataSource */
    KDCoordinate cellHeight() override { return Metric::ParameterCellHeight; }
    HighlightCell * reusableCell(int index) override;
    int reusableCellCount() override { return k_totalNumberOfCell; }
    int numberOfRows() override { return k_totalNumberOfCell; }
    void willDisplayCellForIndex(HighlightCell * cell, int index) override;
  
  private:
    constexpr static int k_totalNumberOfCell = 4;
    StackViewController * stackViewController();
    I18n::Message m_pageTitle;
    MessageTableCell m_executeScript;
    MessageTableCell m_renameScript;
    MessageTableCellWithSwitch m_autoImportScript;
    MessageTableCell m_deleteScript;
    SelectableTableView m_selectableTableView;
    ScriptStore * m_scriptStore;
    MenuController * m_menuController;
    bool m_autoImport;
    int m_currentScriptIndex;
  };
  
  }
  
  #endif