KBookmarks

kbookmarkowner.cpp
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 David Faure <[email protected]>
4  Copyright (C) 2003 Alexander Kellett <[email protected]>
5  Copyright (C) 2008 Norbert Frese <[email protected]>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kbookmarkowner.h"
23 #include "kbookmarkdialog.h"
24 
25 class Q_DECL_HIDDEN KBookmarkOwner::FutureBookmarkPrivate : public QSharedData
26 {
27 public:
28  QString title;
29  QUrl url;
30  QString icon;
31 };
32 
33 KBookmarkOwner::FutureBookmark::FutureBookmark(const QString &title, const QUrl &url, const QString &icon)
34  : d(new FutureBookmarkPrivate)
35 {
36  d->title = title;
37  d->url = url;
38  d->icon = icon;
39 }
40 
41 KBookmarkOwner::FutureBookmark::FutureBookmark(const FutureBookmark &other)
42  : d(other.d)
43 {
44 }
45 
46 KBookmarkOwner::FutureBookmark &KBookmarkOwner::FutureBookmark::operator=(const FutureBookmark &other)
47 {
48  d = other.d;
49  return *this;
50 }
51 
52 KBookmarkOwner::FutureBookmark::~FutureBookmark()
53 {
54 }
55 
56 QString KBookmarkOwner::FutureBookmark::title() const
57 {
58  return d->title;
59 }
60 
61 QUrl KBookmarkOwner::FutureBookmark::url() const
62 {
63  return d->url;
64 }
65 
66 QString KBookmarkOwner::FutureBookmark::icon() const
67 {
68  return d->icon;
69 }
70 
71 bool KBookmarkOwner::enableOption(BookmarkOption action) const
72 {
73  if (action == ShowAddBookmark) {
74  return true;
75  }
76  if (action == ShowEditBookmark) {
77  return true;
78  }
79  return false;
80 }
81 
82 KBookmarkDialog *KBookmarkOwner::bookmarkDialog(KBookmarkManager *mgr, QWidget *parent)
83 {
84  return new KBookmarkDialog(mgr, parent);
85 }
86 
88 {
89 
90 }
91 
92 void KBookmarkOwner::openInNewTab(const KBookmark &bm)
93 {
94  // fallback
95  openBookmark(bm, Qt::LeftButton, Qt::NoModifier);
96 }
97 
98 void KBookmarkOwner::openInNewWindow(const KBookmark &bm)
99 {
100  // fallback
101  openBookmark(bm, Qt::LeftButton, Qt::NoModifier);
102 }
103 
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...
LeftButton
This class implements the reading/writing of bookmarks in XML.
virtual void openInNewTab(const KBookmark &bm)
Called when a bookmark should be opened in a new tab.
A group of bookmarks.
Definition: kbookmark.h:327
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
virtual void openInNewWindow(const KBookmark &bm)
Called when a bookmark should be opened in a new window.
Represents the data for a bookmark that will be added.
QObject * parent() const const
This class provides a Dialog for editing properties, adding Bookmarks and creating new folders...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 2 2020 22:38:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.