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 <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
80
82{
83 // fallback
85}
86
A group of bookmarks.
Definition kbookmark.h:316
Represents the data for a bookmark that will be added.
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
virtual void openInNewWindow(const KBookmark &bm)
Called when a bookmark should be opened in a new window.
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 openInNewTab(const KBookmark &bm)
Called when a bookmark should be opened in a new tab.
virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km)=0
Called if a bookmark is selected.
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
A class representing a bookmark.
Definition kbookmark.h:27
NoModifier
LeftButton
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.