Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
overlay_scroll_bar.h
1 /* overlay_scroll_bar.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef __OVERLAY_SCROLL_BAR_H__
11 #define __OVERLAY_SCROLL_BAR_H__
12 
13 #include <QScrollBar>
14 #include <QProxyStyle>
15 
16 class OverlayScrollBar : public QScrollBar
17 {
18  Q_OBJECT
19 
20 public:
21  OverlayScrollBar(Qt::Orientation orientation, QWidget * parent = 0);
22  virtual ~OverlayScrollBar();
23 
24  virtual QSize sizeHint() const;
25 
37  void setNearOverlayImage(QImage &overlay_image, int packet_count = -1, int start_pos = -1, int end_pos = -1, int selected_pos = -1);
38 
44  void setMarkedPacketImage(QImage &mp_image);
45 
46 
49  QRect grooveRect();
50 
51 public slots:
52  void setChildRange(int min, int max) { child_sb_.setRange(min, max); }
53 
54 protected:
55  virtual void resizeEvent(QResizeEvent * event);
56  virtual void paintEvent(QPaintEvent * event);
57  virtual bool eventFilter(QObject *watched, QEvent *event);
58  virtual void mousePressEvent(QMouseEvent *) { /* No-op */ }
59  virtual void mouseReleaseEvent(QMouseEvent * event);
60 
61 private:
62  QProxyStyle* style_;
63  QProxyStyle* child_style_;
64  QScrollBar child_sb_;
65  QImage packet_map_img_;
66  QImage marked_packet_img_;
67  int packet_map_width_;
68  int marked_packet_width_;
69  int packet_count_;
70  int start_pos_;
71  int end_pos_;
72  int selected_pos_;
73 
74 };
75 
76 #endif // __OVERLAY_SCROLL_BAR_H__
77 
78 /*
79  * Editor modelines
80  *
81  * Local Variables:
82  * c-basic-offset: 4
83  * tab-width: 8
84  * indent-tabs-mode: nil
85  * End:
86  *
87  * ex: set shiftwidth=4 tabstop=8 expandtab:
88  * :indentSize=4:tabSize=8:noTabs=true:
89  */
void setNearOverlayImage(QImage &overlay_image, int packet_count=-1, int start_pos=-1, int end_pos=-1, int selected_pos=-1)
Definition: overlay_scroll_bar.cpp:98
Definition: overlay_scroll_bar.h:16
void setMarkedPacketImage(QImage &mp_image)
Definition: overlay_scroll_bar.cpp:118
QRect grooveRect()
Definition: overlay_scroll_bar.cpp:129