File indexing completed on 2024-05-05 05:51:23

0001 /* This file is part of the KDE project
0002    Copyright (C) xxxx KFile Authors
0003    SPDX-FileCopyrightText: 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
0004    SPDX-FileCopyrightText: 2007 Mirko Stocker <me@misto.ch>
0005    SPDX-FileCopyrightText: 2009 Dominik Haumann <dhaumann kde org>
0006 
0007    SPDX-License-Identifier: LGPL-2.0-only
0008 */
0009 
0010 #pragma once
0011 
0012 #include <KBookmarkMenu>
0013 #include <KBookmarkOwner>
0014 
0015 class KateFileBrowser;
0016 class QMenu;
0017 
0018 class KateBookmarkHandler : public QObject, public KBookmarkOwner
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit KateBookmarkHandler(KateFileBrowser *parent, QMenu *kpopupmenu = nullptr);
0024     ~KateBookmarkHandler() override;
0025 
0026     // KBookmarkOwner interface:
0027     QUrl currentUrl() const override;
0028     QString currentTitle() const override;
0029 
0030     QMenu *menu() const
0031     {
0032         return m_menu;
0033     }
0034     void openBookmark(const KBookmark &, Qt::MouseButtons, Qt::KeyboardModifiers) override;
0035 
0036 Q_SIGNALS:
0037     void openUrl(const QString &url);
0038 
0039 private:
0040     KateFileBrowser *mParent;
0041     QMenu *m_menu;
0042     KBookmarkMenu *m_bookmarkMenu;
0043 };