File indexing completed on 2024-04-21 03:55:18

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <pfeiffer@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KFILEBOOKMARKHANDLER_H
0009 #define KFILEBOOKMARKHANDLER_H
0010 
0011 #include <KBookmarkManager>
0012 #include <KBookmarkMenu>
0013 #include <KBookmarkOwner>
0014 
0015 class QMenu;
0016 class KFileWidget;
0017 
0018 class KFileBookmarkHandler : public QObject, public KBookmarkOwner
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit KFileBookmarkHandler(KFileWidget *widget);
0024     ~KFileBookmarkHandler() override;
0025 
0026     QMenu *popupMenu();
0027 
0028     // KBookmarkOwner interface:
0029     QString currentTitle() const override;
0030     QUrl currentUrl() const override;
0031     QString currentIcon() const override;
0032 
0033     QMenu *menu() const
0034     {
0035         return m_menu;
0036     }
0037 
0038 public Q_SLOTS:
0039     void openBookmark(const KBookmark &bm, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) override;
0040 
0041 Q_SIGNALS:
0042     void openUrl(const QString &url);
0043 
0044 private:
0045     void importOldBookmarks(const QString &path, KBookmarkManager *manager);
0046 
0047     KFileWidget *m_widget;
0048     QMenu *m_menu;
0049     KBookmarkMenu *m_bookmarkMenu;
0050     KBookmarkManager *m_bookmarkManager;
0051 };
0052 
0053 #endif // KFILEBOOKMARKHANDLER_H