Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
main_window.h
Go to the documentation of this file.
1
10#ifndef MAINWINDOW_H
11#define MAINWINDOW_H
12
13#include <epan/prefs.h>
14#include <epan/stat_groups.h>
15#include <epan/frame_data.h>
16
17// frame_data also available with this include in the original wireshark_main_window code
18//#include "follow_stream_dialog.h"
19
20
21#include "capture_file.h"
22#include "filter_action.h"
23#include "io_graph_action.h"
24
25#include <QMainWindow>
26#include <QSplitter>
27
28class QMenu;
29class QSplitter;
30class QStackedWidget;
31
32class ByteViewTab;
35class FunnelAction;
36class MainStatusBar;
37class PacketDiagram;
38class PacketList;
39class ProfileSwitcher;
40class ProtoTree;
41class WelcomePage;
42
43typedef struct _capture_file capture_file;
44
45class MainWindow : public QMainWindow
46{
47 Q_OBJECT
48public:
49 explicit MainWindow(QWidget *parent = nullptr);
51 void setMainWindowTitle(QString title = QString());
52 bool hasSelection();
53 bool hasUniqueSelection();
54 QList<int> selectedRows(bool useFrameNum = false);
55 void insertColumn(QString name, QString abbrev, int pos = -1);
56 void gotoFrame(int packet_num);
57 frame_data* frameDataForRow(int) const;
58
59 QString getFilter();
60 MainStatusBar *statusBar();
61
62 // Used for managing custom packet menus
63 void appendPacketMenu(FunnelAction *funnel_action);
64 QList<QAction*> getPacketMenuActions();
65 void clearAddedPacketMenus();
66 bool addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array);
67
68public slots:
69 void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
70 virtual void filterPackets(QString, bool) = 0;
71 virtual void showPreferencesDialog(QString module_name) = 0;
72 virtual void showIOGraphDialog(io_graph_item_unit_t, QString) = 0;
73 void layoutPanes();
74 void applyRecentPaneGeometry();
75 void updateForUnsavedChanges();
76
77protected:
78 enum CopySelected {
79 CopyAllVisibleItems,
80 CopyAllVisibleSelectedTreeItems,
81 CopySelectedDescription,
82 CopySelectedFieldName,
83 CopySelectedValue,
84 CopyListAsText,
85 CopyListAsCSV,
86 CopyListAsYAML,
87 CopyListAsHTML,
88 };
89
90 void showWelcome();
91 void showCapture();
92 void setTitlebarForCaptureInProgress();
93 virtual void setMenusForCaptureFile(bool force_disable = false) = 0;
94
95 CaptureFile capture_file_;
96 QList<register_stat_group_t> menu_groups_;
97 QWidget* getLayoutWidget(layout_pane_content_e type);
98
99 QStackedWidget *main_stack_;
100 WelcomePage *welcome_page_;
101 QSplitter master_split_;
102 QSplitter extra_split_;
103 QWidget empty_pane_;
104 QVector<unsigned> cur_layout_;
105
106 PacketList *packet_list_;
107 ProtoTree *proto_tree_;
108 ByteViewTab *byte_view_tab_;
109 PacketDiagram *packet_diagram_;
110 DisplayFilterCombo *df_combo_box_;
111 MainStatusBar *main_status_bar_;
112 ProfileSwitcher *profile_switcher_;
113 bool use_capturing_title_;
114
115protected slots:
116 void addDisplayFilterTranslationActions(QMenu *copy_menu);
117 void updateDisplayFilterTranslationActions(const QString &df_text);
118 void updateTitlebar();
119
120private:
121 QString replaceWindowTitleVariables(QString title);
122
123 QVector<QAction *> df_translate_actions_;
124 static const char *translator_;
125 static const char *translated_filter_;
126
127private slots:
128 void copyDisplayFilterTranslation(void);
129
130signals:
131 void setCaptureFile(capture_file *cf);
132 void captureActive(int);
133 void fieldSelected(FieldInformation *);
134 void fieldHighlight(FieldInformation *);
135 void framesSelected(QList<int>);
136 void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
137 void displayFilterSuccess(bool success);
138
139};
140
141#endif // MAINWINDOW_H
Definition byte_view_tab.h:29
Definition capture_file.h:21
Definition display_filter_combo.h:17
Definition field_information.h:23
Definition funnel_statistics.h:67
Definition main_status_bar.h:33
Definition main_window.h:46
Definition packet_diagram.h:26
Definition packet_list.h:40
Definition profile_switcher.h:28
Definition proto_tree.h:27
Definition welcome_page.h:27
Definition cfile.h:67