Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / main_window.h
blobc6c2c9ba016fa369b3ad694dd137547cf2bd6764
1 /** @file
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
8 */
10 #ifndef MAINWINDOW_H
11 #define MAINWINDOW_H
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>
25 #include <QSplitter>
27 class QMenu;
28 class QSplitter;
29 class QStackedWidget;
31 class ByteViewTab;
32 class DisplayFilterCombo;
33 class FieldInformation;
34 class FunnelAction;
35 class MainStatusBar;
36 class PacketDiagram;
37 class PacketList;
38 class ProfileSwitcher;
39 class ProtoTree;
40 class WelcomePage;
42 typedef struct _capture_file capture_file;
44 class MainWindow : public QMainWindow
46 Q_OBJECT
47 public:
48 explicit MainWindow(QWidget *parent = nullptr);
49 ~MainWindow();
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;
57 QString getFilter();
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);
66 public 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();
74 protected:
75 enum CopySelected {
76 CopyAllVisibleItems,
77 CopyAllVisibleSelectedTreeItems,
78 CopySelectedDescription,
79 CopySelectedFieldName,
80 CopySelectedValue,
81 CopyListAsText,
82 CopyListAsCSV,
83 CopyListAsYAML,
84 CopyListAsHTML,
87 void showWelcome();
88 void showCapture();
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_;
97 QWidget empty_pane_;
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_;
108 protected slots:
109 void addDisplayFilterTranslationActions(QMenu *copy_menu);
110 void updateDisplayFilterTranslationActions(const QString &df_text);
112 private:
113 QVector<QAction *> df_translate_actions_;
115 static const char *translator_;
116 static const char *translated_filter_;
118 private slots:
119 void copyDisplayFilterTranslation(void);
121 signals:
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