3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef SHOW_PACKET_BYTES_DIALOG_H
11 #define SHOW_PACKET_BYTES_DIALOG_H
21 #include "wireshark_dialog.h"
24 #include <QPushButton>
29 class ShowPacketBytesDialog
;
30 class ShowPacketBytesTextEdit
;
33 struct uncompress_list_t
{
35 tvbuff_t
*(*function
)(tvbuff_t
*, int, int);
38 class ShowPacketBytesDialog
: public WiresharkDialog
43 explicit ShowPacketBytesDialog(QWidget
&parent
, CaptureFile
&cf
);
44 ~ShowPacketBytesDialog();
46 void addCodecs(const QMap
<QString
, QTextCodec
*> &codecMap
);
49 bool eventFilter(QObject
*obj
, QEvent
*event
);
50 void keyPressEvent(QKeyEvent
*event
);
51 void captureFileClosing();
52 void captureFileClosed();
55 void on_sbStart_valueChanged(int value
);
56 void on_sbEnd_valueChanged(int value
);
57 void on_cbDecodeAs_currentIndexChanged(int idx
);
58 void on_cbShowAs_currentIndexChanged(int idx
);
59 void on_leFind_returnPressed();
60 void on_bFind_clicked();
61 void on_buttonBox_rejected();
63 void showSelected(int start
, int end
);
64 void useRegexFind(bool use_regex
);
65 void findText(bool go_back
= true);
72 void setStartAndEnd(int start
, int end
);
73 bool enableShowSelected();
74 void updateWidgets(); // Needed for WiresharkDialog?
75 void updateHintLabel();
76 void sanitizeBuffer(QByteArray
&ba
, bool handle_CR
);
77 void symbolizeBuffer(QByteArray
&ba
);
78 QByteArray
decodeQuotedPrintable(const uint8_t *bytes
, int length
);
79 void rot13(QByteArray
&ba
);
80 void updateFieldBytes(bool initialization
= false);
81 void updatePacketBytes();
83 Ui::ShowPacketBytesDialog
*ui
;
85 const field_info
*finfo_
;
86 QByteArray field_bytes_
;
88 QString decode_as_name_
;
89 QPushButton
*print_button_
;
90 QPushButton
*copy_button_
;
91 QPushButton
*save_as_button_
;
98 class ShowPacketBytesTextEdit
: public QTextEdit
103 explicit ShowPacketBytesTextEdit(QWidget
*parent
= 0) :
104 QTextEdit(parent
), show_selected_enabled_(true), menus_enabled_(true) { }
105 ~ShowPacketBytesTextEdit() { }
107 void setShowSelectedEnabled(bool enabled
) { show_selected_enabled_
= enabled
; }
108 void setMenusEnabled(bool enabled
) { menus_enabled_
= enabled
; }
111 void showSelected(int, int);
114 void contextMenuEvent(QContextMenuEvent
*event
);
119 bool show_selected_enabled_
;
123 #endif // SHOW_PACKET_BYTES_DIALOG_H