1 /* show_packet_bytes_dialog.h
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
22 #include "wireshark_dialog.h"
25 #include <QPushButton>
29 class ShowPacketBytesDialog;
30 class ShowPacketBytesTextEdit;
33 class ShowPacketBytesDialog : public WiresharkDialog
38 explicit ShowPacketBytesDialog(QWidget &parent, CaptureFile &cf);
39 ~ShowPacketBytesDialog();
42 void captureFileClosing();
45 bool eventFilter(QObject *obj, QEvent *event);
46 void keyPressEvent(QKeyEvent *event);
49 void on_sbStart_valueChanged(int value);
50 void on_sbEnd_valueChanged(int value);
51 void on_cbDecodeAs_currentIndexChanged(int idx);
52 void on_cbShowAs_currentIndexChanged(int idx);
53 void on_leFind_returnPressed();
54 void on_bFind_clicked();
55 void on_buttonBox_rejected();
57 void showSelected(int start, int end);
58 void useRegexFind(bool use_regex);
59 void findText(bool go_back = true);
70 DecodeAsQuotedPrintable,
75 ShowAsASCIIandControl,
87 void setStartAndEnd(int start, int end);
88 bool enableShowSelected();
89 void updateWidgets(); // Needed for WiresharkDialog?
90 void updateHintLabel();
91 void sanitizeBuffer(QByteArray &ba, bool handle_CR);
92 void symbolizeBuffer(QByteArray &ba);
93 QByteArray decodeQuotedPrintable(const guint8 *bytes, int length);
94 void rot13(QByteArray &ba);
95 void updateFieldBytes(bool initialization = false);
96 void updatePacketBytes();
98 Ui::ShowPacketBytesDialog *ui;
100 const field_info *finfo_;
101 QByteArray field_bytes_;
103 QPushButton *print_button_;
104 QPushButton *copy_button_;
105 QPushButton *save_as_button_;
106 DecodeAsType decode_as_;
108 bool use_regex_find_;
114 class ShowPacketBytesTextEdit : public QTextEdit
119 explicit ShowPacketBytesTextEdit(QWidget *parent = 0) :
120 QTextEdit(parent), show_selected_enabled_(true), menus_enabled_(true) { }
121 ~ShowPacketBytesTextEdit() { }
123 void setShowSelectedEnabled(bool enabled) { show_selected_enabled_ = enabled; }
124 void setMenusEnabled(bool enabled) { menus_enabled_ = enabled; }
127 void showSelected(int, int);
130 void contextMenuEvent(QContextMenuEvent *event);
135 bool show_selected_enabled_;
139 #endif // SHOW_PACKET_BYTES_DIALOG_H
142 * Editor modelines - http://www.wireshark.org/tools/modelines.html
147 * indent-tabs-mode: nil
150 * vi: set shiftwidth=4 tabstop=8 expandtab:
151 * :indentSize=4:tabSize=8:noTabs=true: