HTTPS (almost) everywhere.
[metze/wireshark/wip.git] / ui / qt / follow_stream_dialog.h
1 /* follow_stream_dialog.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 FOLLOW_STREAM_DIALOG_H
11 #define FOLLOW_STREAM_DIALOG_H
12
13 #include <config.h>
14
15 #include <glib.h>
16
17 #include <stdio.h>
18
19 #ifdef HAVE_UNISTD_H
20 #include <unistd.h>
21 #endif
22
23 #include "file.h"
24
25 #include "epan/follow.h"
26
27 #include "wireshark_dialog.h"
28
29 #include <QFile>
30 #include <QMap>
31 #include <QPushButton>
32
33 namespace Ui {
34 class FollowStreamDialog;
35 }
36
37 class FollowStreamDialog : public WiresharkDialog
38 {
39     Q_OBJECT
40
41 public:
42     explicit FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_type_t type = FOLLOW_TCP);
43     ~FollowStreamDialog();
44
45     bool follow(QString previous_filter = QString(), bool use_stream_index = false, guint stream_num = 0);
46
47 public slots:
48     void captureEvent(CaptureEvent e);
49
50 protected:
51     bool eventFilter(QObject *obj, QEvent *event);
52     void keyPressEvent(QKeyEvent *event);
53
54 private slots:
55     void on_cbCharset_currentIndexChanged(int idx);
56     void on_cbDirections_currentIndexChanged(int idx);
57     void on_bFind_clicked();
58     void on_leFind_returnPressed();
59
60     void helpButton();
61     void backButton();
62     void close();
63     void filterOut();
64     void useRegexFind(bool use_regex);
65     void findText(bool go_back = true);
66     void saveAs();
67     void printStream();
68     void fillHintLabel(int text_pos);
69     void goToPacketForTextPos(int text_pos);
70
71     void on_streamNumberSpinBox_valueChanged(int stream_num);
72
73     void on_buttonBox_rejected();
74
75 signals:
76     void updateFilter(QString filter, bool force);
77     void goToPacket(int packet_num);
78
79 private:
80     void removeStreamControls();
81     void resetStream(void);
82     void updateWidgets(bool follow_in_progress);
83     void updateWidgets() { updateWidgets(false); } // Needed for WiresharkDialog?
84     frs_return_t
85     showBuffer(char *buffer, size_t nchars, gboolean is_from_server,
86                 guint32 packet_num, guint32 *global_pos);
87
88     frs_return_t readStream();
89     frs_return_t readFollowStream();
90     frs_return_t readSslStream();
91
92     void followStream();
93     void addText(QString text, gboolean is_from_server, guint32 packet_num);
94
95     Ui::FollowStreamDialog  *ui;
96
97     QPushButton             *b_filter_out_;
98     QPushButton             *b_find_;
99     QPushButton             *b_print_;
100     QPushButton             *b_save_;
101     QPushButton             *b_back_;
102
103     follow_type_t           follow_type_;
104     follow_info_t           follow_info_;
105     register_follow_t*      follower_;
106     show_type_t             show_type_;
107     QString                 data_out_filename_;
108     static const int        max_document_length_;
109     bool                    truncated_;
110     QString                 previous_filter_;
111     QString                 filter_out_filter_;
112     QString                 output_filter_;
113     int                     client_buffer_count_;
114     int                     server_buffer_count_;
115     int                     client_packet_count_;
116     int                     server_packet_count_;
117     guint32                 last_packet_;
118     gboolean                last_from_server_;
119     int                     turns_;
120     QMap<int,guint32>       text_pos_to_packet_;
121
122     bool                    use_regex_find_;
123
124     bool                    terminating_;
125 };
126
127 #endif // FOLLOW_STREAM_DIALOG_H
128
129 /*
130  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
131  *
132  * Local variables:
133  * c-basic-offset: 4
134  * tab-width: 8
135  * indent-tabs-mode: nil
136  * End:
137  *
138  * vi: set shiftwidth=4 tabstop=8 expandtab:
139  * :indentSize=4:tabSize=8:noTabs=true:
140  */