/* ============================================================ * The rekonq project * ============================================================ * SPDX-License-Identifier: GPL-2.0-or-later * Copyright (C) 2008-2013 by Andrea Diamantini * Copyright (C) 2010 by Yoann Laissus * SPDX-License-Identifier: GPL-3.0-only * Copyright (C) 2022 aqua * ============================================================ */ #pragma once #include "rekonq.hpp" #include 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; };