node_panel.h
Go to the documentation of this file.
1 
28 #ifndef LOG_VIEW_NODE_PANEL_H_
29 #define LOG_VIEW_NODE_PANEL_H_
30 
31 #include <log_view/log_filter.h>
33 
34 namespace log_view {
35 
36 class NodePanel : public PanelInterface {
37  public:
38  NodePanel(int height, int width, int y, int x, LogFilter& filter) : PanelInterface(height, width, y, x), filter_(filter) {}
39  virtual ~NodePanel() {}
40  virtual void refresh();
41  virtual bool handleMouse(const MEVENT& event);
42  virtual bool handleKey(int key);
43 
44  protected:
45  virtual bool canFocus() const { return true; }
46  virtual bool canNavigate() const { return true; }
47  virtual bool canSelect() const { return true; }
48  virtual size_t getContentSize() const { return filter_.nodes().size(); }
49  virtual int getContentHeight() const { return height_ - 2; }
50  virtual int getContentWidth() const;
51  virtual void follow(bool enable);
52  virtual void moveTo(size_t index);
53  virtual void setCursor(int64_t cursor) { cursor_ = cursor; }
54  virtual int64_t getCursor() const { return cursor_; }
55  virtual void select();
56 
57  size_t cursor_ = 0;
58  std::string selected_;
59 
61 };
62 typedef std::shared_ptr<NodePanel> NodePanelPtr;
63 
64 } // namespace log_view
65 
66 #endif // LOG_VIEW_NODE_PANEL_H_
virtual bool canFocus() const
Definition: node_panel.h:45
virtual void setCursor(int64_t cursor)
Definition: node_panel.h:53
virtual bool canSelect() const
Definition: node_panel.h:47
virtual void refresh()
Definition: node_panel.cpp:32
virtual int width() const
LogFilter & filter_
Definition: node_panel.h:60
std::shared_ptr< NodePanel > NodePanelPtr
Definition: node_panel.h:62
NodePanel(int height, int width, int y, int x, LogFilter &filter)
Definition: node_panel.h:38
const std::map< std::string, NodeData > & nodes() const
Definition: log_filter.h:89
virtual ~NodePanel()
Definition: node_panel.h:39
virtual int y() const
virtual size_t getContentSize() const
Definition: node_panel.h:48
virtual void select()
Definition: node_panel.cpp:251
virtual int getContentWidth() const
Definition: node_panel.cpp:243
std::string selected_
Definition: node_panel.h:58
virtual bool handleMouse(const MEVENT &event)
Definition: node_panel.cpp:151
virtual int x() const
virtual int getContentHeight() const
Definition: node_panel.h:49
virtual void moveTo(size_t index)
Definition: node_panel.cpp:193
virtual void follow(bool enable)
Definition: node_panel.cpp:185
virtual bool canNavigate() const
Definition: node_panel.h:46
virtual bool handleKey(int key)
Definition: node_panel.cpp:131
virtual int height() const
virtual int64_t getCursor() const
Definition: node_panel.h:54


log_view
Author(s): Marc Alban
autogenerated on Thu Mar 4 2021 03:21:52