Numworks Epsilon  1.4.1
Graphing Calculator Operating System
script_node_cell.h
Go to the documentation of this file.
1 #ifndef CODE_SCRIPT_NODE_CELL_H
2 #define CODE_SCRIPT_NODE_CELL_H
3 
4 #include "script_node.h"
5 #include "script_store.h"
6 #include <escher/table_cell.h>
7 #include <kandinsky/coordinate.h>
8 
9 namespace Code {
10 
11 class ScriptNodeCell : public TableCell {
12 public:
14  void setScriptNode(ScriptNode * node);
15  void setScriptStore(ScriptStore * scriptStore);
16 
17  /* TableCell */
18  View * labelView() const override { return const_cast<View *>(static_cast<const View *>(&m_scriptNodeView)); }
19 
20  /* HighlightCell */
21  void setHighlighted(bool highlight) override;
22  void reloadCell() override;
23 
24  constexpr static char k_parentheses[] = "()";
25 protected:
26  class ScriptNodeView : public HighlightCell {
27  public:
29  void setScriptNode(ScriptNode * scriptNode);
30  void setScriptStore(ScriptStore * scriptStore);
31  void drawRect(KDContext * ctx, KDRect rect) const override;
32  virtual KDSize minimalSizeForOptimalDisplay() const override;
33  private:
34  constexpr static KDText::FontSize k_fontSize = KDText::FontSize::Small;
35  constexpr static KDCoordinate k_verticalMargin = 7;
36  ScriptNode * m_scriptNode;
37  ScriptStore * m_scriptStore;
38  };
40 };
41 
42 }
43 
44 #endif
void setHighlighted(bool highlight) override
void reloadCell() override
int16_t KDCoordinate
Definition: coordinate.h:6
void setScriptNode(ScriptNode *node)
void drawRect(KDContext *ctx, KDRect rect) const override
void setScriptNode(ScriptNode *scriptNode)
Definition: size.h:6
Definition: app.cpp:7
ScriptNodeView m_scriptNodeView
static constexpr char k_parentheses[]
void setScriptStore(ScriptStore *scriptStore)
Definition: rect.h:26
Definition: view.h:23
void setScriptStore(ScriptStore *scriptStore)
virtual KDSize minimalSizeForOptimalDisplay() const override
FontSize
Definition: text.h:10
View * labelView() const override