summaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/drag_drop_toolbar.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /ui/qt/widgets/drag_drop_toolbar.h
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ui/qt/widgets/drag_drop_toolbar.h')
-rw-r--r--ui/qt/widgets/drag_drop_toolbar.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/ui/qt/widgets/drag_drop_toolbar.h b/ui/qt/widgets/drag_drop_toolbar.h
new file mode 100644
index 00000000..c2937d0f
--- /dev/null
+++ b/ui/qt/widgets/drag_drop_toolbar.h
@@ -0,0 +1,54 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef DRAG_DROP_TOOLBAR_H
+#define DRAG_DROP_TOOLBAR_H
+
+#include <QToolBar>
+#include <QPoint>
+
+class WiresharkMimeData;
+
+class DragDropToolBar : public QToolBar
+{
+ Q_OBJECT
+public:
+ explicit DragDropToolBar(const QString &title, QWidget *parent = Q_NULLPTR);
+ explicit DragDropToolBar(QWidget *parent = Q_NULLPTR);
+ ~DragDropToolBar();
+
+ virtual void clear();
+
+signals:
+ void actionMoved(QAction * action, int oldPos, int newPos);
+
+ void newFilterDropped(QString description, QString filter);
+
+protected:
+
+ virtual WiresharkMimeData * createMimeData(QString name, int position);
+
+ virtual void childEvent(QChildEvent * event);
+
+ virtual bool eventFilter(QObject * obj, QEvent * ev);
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dragMoveEvent(QDragMoveEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+
+private:
+
+ QPoint dragStartPosition;
+ int childCounter;
+
+ void setupToolbar();
+ void moveToolbarItems(int fromPos, int toPos);
+
+};
+
+#endif // DRAG_DROP_TOOLBAR_H