/* ============================================================ * The rekonq project * ============================================================ * SPDX-License-Identifier: GPL-2.0-or-later * Copyright (C) 2008-2012 by Andrea Diamantini * Copyright (C) 2009 by Paweł Prażak * Copyright (C) 2009-2010 by Lionel Chauvin * Copyright (C) 2010 by Yoann Laissus * SPDX-License-Identifier: GPL-3.0-only * Copyright (C) 2022 aqua * ============================================================ * Description: rekonq bookmarks system interface * ============================================================ */ #pragma once #include "bookmark.hpp" #include "bookmarkstreemodel.hpp" #include "rekonq.hpp" #include class QToolBar; /** * This class represent the interface to the rekonq bookmarks system. It provides bookmarks access to the * Bookmarks Menu and Bookmarks Toolbar. */ class BookmarkManager final : public QObject { Q_OBJECT public: /** * @short Class constructor. * Connect BookmarksProvider with bookmarks source * (actually konqueror's bookmarks). * @param parent The WebWindow to provide bookmarks objects. */ explicit BookmarkManager(const QString &bookmarksFile, QObject *parent = nullptr); ~BookmarkManager() override; /** * Return a list of errors * @return A copy of the error list */ auto errors() { auto e = m_errors; m_errors.clear(); return e; } /** * @short set the Bookmarks Toolbar Action */ void registerBookmarkBar(QToolBar *toolbar) { if (!m_bookmarkToolBars.contains(toolbar)) m_bookmarkToolBars.append(toolbar); } void removeBookmarkBar(QToolBar *toolbar) { m_bookmarkToolBars.removeOne(toolbar); } // QList find(const QString &text); // QList findByUrl(const QUrl &url); // Bookmark bookmarkForUrl(const QUrl &url); // void openFolderInTabs(const BookmarkGroup &group); // QMenu *bookmarkActionMenu(QWidget *parent); public slots: /** * @short Waits for signal that the group with the address has been modified by the caller. * Waits for signal that the group (or any of its children) with the address * @p groupAddress (e.g. "/4/5") has been modified by the caller @p caller. * @param groupAddress bookmark group address * @param caller caller that modified the bookmarks * @see KBookmarkManager::changed */ // void slotBookmarksChanged(); // void fillBookmarkBar(QToolBar *toolBar); // void slotEditBookmarks(); // Bookmark bookmarkCurrentPage(const Bookmark &bookmark = Bookmark()); signals: /** * @short This signal is emitted when a URL has to be loaded */ void openUrl(const QUrl &, rekonq::OpenType); private: QList m_errors; QList m_bookmarkToolBars; BookmarkModel *m_model; };