From e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:34:10 +0200 Subject: Adding upstream version 4.2.2. Signed-off-by: Daniel Baumann --- ui/qt/main_window.h | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 ui/qt/main_window.h (limited to 'ui/qt/main_window.h') diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h new file mode 100644 index 00000000..ac5ddcf4 --- /dev/null +++ b/ui/qt/main_window.h @@ -0,0 +1,109 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include + +// frame_data also available with this include in the original wireshark_main_window code +//#include "follow_stream_dialog.h" + + +#include "filter_action.h" + +#include +#include + +class QSplitter; +class QStackedWidget; +class ByteViewTab; +class DisplayFilterCombo; +class FieldInformation; +class MainStatusBar; +class PacketDiagram; +class PacketList; +class ProtoTree; +class WelcomePage; + +typedef struct _capture_file capture_file; + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + bool hasSelection(); + bool hasUniqueSelection(); + QList selectedRows(bool useFrameNum = false); + void insertColumn(QString name, QString abbrev, gint pos = -1); + void gotoFrame(int packet_num); + frame_data* frameDataForRow(int) const; + + QString getFilter(); + MainStatusBar *statusBar(); + + // Used for managing custom packet menus + void appendPacketMenu(QAction* funnel_action); + QList getPacketMenuActions(); + void clearAddedPacketMenus(); + bool addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array); + +public slots: + void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType); + virtual void filterPackets(QString, bool) = 0; + virtual void showPreferencesDialog(QString module_name) = 0; + void layoutPanes(); + void applyRecentPaneGeometry(); + +protected: + enum CopySelected { + CopyAllVisibleItems, + CopyAllVisibleSelectedTreeItems, + CopySelectedDescription, + CopySelectedFieldName, + CopySelectedValue, + CopyListAsText, + CopyListAsCSV, + CopyListAsYAML + }; + + void showWelcome(); + void showCapture(); + + QList menu_groups_; + QWidget* getLayoutWidget(layout_pane_content_e type); + + QStackedWidget *main_stack_; + WelcomePage *welcome_page_; + QSplitter master_split_; + QSplitter extra_split_; + QWidget empty_pane_; + QVector cur_layout_; + + PacketList *packet_list_; + ProtoTree *proto_tree_; + ByteViewTab *byte_view_tab_; + PacketDiagram *packet_diagram_; + DisplayFilterCombo *df_combo_box_; + MainStatusBar *main_status_bar_; + +signals: + void setCaptureFile(capture_file *cf); + void fieldSelected(FieldInformation *); + void framesSelected(QList); + void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type); + void displayFilterSuccess(bool success); + +}; + +#endif // MAINWINDOW_H -- cgit v1.2.3