1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1998, 1999 Torben Weis <weis@kde.org>
4 SPDX-FileCopyrightText: 2006 Daniel Teske <teske@squorn.de>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KBOOKMARKCONTEXTMENU_H
10#define KBOOKMARKCONTEXTMENU_H
11
12#include <QMenu>
13
14#include "kbookmark.h"
15#include <kbookmarkswidgets_export.h>
16
17class KBookmarkManager;
18class KBookmarkOwner;
19
20/*!
21 * \class KBookmarkContextMenu
22 * \inmodule KBookmarksWidgets
23 *
24 * \brief A context menu for a bookmark.
25 */
26class KBOOKMARKSWIDGETS_EXPORT KBookmarkContextMenu : public QMenu
27{
28 Q_OBJECT
29
30public:
31 /*!
32 */
33 KBookmarkContextMenu(const KBookmark &bm, KBookmarkManager *manager, KBookmarkOwner *owner, QWidget *parent = nullptr);
34 ~KBookmarkContextMenu() override;
35
36 /*!
37 */
38 virtual void addActions();
39
40 /*!
41 * Set this to true to make any "Edit Bookmarks" dialog
42 * show UI elements that are specific to browsers.
43 *
44 * \since 6.0
45 */
46 void setBrowserMode(bool browserMode);
47
48 /*!
49 * Whether any "Edit Bookmarks" dialog shows UI elements
50 * that are specific to browsers.
51 *
52 * \since 6.0
53 */
54 bool browserMode() const;
55
56public Q_SLOTS:
57 /*!
58 */
59 void slotEditAt();
60
61 /*!
62 */
63 void slotProperties();
64
65 /*!
66 */
67 void slotInsert();
68
69 /*!
70 */
71 void slotRemove();
72
73 /*!
74 */
75 void slotCopyLocation();
76
77 /*!
78 */
79 void slotOpenFolderInTabs();
80
81protected:
82 /*!
83 */
84 void addBookmark();
85
86 /*!
87 */
88 void addFolderActions();
89
90 /*!
91 */
92 void addProperties();
93
94 /*!
95 */
96 void addBookmarkActions();
97
98 /*!
99 */
100 void addOpenFolderInTabs();
101
102 /*!
103 */
104 KBookmarkManager *manager() const;
105
106 /*!
107 */
108 KBookmarkOwner *owner() const;
109
110 /*!
111 */
112 KBookmark bookmark() const;
113
114private Q_SLOTS:
115 KBOOKMARKS_NO_EXPORT void slotAboutToShow();
116
117private:
118 // TODO KF6 dptr it
119 const KBookmark bm;
120 KBookmarkManager *const m_pManager;
121 KBookmarkOwner *const m_pOwner;
122 bool m_browserMode = false;
123};
124
125#endif
126

source code of kbookmarks/src/widgets/kbookmarkcontextmenu.h