Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
base_data_source_view.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <QAbstractScrollArea>
13
14struct tvbuff;
15
16class BaseDataSourceView : public QAbstractScrollArea
17{
18 Q_OBJECT
19public:
20 explicit BaseDataSourceView(const QByteArray &data, QWidget *parent = nullptr) :
21 QAbstractScrollArea(parent),
22 data_(data),
23 tvb_(nullptr),
24 tab_index_(0)
25 {}
26
27 virtual QSize minimumSizeHint() const { return QSize(); }
28
29 virtual bool isEmpty() const { return data_.isEmpty(); }
30
31 struct tvbuff *tvb() const { return tvb_; }
32 void setTvb(struct tvbuff *tvb) { tvb_ = tvb; }
33
34 int tabIndex() const { return tab_index_; }
35 void setTabIndex(int tab_index) { tab_index_ = tab_index; }
36
37signals:
38 void byteHovered(int pos);
39 void byteSelected(int pos);
40
41public slots:
42 virtual void setMonospaceFont(const QFont &mono_font) = 0;
43 virtual void detachData() { data_.detach(); }
44
45 virtual void markProtocol(int start, int length) = 0;
46 virtual void markField(int start, int length, bool scroll_to = true) = 0;
47 virtual void markAppendix(int start, int length) = 0;
48 virtual void unmarkField() = 0;
49
50protected:
51 QByteArray data_;
52
53private:
54 struct tvbuff *tvb_;
55 int tab_index_;
56};
Definition base_data_source_view.h:17
Definition tvbuff-int.h:35