KBookmarks 5.109.0
kbookmarkowner.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2000, 2006 David Faure <faure@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only
6*/
7#ifndef KBOOKMARK_OWNER_H
8#define KBOOKMARK_OWNER_H
9
10#include "kbookmark.h"
11
12#include <QSharedDataPointer>
13#include <QString>
14
15class QWidget;
16
17class KBookmarkGroup;
18class KBookmarkDialog;
19
43class KBOOKMARKS_EXPORT KBookmarkOwner
44{
45public:
46 // TODO KF6: add non-inline constructor, de-inline destructor. Otherwise the d pointer cannot be used.
47 virtual ~KBookmarkOwner()
48 {
49 }
50
60 virtual QString currentTitle() const
61 {
62 return QString();
63 }
64
75 virtual QUrl currentUrl() const
76 {
77 return QUrl();
78 }
79
93 virtual QString currentIcon() const
94 {
95 return QString();
96 }
97
102 virtual bool supportsTabs() const
103 {
104 return false;
105 }
106
107 class FutureBookmarkPrivate;
112 class KBOOKMARKS_EXPORT FutureBookmark
113 {
114 public:
115 FutureBookmark(const QString &title, const QUrl &url, const QString &icon);
117 FutureBookmark(const FutureBookmark &other);
118 FutureBookmark &operator=(const FutureBookmark &other);
119
120 QString title() const;
121 QUrl url() const;
122 QString icon() const;
123
124 private:
125 QSharedDataPointer<FutureBookmarkPrivate> d;
126 };
127
132 virtual QList<FutureBookmark> currentBookmarkList() const
133 {
134 return QList<FutureBookmark>();
135 }
136
137 enum BookmarkOption { ShowAddBookmark, ShowEditBookmark };
138
145 virtual bool enableOption(BookmarkOption option) const;
146
150 virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) = 0;
151
157 virtual void openFolderinTabs(const KBookmarkGroup &bm);
158
159 virtual KBookmarkDialog *bookmarkDialog(KBookmarkManager *mgr, QWidget *parent);
160
166 virtual void openInNewTab(const KBookmark &bm);
167
173 virtual void openInNewWindow(const KBookmark &bm);
174
175private:
176 class KBookmarkOwnerPrivate;
177 KBookmarkOwnerPrivate *d;
178};
179
180#endif
This class provides a Dialog for editing properties, adding Bookmarks and creating new folders.
Definition kbookmarkdialog.h:30
A group of bookmarks.
Definition kbookmark.h:323
This class implements the reading/writing of bookmarks in XML.
Definition kbookmarkmanager.h:52
Represents the data for a bookmark that will be added.
Definition kbookmarkowner.h:113
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition kbookmarkowner.h:44
virtual QList< FutureBookmark > currentBookmarkList() const
Returns a list of bookmark data for the open tabs.
Definition kbookmarkowner.h:132
virtual QString currentIcon() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition kbookmarkowner.h:93
virtual void openInNewWindow(const KBookmark &bm)
Called when a bookmark should be opened in a new window.
virtual void openInNewTab(const KBookmark &bm)
Called when a bookmark should be opened in a new tab.
virtual QString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition kbookmarkowner.h:60
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
virtual bool supportsTabs() const
This function returns whether the owner supports tabs.
Definition kbookmarkowner.h:102
virtual bool enableOption(BookmarkOption option) const
Returns true if action should be shown in the menu The default is to show both a add and editBookmark...
virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km)=0
Called if a bookmark is selected.
virtual QUrl currentUrl() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition kbookmarkowner.h:75
A class representing a bookmark.
Definition kbookmark.h:28