KBookmarks

kbookmarkowner.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000, 2006 David Faure <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef KBOOKMARK_OWNER_H
19 #define KBOOKMARK_OWNER_H
20 
21 #include <QString>
22 #include <QSharedDataPointer>
23 
24 #include "kbookmark.h"
25 
26 class KBookmarkGroup;
27 
28 class KBookmarkDialog;
29 
51 class KBOOKMARKS_EXPORT KBookmarkOwner
52 {
53 public:
54  // TODO KF6: add non-inline constructor, de-inline destructor. Otherwise the d pointer cannot be used.
55  virtual ~KBookmarkOwner() {}
56 
66  virtual QString currentTitle() const
67  {
68  return QString();
69  }
70 
81  virtual QUrl currentUrl() const
82  {
83  return QUrl();
84  }
85 
99  virtual QString currentIcon() const
100  {
101  return QString();
102  }
103 
108  virtual bool supportsTabs() const
109  {
110  return false;
111  }
112 
113  class FutureBookmarkPrivate;
118  class KBOOKMARKS_EXPORT FutureBookmark
119  {
120  public:
121  FutureBookmark(const QString &title, const QUrl &url, const QString &icon);
122  ~FutureBookmark();
123  FutureBookmark(const FutureBookmark &other);
124  FutureBookmark &operator=(const FutureBookmark &other);
125 
126  QString title() const;
127  QUrl url() const;
128  QString icon() const;
129  private:
131  };
132 
138  {
139  return QList<FutureBookmark>();
140  }
141 
142  enum BookmarkOption { ShowAddBookmark, ShowEditBookmark };
143 
150  virtual bool enableOption(BookmarkOption option) const;
151 
155  virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) = 0;
156 
162  virtual void openFolderinTabs(const KBookmarkGroup &bm);
163 
164  virtual KBookmarkDialog *bookmarkDialog(KBookmarkManager *mgr, QWidget *parent);
165 
171  virtual void openInNewTab(const KBookmark &bm);
172 
178  virtual void openInNewWindow(const KBookmark &bm);
179 
180 private:
181  class KBookmarkOwnerPrivate;
182  KBookmarkOwnerPrivate *d;
183 };
184 
185 #endif
186 
typedef KeyboardModifiers
typedef MouseButtons
virtual QUrl currentUrl() const
This function is called whenever the user wants to add the current page to the bookmarks list...
This class implements the reading/writing of bookmarks in XML.
virtual QString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list...
virtual QList< FutureBookmark > currentBookmarkList() const
Returns a list of bookmark data for the open tabs.
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 QString currentIcon() const
This function is called whenever the user wants to add the current page to the bookmarks list...
Represents the data for a bookmark that will be added.
virtual bool supportsTabs() const
This function returns whether the owner supports tabs.
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 Sun May 31 2020 23:01:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.