1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <pfeiffer@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only
6*/
7
8#ifndef KFILEBOOKMARKHANDLER_H
9#define KFILEBOOKMARKHANDLER_H
10
11#include <KBookmarkManager>
12#include <KBookmarkMenu>
13#include <KBookmarkOwner>
14
15class QMenu;
16class KFileWidget;
17
18class KFileBookmarkHandler : public QObject, public KBookmarkOwner
19{
20 Q_OBJECT
21
22public:
23 explicit KFileBookmarkHandler(KFileWidget *widget);
24 ~KFileBookmarkHandler() override;
25
26 QMenu *popupMenu();
27
28 // KBookmarkOwner interface:
29 QString currentTitle() const override;
30 QUrl currentUrl() const override;
31 QString currentIcon() const override;
32
33 QMenu *menu() const
34 {
35 return m_menu;
36 }
37
38public Q_SLOTS:
39 void openBookmark(const KBookmark &bm, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) override;
40
41Q_SIGNALS:
42 void openUrl(const QString &url);
43
44private:
45 void importOldBookmarks(const QString &path, KBookmarkManager *manager);
46
47 KFileWidget *m_widget;
48 QMenu *m_menu;
49 KBookmarkMenu *m_bookmarkMenu;
50 KBookmarkManager *m_bookmarkManager;
51};
52
53#endif // KFILEBOOKMARKHANDLER_H
54

source code of kio/src/filewidgets/kfilebookmarkhandler_p.h