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 "filter_action.h"
22#include "io_graph_action.h"
23
24#include <QMainWindow>
25#include <QSplitter>
26
27class QMenu;
28class QSplitter;
29class QStackedWidget;
30
31class ByteViewTab;
34class FunnelAction;
35class MainStatusBar;
36class PacketDiagram;
37class PacketList;
38class ProfileSwitcher;
39class ProtoTree;
40class WelcomePage;
41
42typedef struct _capture_file capture_file;
43
44class MainWindow : public QMainWindow
45{
46 Q_OBJECT
47public:
48 explicit MainWindow(QWidget *parent = nullptr);
50 bool hasSelection();
51 bool hasUniqueSelection();
52 QList<int> selectedRows(bool useFrameNum = false);
53 void insertColumn(QString name, QString abbrev, int pos = -1);
54 void gotoFrame(int packet_num);
55 frame_data* frameDataForRow(int) const;
56
57 QString getFilter();
58 MainStatusBar *statusBar();
59
60 // Used for managing custom packet menus
61 void appendPacketMenu(FunnelAction *funnel_action);
62 QList<QAction*> getPacketMenuActions();
63 void clearAddedPacketMenus();
64 bool addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array);
65
66public slots:
67 void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
68 virtual void filterPackets(QString, bool) = 0;
69 virtual void showPreferencesDialog(QString module_name) = 0;
70 virtual void showIOGraphDialog(io_graph_item_unit_t, QString) = 0;
71 void layoutPanes();
72 void applyRecentPaneGeometry();
73
74protected:
75 enum CopySelected {
76 CopyAllVisibleItems,
77 CopyAllVisibleSelectedTreeItems,
78 CopySelectedDescription,
79 CopySelectedFieldName,
80 CopySelectedValue,
81 CopyListAsText,
82 CopyListAsCSV,
83 CopyListAsYAML,
84 CopyListAsHTML,
85 };
86
87 void showWelcome();
88 void showCapture();
89
90 QList<register_stat_group_t> menu_groups_;
91 QWidget* getLayoutWidget(layout_pane_content_e type);
92
93 QStackedWidget *main_stack_;
94 WelcomePage *welcome_page_;
95 QSplitter master_split_;
96 QSplitter extra_split_;
97 QWidget empty_pane_;
98 QVector<unsigned> cur_layout_;
99
100 PacketList *packet_list_;
101 ProtoTree *proto_tree_;
102 ByteViewTab *byte_view_tab_;
103 PacketDiagram *packet_diagram_;
104 DisplayFilterCombo *df_combo_box_;
105 MainStatusBar *main_status_bar_;
106 ProfileSwitcher *profile_switcher_;
107
108protected slots:
109 void addDisplayFilterTranslationActions(QMenu *copy_menu);
110 void updateDisplayFilterTranslationActions(const QString &df_text);
111
112private:
113 QVector<QAction *> df_translate_actions_;
114
115 static const char *translator_;
116 static const char *translated_filter_;
117
118private slots:
119 void copyDisplayFilterTranslation(void);
120
121signals:
122 void setCaptureFile(capture_file *cf);
123 void fieldSelected(FieldInformation *);
124 void framesSelected(QList<int>);
125 void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
126 void displayFilterSuccess(bool success);
127
128};
129
130#endif // MAINWINDOW_H
Definition byte_view_tab.h:29
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:45
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