summaryrefslogtreecommitdiffstats
path: root/ui/qt/utils/profile_switcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/utils/profile_switcher.h')
-rw-r--r--ui/qt/utils/profile_switcher.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/ui/qt/utils/profile_switcher.h b/ui/qt/utils/profile_switcher.h
new file mode 100644
index 00000000..57dfd255
--- /dev/null
+++ b/ui/qt/utils/profile_switcher.h
@@ -0,0 +1,48 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#pragma once
+
+#include <config.h>
+
+#include "capture_event.h"
+#include "cfile.h"
+
+#include <QObject>
+#include <QVector>
+
+struct profile_switch_filter {
+ QString name;
+ dfilter_t *dfcode;
+};
+
+class PacketListModel;
+
+class ProfileSwitcher : public QObject
+{
+ Q_OBJECT
+public:
+ explicit ProfileSwitcher(QObject *parent = nullptr);
+
+public slots:
+ void captureEventHandler(CaptureEvent ev);
+ void checkPacket(capture_file *cap_file, frame_data *fdata, qsizetype row);
+
+private:
+ PacketListModel *packet_list_model_;
+ QVector<struct profile_switch_filter> profile_filters_;
+ bool capture_file_changed_;
+ bool profile_changed_;
+ QString previous_cap_file_;
+
+ void clearProfileFilters();
+
+private slots:
+ void disableSwitching();
+};