KBookmarks

konqbookmarkmenu.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1998, 1999 Torben Weis <[email protected]>
4  SPDX-FileCopyrightText: 2006 Daniel Teske <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef __konqbookmarkmenu_h__
10 #define __konqbookmarkmenu_h__
11 
12 #include "kbookmarkactionmenu.h"
13 #include "kbookmarkcontextmenu.h"
14 #include "kbookmarkmenu.h"
15 
16 #if KBOOKMARKS_ENABLE_DEPRECATED_SINCE(5, 0)
17 #include "kbookmarkowner.h" // for SC reasons
18 
19 typedef KBookmarkOwner KonqBookmarkOwner; // KF5: KonqBookmarkOwner is deprecated, use KBookmarkOwner
20 #endif
21 
22 #if KBOOKMARKS_ENABLE_DEPRECATED_SINCE(5, 65)
23 /**
24  * @class KonqBookmarkMenu konqbookmarkmenu.h KonqBookmarkMenu
25  *
26  * Bookmark menu with dynamic import features, only used by Konqueror
27  * @deprecated since 5.65, this class has moved to Konqueror
28  */
29 class KBOOKMARKS_EXPORT KonqBookmarkMenu : public KBookmarkMenu
30 {
31  // friend class KBookmarkBar;
32  Q_OBJECT
33 public:
34  /**
35  * Fills a bookmark menu with konquerors bookmarks
36  * (one instance of KonqBookmarkMenu is created for the toplevel menu,
37  * but also one per submenu).
38  *
39  * @param mgr The bookmark manager to use (i.e. for reading and writing)
40  * @param owner implementation of the KBookmarkOwner callback interface.
41  * Note: If you pass a null KBookmarkOwner to the constructor, the
42  * URLs are opened by QDesktopServices::openUrl and "Add Bookmark" is disabled.
43  * @param parentMenu menu to be filled
44  * @param collec parent collection for the KActions.
45  * @deprecated since 5.65 This class has moved to Konqueror
46  */
47  KBOOKMARKS_DEPRECATED_VERSION(5, 65, "This class has moved to Konqueror")
49  : KBookmarkMenu(mgr, owner, parentMenu->menu(), collec)
50  {
51  }
52  ~KonqBookmarkMenu() override
53  {
54  }
55 
56  /**
57  * Creates a bookmark submenu.
58  * Only used internally and for bookmark toolbar.
59  * @deprecated since 5.65 This class has moved to Konqueror
60  */
61  KBOOKMARKS_DEPRECATED_VERSION(5, 65, "This class has moved to Konqueror")
63  : KBookmarkMenu(mgr, owner, parentMenu->menu(), parentAddress)
64  {
65  }
66 
67 protected:
68  /**
69  * Structure used for storing information about
70  * the dynamic menu setting
71  */
72  struct DynMenuInfo {
73  bool show;
74  QString location;
75  QString type;
76  QString name;
77  class DynMenuInfoPrivate *d;
78  };
79 
80  /**
81  * @return dynmenu info block for the given dynmenu name
82  */
83  static DynMenuInfo showDynamicBookmarks(const QString &id);
84 
85  /**
86  * Shows an extra menu for the given bookmarks file and type.
87  * Upgrades from option inside XBEL to option in rc file
88  * on first call of this function.
89  * @param id the unique identification for the dynamic menu
90  * @param info a DynMenuInfo struct containing the to be added/modified data
91  */
92  static void setDynamicBookmarks(const QString &id, const DynMenuInfo &info);
93 
94  /**
95  * @return list of dynamic menu ids
96  */
97  static QStringList dynamicBookmarksList();
98 
99  void refill() override;
100  QAction *actionForBookmark(const KBookmark &bm) override;
101  QMenu *contextMenu(QAction *action) override;
102  void fillDynamicBookmarks();
103 };
104 
105 /**
106  * Browser-specific context menu
107  * @deprecated since 5.65, this class has moved to Konqueror
108  */
109 class KBOOKMARKS_EXPORT KonqBookmarkContextMenu : public KBookmarkContextMenu
110 {
111  Q_OBJECT
112 public:
113  /**
114  * Browser-specific context menu
115  * @deprecated since 5.65, this class has moved to Konqueror
116  */
117  KBOOKMARKS_DEPRECATED_VERSION(5, 65, "This class has moved to Konqueror")
119  ~KonqBookmarkContextMenu() override;
120  void addActions() override;
121 
122 public Q_SLOTS:
123  void openInNewTab();
124  void openInNewWindow();
125  void toggleShowInToolbar();
126 };
127 
128 #endif
129 
130 #endif
Q_SLOTSQ_SLOTS
Browser-specific context menu.
Structure used for storing information about the dynamic menu setting.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 03:58:02 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.