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
13 #include <epan/prefs.h>
14 #include <epan/stat_groups.h>
15 #include <epan/frame_data.h>
17 // frame_data also available with this include in the original wireshark_main_window code
18 //#include "follow_stream_dialog.h"
21 #include "filter_action.h"
22 #include "io_graph_action.h"
24 #include <QMainWindow>
32 class DisplayFilterCombo
;
33 class FieldInformation
;
38 class ProfileSwitcher
;
42 typedef struct _capture_file capture_file
;
44 class MainWindow
: public QMainWindow
48 explicit MainWindow(QWidget
*parent
= nullptr);
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;
58 MainStatusBar
*statusBar();
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
);
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;
72 void applyRecentPaneGeometry();
77 CopyAllVisibleSelectedTreeItems
,
78 CopySelectedDescription
,
79 CopySelectedFieldName
,
90 QList
<register_stat_group_t
> menu_groups_
;
91 QWidget
* getLayoutWidget(layout_pane_content_e type
);
93 QStackedWidget
*main_stack_
;
94 WelcomePage
*welcome_page_
;
95 QSplitter master_split_
;
96 QSplitter extra_split_
;
98 QVector
<unsigned> cur_layout_
;
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_
;
109 void addDisplayFilterTranslationActions(QMenu
*copy_menu
);
110 void updateDisplayFilterTranslationActions(const QString
&df_text
);
113 QVector
<QAction
*> df_translate_actions_
;
115 static const char *translator_
;
116 static const char *translated_filter_
;
119 void copyDisplayFilterTranslation(void);
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
);
130 #endif // MAINWINDOW_H