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 <faure@kde.org>
5 SPDX-FileCopyrightText: 2003 Alexander Kellett <lypanov@kde.org>
6 SPDX-FileCopyrightText: 2008 Norbert Frese <nf2@scheinwelt.at>
7
8 SPDX-License-Identifier: LGPL-2.0-only
9*/
10
11#include "kbookmarkowner.h"
12
13class Q_DECL_HIDDEN KBookmarkOwner::FutureBookmarkPrivate : public QSharedData
14{
15public:
16 QString title;
17 QUrl url;
18 QString icon;
19};
20
21KBookmarkOwner::FutureBookmark::FutureBookmark(const QString &title, const QUrl &url, const QString &icon)
22 : d(new FutureBookmarkPrivate)
23{
24 d->title = title;
25 d->url = url;
26 d->icon = icon;
27}
28
29KBookmarkOwner::FutureBookmark::FutureBookmark(const FutureBookmark &other)
30 : d(other.d)
31{
32}
33
34KBookmarkOwner::FutureBookmark &KBookmarkOwner::FutureBookmark::operator=(const FutureBookmark &other)
35{
36 d = other.d;
37 return *this;
38}
39
40KBookmarkOwner::FutureBookmark::~FutureBookmark()
41{
42}
43
44QString KBookmarkOwner::FutureBookmark::title() const
45{
46 return d->title;
47}
48
49QUrl KBookmarkOwner::FutureBookmark::url() const
50{
51 return d->url;
52}
53
54QString KBookmarkOwner::FutureBookmark::icon() const
55{
56 return d->icon;
57}
58
59KBookmarkOwner::KBookmarkOwner()
60 : d(nullptr)
61{
62}
63
64KBookmarkOwner::~KBookmarkOwner() = default;
65
66bool KBookmarkOwner::enableOption(BookmarkOption action) const
67{
68 if (action == ShowAddBookmark) {
69 return true;
70 }
71 if (action == ShowEditBookmark) {
72 return true;
73 }
74 return false;
75}
76
77void KBookmarkOwner::openFolderinTabs(const KBookmarkGroup &)
78{
79}
80
81void KBookmarkOwner::openInNewTab(const KBookmark &bm)
82{
83 // fallback
84 openBookmark(bm, mb: Qt::LeftButton, km: Qt::NoModifier);
85}
86
87void KBookmarkOwner::openInNewWindow(const KBookmark &bm)
88{
89 // fallback
90 openBookmark(bm, mb: Qt::LeftButton, km: Qt::NoModifier);
91}
92

source code of kbookmarks/src/kbookmarkowner.cpp