KBookmarks

kbookmarkowner.cpp
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 /*
3  This file is part of the KDE libraries
4  SPDX-FileCopyrightText: 2000 David Faure <[email protected]>
5  SPDX-FileCopyrightText: 2003 Alexander Kellett <[email protected]>
6  SPDX-FileCopyrightText: 2008 Norbert Frese <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-only
9 */
10 
11 #include "kbookmarkowner.h"
12 #include "kbookmarkdialog.h"
13 
14 class Q_DECL_HIDDEN KBookmarkOwner::FutureBookmarkPrivate : public QSharedData
15 {
16 public:
17  QString title;
18  QUrl url;
19  QString icon;
20 };
21 
22 KBookmarkOwner::FutureBookmark::FutureBookmark(const QString &title, const QUrl &url, const QString &icon)
23  : d(new FutureBookmarkPrivate)
24 {
25  d->title = title;
26  d->url = url;
27  d->icon = icon;
28 }
29 
30 KBookmarkOwner::FutureBookmark::FutureBookmark(const FutureBookmark &other)
31  : d(other.d)
32 {
33 }
34 
35 KBookmarkOwner::FutureBookmark &KBookmarkOwner::FutureBookmark::operator=(const FutureBookmark &other)
36 {
37  d = other.d;
38  return *this;
39 }
40 
41 KBookmarkOwner::FutureBookmark::~FutureBookmark()
42 {
43 }
44 
45 QString KBookmarkOwner::FutureBookmark::title() const
46 {
47  return d->title;
48 }
49 
50 QUrl KBookmarkOwner::FutureBookmark::url() const
51 {
52  return d->url;
53 }
54 
55 QString KBookmarkOwner::FutureBookmark::icon() const
56 {
57  return d->icon;
58 }
59 
60 bool KBookmarkOwner::enableOption(BookmarkOption action) const
61 {
62  if (action == ShowAddBookmark) {
63  return true;
64  }
65  if (action == ShowEditBookmark) {
66  return true;
67  }
68  return false;
69 }
70 
71 KBookmarkDialog *KBookmarkOwner::bookmarkDialog(KBookmarkManager *mgr, QWidget *parent)
72 {
73  return new KBookmarkDialog(mgr, parent);
74 }
75 
77 {
78 }
79 
81 {
82  // fallback
84 }
85 
87 {
88  // fallback
90 }
LeftButton
Represents the data for a bookmark that will be added.
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
virtual void openInNewTab(const KBookmark &bm)
Called when a bookmark should be opened in a new tab.
virtual void openInNewWindow(const KBookmark &bm)
Called when a bookmark should be opened in a new window.
virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km)=0
Called if a bookmark is selected.
NoModifier
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...
A group of bookmarks.
Definition: kbookmark.h:322
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:56:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.