2021-11-30 13:01:36 +00:00
|
|
|
/** @file
|
2012-01-04 22:13:01 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-07 11:26:45 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2012-01-04 22:13:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2013-09-03 16:06:20 +00:00
|
|
|
#include <epan/prefs.h>
|
2022-04-11 22:23:29 +00:00
|
|
|
#include <epan/stat_groups.h>
|
2022-11-01 10:01:35 +00:00
|
|
|
#include <epan/frame_data.h>
|
|
|
|
|
|
|
|
// frame_data also available with this include in the original wireshark_main_window code
|
|
|
|
//#include "follow_stream_dialog.h"
|
|
|
|
|
2013-09-03 16:06:20 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
#include "filter_action.h"
|
2012-08-31 22:25:51 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QSplitter>
|
2015-02-11 23:00:27 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
class QSplitter;
|
|
|
|
class QStackedWidget;
|
2015-02-11 23:00:27 +00:00
|
|
|
class ByteViewTab;
|
2022-02-10 23:11:43 +00:00
|
|
|
class DisplayFilterCombo;
|
|
|
|
class FieldInformation;
|
|
|
|
class MainStatusBar;
|
2020-05-05 18:58:52 +00:00
|
|
|
class PacketDiagram;
|
2015-02-11 23:00:27 +00:00
|
|
|
class PacketList;
|
|
|
|
class ProtoTree;
|
2022-02-10 23:11:43 +00:00
|
|
|
class WelcomePage;
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
typedef struct _capture_file capture_file;
|
2017-01-11 12:55:23 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-02-10 23:11:43 +00:00
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
2020-12-27 04:15:24 +00:00
|
|
|
~MainWindow();
|
2019-11-20 15:34:18 +00:00
|
|
|
bool hasSelection();
|
2023-04-05 16:36:40 +00:00
|
|
|
bool hasUniqueSelection();
|
2019-11-12 15:39:19 +00:00
|
|
|
QList<int> selectedRows(bool useFrameNum = false);
|
2022-02-10 23:11:43 +00:00
|
|
|
void insertColumn(QString name, QString abbrev, gint pos = -1);
|
|
|
|
void gotoFrame(int packet_num);
|
2022-11-01 10:01:35 +00:00
|
|
|
frame_data* frameDataForRow(int) const;
|
2019-11-12 15:39:19 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
QString getFilter();
|
|
|
|
MainStatusBar *statusBar();
|
2012-01-04 22:13:01 +00:00
|
|
|
|
2020-12-27 04:15:24 +00:00
|
|
|
// Used for managing custom packet menus
|
|
|
|
void appendPacketMenu(QAction* funnel_action);
|
|
|
|
QList<QAction*> getPacketMenuActions();
|
|
|
|
void clearAddedPacketMenus();
|
|
|
|
bool addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array);
|
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
public slots:
|
|
|
|
void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
|
2022-12-04 22:21:39 +00:00
|
|
|
virtual void filterPackets(QString, bool) = 0;
|
|
|
|
virtual void showPreferencesDialog(QString module_name) = 0;
|
2022-02-10 23:11:43 +00:00
|
|
|
void layoutPanes();
|
|
|
|
void applyRecentPaneGeometry();
|
2012-12-07 01:46:20 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
protected:
|
2022-09-22 22:35:04 +00:00
|
|
|
enum CopySelected {
|
|
|
|
CopyAllVisibleItems,
|
|
|
|
CopyAllVisibleSelectedTreeItems,
|
|
|
|
CopySelectedDescription,
|
|
|
|
CopySelectedFieldName,
|
|
|
|
CopySelectedValue,
|
|
|
|
CopyListAsText,
|
|
|
|
CopyListAsCSV,
|
|
|
|
CopyListAsYAML
|
|
|
|
};
|
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
void showWelcome();
|
|
|
|
void showCapture();
|
2012-12-07 01:46:20 +00:00
|
|
|
|
2022-04-11 22:23:29 +00:00
|
|
|
QList<register_stat_group_t> menu_groups_;
|
2022-02-10 23:11:43 +00:00
|
|
|
QWidget* getLayoutWidget(layout_pane_content_e type);
|
2016-01-11 09:46:02 +00:00
|
|
|
|
2022-02-10 23:11:43 +00:00
|
|
|
QStackedWidget *main_stack_;
|
|
|
|
WelcomePage *welcome_page_;
|
2013-10-05 22:39:49 +00:00
|
|
|
QSplitter master_split_;
|
|
|
|
QSplitter extra_split_;
|
2022-02-10 23:11:43 +00:00
|
|
|
QWidget empty_pane_;
|
2015-02-06 18:36:27 +00:00
|
|
|
QVector<unsigned> cur_layout_;
|
2022-02-10 23:11:43 +00:00
|
|
|
|
2012-08-17 00:58:50 +00:00
|
|
|
PacketList *packet_list_;
|
2012-12-07 01:46:20 +00:00
|
|
|
ProtoTree *proto_tree_;
|
2020-05-05 18:58:52 +00:00
|
|
|
ByteViewTab *byte_view_tab_;
|
|
|
|
PacketDiagram *packet_diagram_;
|
2022-02-10 23:11:43 +00:00
|
|
|
DisplayFilterCombo *df_combo_box_;
|
|
|
|
MainStatusBar *main_status_bar_;
|
2015-08-11 12:08:08 +00:00
|
|
|
|
2012-07-19 21:49:52 +00:00
|
|
|
signals:
|
2012-10-30 19:21:24 +00:00
|
|
|
void setCaptureFile(capture_file *cf);
|
2017-10-30 12:58:28 +00:00
|
|
|
void fieldSelected(FieldInformation *);
|
2019-11-21 09:50:41 +00:00
|
|
|
void framesSelected(QList<int>);
|
2022-02-10 23:11:43 +00:00
|
|
|
void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
|
2022-12-04 22:21:39 +00:00
|
|
|
void displayFilterSuccess(bool success);
|
2019-11-21 09:50:41 +00:00
|
|
|
|
2013-11-21 01:28:17 +00:00
|
|
|
};
|
2014-01-02 17:04:10 +00:00
|
|
|
|
2012-01-04 22:13:01 +00:00
|
|
|
#endif // MAINWINDOW_H
|