File indexing completed on 2024-05-05 04:39:47
0001 /* 0002 SPDX-FileCopyrightText: 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 SPDX-FileCopyrightText: 2012 Niko Sams <niko.sams@gmai.com> 0007 0008 SPDX-License-Identifier: LGPL-2.0-only 0009 */ 0010 0011 #ifndef KDEVPLATFORM_PLUGIN_BOOKMARKHANDLER_H 0012 #define KDEVPLATFORM_PLUGIN_BOOKMARKHANDLER_H 0013 0014 #include <KBookmarkManager> 0015 #include <KBookmarkMenu> 0016 #include <KBookmarkOwner> 0017 0018 #include <QObject> 0019 0020 class FileManager; 0021 0022 class BookmarkHandler : public QObject, public KBookmarkOwner 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 explicit BookmarkHandler( FileManager *parent, QMenu *kpopupmenu = nullptr ); 0028 ~BookmarkHandler() override; 0029 0030 // KBookmarkOwner interface: 0031 QUrl currentUrl() const override; 0032 QString currentTitle() const override; 0033 0034 QMenu *menu() const 0035 { 0036 return m_menu; 0037 } 0038 void openBookmark( const KBookmark &, Qt::MouseButtons, Qt::KeyboardModifiers ) override; 0039 0040 Q_SIGNALS: 0041 void openUrl( const QUrl& url ); 0042 0043 private: 0044 FileManager *m_parent; 0045 QMenu *m_menu; 0046 KBookmarkMenu *m_bookmarkMenu; 0047 }; 0048 0049 #endif // KDEVPLATFORM_PLUGIN_BOOKMARKHANDLER_H 0050