KBookmarks 5.109.0
|
This class provides a bookmark menu. More...
#include <KBookmarkMenu>
Public Slots | |
void | slotBookmarksChanged (const QString &) |
Public Member Functions | |
KBookmarkMenu (KBookmarkManager *manager, KBookmarkOwner *owner, QMenu *parentMenu) | |
Fills a bookmark menu (one instance of KBookmarkMenu is created for the toplevel menu, but also one per submenu). | |
KBookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, const QString &parentAddress) | |
Creates a bookmark submenu. | |
QAction * | addBookmarkAction () const |
Returns the action for adding a bookmark. | |
QAction * | bookmarkTabsAsFolderAction () const |
Returns the action for adding all current tabs as bookmarks. | |
QAction * | editBookmarksAction () const |
Returns the action for editing bookmarks. | |
void | ensureUpToDate () |
Call ensureUpToDate() if you need KBookmarkMenu to adjust to its final size before it is executed. | |
QAction * | newBookmarkFolderAction () const |
Returns the action for adding a new bookmarks folder. | |
int | numberOfOpenTabs () const |
This function returns how many (if any) tabs the application has open. | |
void | setNumberOfOpenTabs (int numberOfOpenTabs) |
Sets the number of currently open tabs. | |
Protected Slots | |
void | slotAboutToShow () |
void | slotAddBookmark () |
void | slotAddBookmarksList () |
void | slotNewFolder () |
void | slotOpenFolderInTabs () |
Protected Member Functions | |
virtual QAction * | actionForBookmark (const KBookmark &bm) |
void | addActions () |
void | addAddBookmark () |
void | addAddBookmarksList () |
void | addEditBookmarks () |
void | addNewFolder () |
void | addOpenInTabs () |
virtual void | clear () |
virtual QMenu * | contextMenu (QAction *action) |
void | fillBookmarks () |
bool | isDirty () const |
bool | isRoot () const |
KBookmarkManager * | manager () const |
KBookmarkOwner * | owner () const |
QString | parentAddress () const |
Parent bookmark for this menu. | |
QMenu * | parentMenu () const |
The menu in which we insert our actions Supplied in the constructor. | |
virtual void | refill () |
Protected Attributes | |
KActionCollection * | m_actionCollection |
QList< QAction * > | m_actions |
List of our actions. | |
QList< KBookmarkMenu * > | m_lstSubMenus |
List of our sub menus. | |
This class provides a bookmark menu.
It is typically used in cooperation with KActionMenu but doesn't have to be.
If you use this class by itself, then it will use KDE defaults for everything – the bookmark path, bookmark editor, bookmark launcher.. everything. These defaults reside in the classes KBookmarkOwner (editing bookmarks) and KBookmarkManager (almost everything else). If you wish to change the defaults in any way, you must reimplement either this class or KBookmarkOwner.
Using this class is very simple:
1) Create a popup menu (either KActionMenu or QMenu will do) 2) Instantiate a new KBookmarkMenu object using the above popup menu as a parameter 3) Insert your (now full) popup menu wherever you wish
The functionality of this class can be disabled with the "action/bookmarks" Kiosk action (see the KAuthorized namespace).
KBookmarkMenu::KBookmarkMenu | ( | KBookmarkManager * | manager, |
KBookmarkOwner * | owner, | ||
QMenu * | parentMenu | ||
) |
Fills a bookmark menu (one instance of KBookmarkMenu is created for the toplevel menu, but also one per submenu).
manager | the bookmark manager to use (i.e. for reading and writing) |
owner | implementation of the KBookmarkOwner callback interface. |
parentMenu | menu to be filled |
KBookmarkMenu::KBookmarkMenu | ( | KBookmarkManager * | mgr, |
KBookmarkOwner * | owner, | ||
QMenu * | parentMenu, | ||
const QString & | parentAddress | ||
) |
Creates a bookmark submenu.
QAction * KBookmarkMenu::addBookmarkAction | ( | ) | const |
Returns the action for adding a bookmark.
If you are using KXmlGui, you can add it to your action collection.
QAction * KBookmarkMenu::bookmarkTabsAsFolderAction | ( | ) | const |
Returns the action for adding all current tabs as bookmarks.
If you are using KXmlGui, you can add it to your action collection.
QAction * KBookmarkMenu::editBookmarksAction | ( | ) | const |
Returns the action for editing bookmarks.
If you are using KXmlGui, you can add it to your action collection.
void KBookmarkMenu::ensureUpToDate | ( | ) |
Call ensureUpToDate() if you need KBookmarkMenu to adjust to its final size before it is executed.
QAction * KBookmarkMenu::newBookmarkFolderAction | ( | ) | const |
Returns the action for adding a new bookmarks folder.
If you are using KXmlGui, you can add it to your action collection.
int KBookmarkMenu::numberOfOpenTabs | ( | ) | const |
This function returns how many (if any) tabs the application has open.
This is used to determine if the Add a folder for all open tabs should be added to the menu, so if the application has more than one tab open, then the menu will be added. Default returns 2
.
|
protected |
Parent bookmark for this menu.
|
protected |
The menu in which we insert our actions Supplied in the constructor.
void KBookmarkMenu::setNumberOfOpenTabs | ( | int | numberOfOpenTabs | ) |
Sets the number of currently open tabs.
numberOfOpenTabs | The number of currently open tabs |
|
protected |
List of our actions.
|
protected |
List of our sub menus.