Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
print_dialog.h
Go to the documentation of this file.
1
10#ifndef PRINT_DIALOG_H
11#define PRINT_DIALOG_H
12
13#include <config.h>
14
15#include "file.h"
16
17#include <QDialog>
18#include <QPrinter>
19#include <QPrintPreviewWidget>
20#include <QPushButton>
21
22namespace Ui {
23 class PrintDialog;
24}
25
30class PrintDialog : public QDialog
31{
32 Q_OBJECT
33
34public:
41 explicit PrintDialog(QWidget *parent = 0, capture_file *cf = NULL, QString selRange = QString());
42
47
52 bool printHeader();
53
60 bool printLine(int indent, const char *line);
61
62protected:
67 virtual void keyPressEvent(QKeyEvent *event) override;
68
69private:
70 Ui::PrintDialog *pd_ui_;
72 QPrinter printer_;
73 QPrinter *cur_printer_;
74 QPainter *cur_painter_;
75 QPrintPreviewWidget *preview_;
76 QPushButton *print_bt_;
77 QFont header_font_;
78 QFont packet_font_;
80public:
83private:
84 print_args_t print_args_;
85 print_stream_ops_t stream_ops_;
86 print_stream_t stream_;
87 int page_pos_;
88 bool in_preview_;
95 void printPackets(QPrinter *printer = NULL, bool in_preview = false);
96
97private slots:
102 void paintPreview(QPrinter *printer);
103
108 void checkValidity();
109
111 void on_buttonBox_helpRequested();
112
117 void on_buttonBox_clicked(QAbstractButton *button);
118};
119
120
121#endif // PRINT_DIALOG_H
Dialog that provides packet print and print-preview functionality for a live or saved capture file.
Definition print_dialog.h:31
bool printHeader()
Prints the page header for the current print job.
Definition print_dialog.cpp:139
bool printLine(int indent, const char *line)
Prints a single line of packet data at the given indentation level.
Definition print_dialog.cpp:168
capture_file * cap_file_
Definition print_dialog.h:81
~PrintDialog()
Destroys the Print dialog and releases all associated resources.
Definition print_dialog.cpp:133
virtual void keyPressEvent(QKeyEvent *event) override
Intercepts key press events, e.g. to suppress closing the dialog on Enter.
Definition print_dialog.cpp:210
Represents a capture file and its associated metadata.
Definition cfile.h:84
Aggregates all options controlling a single print or export operation.
Definition file.h:476
Vtable of operations implementing a print stream backend for rendering dissection output.
Definition print_stream.h:31
Represents an abstract print stream, pairing a backend operations vtable with instance-specific state...
Definition print_stream.h:95