log_panel.h
Go to the documentation of this file.
1 
28 #ifndef LOG_VIEW_LOG_PANEL_H_
29 #define LOG_VIEW_LOG_PANEL_H_
30 
31 #include <log_view/log_filter.h>
32 #include <log_view/log_store.h>
34 
35 namespace log_view {
36 
37 class LogPanel : public PanelInterface {
38  public:
39  LogPanel(int height, int width, int y, int x, LogStorePtr& logs, LogFilter& filter) : PanelInterface(height, width, y, x), logs_(logs), filter_(filter) {}
40  virtual ~LogPanel() {}
41  virtual void refresh();
42  virtual void selectAll();
43  virtual void startSelect(int row);
44  virtual void endSelect(int row);
45  virtual bool handleMouse(const MEVENT& event);
46  virtual bool handleKey(int key);
47  virtual void resize(int height, int width, int y, int x);
48 
49  protected:
50  virtual bool canNavigate() const { return true; }
51  virtual size_t getContentSize() const { return filter_.indices().size(); }
52  virtual int getContentWidth() const;
53  virtual void setCursor(int64_t cursor) { filter_.setCursor(cursor); }
54  virtual int64_t getCursor() const { return filter_.getCursor(); }
55  virtual void copyToClipboard();
56  std::string getPrefix(const LogEntry& entry, size_t line) const;
57  void printEntry(size_t row, const LogEntry& entry, size_t line, size_t index);
58 
61 
62  bool mouse_down_ = false;
63  bool filled_ = false;
64 };
65 typedef std::shared_ptr<LogPanel> LogPanelPtr;
66 
67 } // namespace log_view
68 
69 #endif // LOG_VIEW_LOG_PANEL_H_
virtual void resize(int height, int width, int y, int x)
Definition: log_panel.cpp:137
LogFilter & filter_
Definition: log_panel.h:60
virtual size_t getContentSize() const
Definition: log_panel.h:51
virtual bool handleKey(int key)
Definition: log_panel.cpp:92
virtual int width() const
void printEntry(size_t row, const LogEntry &entry, size_t line, size_t index)
Definition: log_panel.cpp:230
virtual int getContentWidth() const
Definition: log_panel.cpp:194
virtual void endSelect(int row)
Definition: log_panel.cpp:182
std::shared_ptr< LogStore > LogStorePtr
Definition: log_store.h:55
const std::deque< LogLine > & indices() const
Definition: log_filter.h:88
void setCursor(int64_t index)
Definition: log_filter.cpp:229
virtual void startSelect(int row)
Definition: log_panel.cpp:168
virtual void selectAll()
Definition: log_panel.cpp:142
virtual int y() const
virtual void refresh()
Definition: log_panel.cpp:34
std::string getPrefix(const LogEntry &entry, size_t line) const
Definition: log_panel.cpp:202
virtual int x() const
virtual int64_t getCursor() const
Definition: log_panel.h:54
virtual ~LogPanel()
Definition: log_panel.h:40
virtual void copyToClipboard()
Definition: log_panel.cpp:151
std::shared_ptr< LogPanel > LogPanelPtr
Definition: log_panel.h:65
virtual bool handleMouse(const MEVENT &event)
Definition: log_panel.cpp:107
LogStorePtr logs_
Definition: log_panel.h:59
LogPanel(int height, int width, int y, int x, LogStorePtr &logs, LogFilter &filter)
Definition: log_panel.h:39
virtual int height() const
virtual bool canNavigate() const
Definition: log_panel.h:50
virtual void setCursor(int64_t cursor)
Definition: log_panel.h:53


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