summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstoolbar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarkstoolbar.hpp')
-rw-r--r--src/bookmarks/bookmarkstoolbar.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/bookmarks/bookmarkstoolbar.hpp b/src/bookmarks/bookmarkstoolbar.hpp
new file mode 100644
index 00000000..6aaa750a
--- /dev/null
+++ b/src/bookmarks/bookmarkstoolbar.hpp
@@ -0,0 +1,58 @@
+/* ============================================================
+ * The rekonq project
+ * ============================================================
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (C) 2008-2013 by Andrea Diamantini <adjam7 at gmail dot com>
+ * Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com>
+ * SPDX-License-Identifier: GPL-3.0-only
+ * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
+ * ============================================================ */
+
+#pragma once
+
+#include "rekonq.hpp"
+#include <QToolBar>
+
+class BookmarksTreeModel;
+
+/**
+ * This class manage the bookmark toolbar.
+ * Some events from the toolbar are handled to allow the drag and drop
+ */
+class BookmarkToolBar : public QToolBar {
+ Q_OBJECT
+
+public:
+ explicit BookmarkToolBar(QWidget *parent = nullptr);
+ ~BookmarkToolBar() override = default;
+
+ void setModel(BookmarksTreeModel *ptr)
+ {
+ Q_CHECK_PTR(ptr);
+ model = ptr;
+ }
+
+signals:
+ void loadUrl(const QUrl &url, rekonq::OpenType type);
+
+protected:
+ void showEvent(QShowEvent *event) override;
+ // bool eventFilter(QObject *watched, QEvent *event);
+
+private slots:
+ // void contextMenu(const QPoint &);
+ // void menuDisplayed();
+ // void menuHidden();
+ // void hideMenu();
+ // void dragDestroyed();
+
+private:
+ BookmarksTreeModel *model = nullptr;
+ void startDrag();
+
+ QPoint m_startDragPos;
+ QAction *m_dragAction = nullptr;
+ QAction *m_dropAction = nullptr;
+ QAction *m_checkedAction = nullptr;
+ bool m_filled = false;
+};