KBookmarks

kbookmarkmenu.h
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 Torben Weis <[email protected]>
3  Copyright (C) 2006 Daniel Teske <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __kbookmarkmenu_h__
22 #define __kbookmarkmenu_h__
23 
24 #include <kbookmarks_export.h>
25 
26 #include <QObject>
27 
28 class QAction;
29 class QMenu;
30 class KBookmark;
31 class KActionCollection;
32 class KBookmarkManager;
33 class KBookmarkOwner;
34 class KBookmarkMenu;
35 class KBookmarkActionInterface;
36 
37 class KBookmarkMenuPrivate; // Not implemented
38 
60 class KBOOKMARKS_EXPORT KBookmarkMenu : public QObject
61 {
62  Q_OBJECT
63 public:
64 #if KBOOKMARKS_ENABLE_DEPRECATED_SINCE(5, 69)
65 
105  KBOOKMARKS_DEPRECATED_VERSION(5, 69, "Use overload without KActionCollection and add actions manually to your actionCollection if desired")
106  KBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collec);
107 #endif
108 
121  KBookmarkMenu(KBookmarkManager *manager, KBookmarkOwner *owner, QMenu *parentMenu);
122 
130  QMenu *parentMenu, const QString &parentAddress);
131 
132  ~KBookmarkMenu();
133 
138  void ensureUpToDate();
139 
146  void setNumberOfOpenTabs(int numberOfOpenTabs);
155  int numberOfOpenTabs() const;
156 
168  QAction *addBookmarkAction() const;
169 
181  QAction *bookmarkTabsAsFolderAction() const;
182 
194  QAction *newBookmarkFolderAction() const;
195 
207  QAction *editBookmarksAction() const;
208 
209 public Q_SLOTS:
210  // public for KonqBookmarkBar
211  void slotBookmarksChanged(const QString &);
212 
213 protected Q_SLOTS:
214  void slotAboutToShow();
215  void slotAddBookmarksList();
216  void slotAddBookmark();
217  void slotNewFolder();
218  void slotOpenFolderInTabs();
219 
220 protected:
221  virtual void clear();
222  virtual void refill();
223  virtual QAction *actionForBookmark(const KBookmark &bm);
224  virtual QMenu *contextMenu(QAction *action);
225 
226  void addActions();
227  void fillBookmarks();
228  void addAddBookmark();
229  void addAddBookmarksList();
230  void addEditBookmarks();
231  void addNewFolder();
232  void addOpenInTabs();
233 
234  bool isRoot() const;
235  bool isDirty() const;
236 
240  QString parentAddress() const;
241 
242  KBookmarkManager *manager() const;
243  KBookmarkOwner *owner() const;
248  QMenu *parentMenu() const;
249 
254 
255  // This is used to "export" our actions into an actionlist
256  // we got in the constructor. So that the program can show our
257  // actions in their shortcut dialog
258  KActionCollection *m_actionCollection;
263 
264 private Q_SLOTS:
265  void slotCustomContextMenu(const QPoint &);
266 
267 private:
268  void init();
269 
270  KBookmarkMenuPrivate *d;
271 
272  bool m_bIsRoot;
273  bool m_bDirty;
274  KBookmarkManager *m_pManager;
275  KBookmarkOwner *m_pOwner;
276  QMenu *m_parentMenu;
277  QString m_parentAddress;
278 };
279 
280 #endif
QList< KBookmarkMenu * > m_lstSubMenus
List of our sub menus.
This class implements the reading/writing of bookmarks in XML.
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
QList< QAction * > m_actions
List of our actions.
QCA_EXPORT void init()
This class provides a bookmark menu.
Definition: kbookmarkmenu.h:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 1 2020 22:38:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.