• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • bookmarks
kbookmarkmanager.h
Go to the documentation of this file.
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 // vim: set ts=4 sts=4 sw=4 et:
3 /* This file is part of the KDE libraries
4  Copyright (C) 2000, 2006 David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef __kbookmarkmanager_h
21 #define __kbookmarkmanager_h
22 
23 #include <QtCore/QString>
24 #include <QtCore/QStringList>
25 #include <QtCore/QObject>
26 #include <QtCore/QPair>
27 #include <QtXml/QDomDocument>
28 #include <QtXml/QDomElement>
29 
30 #include <kurl.h>
31 #include "kbookmark.h"
32 
33 class KBookmarkGroup;
34 class QDBusMessage;
35 
36 class QTreeWidgetItem;
37 class QLabel;
38 class QTreeWidget;
39 class KLineEdit;
40 class KMenu;
41 class KBookmarkDialog;
42 
65 class KIO_EXPORT KBookmarkManager : public QObject
66 {
67  Q_OBJECT
68 private:
86  KBookmarkManager( const QString & bookmarksFile, const QString& dbusObjectName );
87 
93  KBookmarkManager( const QString & bookmarksFile );
94 
98  KBookmarkManager();
99 
100 public:
104  ~KBookmarkManager();
105 
115  bool autoErrorHandlingEnabled() const;
116 
128  void setAutoErrorHandlingEnabled( bool enable, QWidget *parent );
129 
134  void setUpdate( bool update );
135 
142  // KDE5 TODO: Use an enum and not a bool
143  bool saveAs( const QString & filename, bool toolbarCache = true ) const;
144 
150  bool updateAccessMetadata( const QString &url );
151 
152  /*
153  * NB. currently *unimplemented*
154  *
155  * Update favicon url for a given url.
156  * @param url the viewed url
157  * @param faviconurl the favicion url
158  */
159  void updateFavicon( const QString &url, const QString &faviconurl );
160 
167  QString path() const;
168 
175  KBookmarkGroup root() const;
176 
183  KBookmarkGroup toolbar();
184 
191  KBookmark findByAddress( const QString & address);
192 
193 
198  void emitChanged();
199 
204  void emitChanged( const KBookmarkGroup & group );
205 
214  // KDE5 TODO: Use an enum and not a bool
215  bool save( bool toolbarCache = true ) const;
216 
217 
218  void emitConfigChanged();
219 
229  // KDE5 TODO: Use an enum and not a bool
230  void setEditorOptions( const QString& caption, bool browser );
231 
251  static KBookmarkManager* managerForFile( const QString& bookmarksFile,
252  const QString& dbusObjectName );
253 
260  static KBookmarkManager* managerForExternalFile( const QString& bookmarksFile);
261 
265  static KBookmarkManager* createTempManager();
266 
270  static KBookmarkManager* userBookmarksManager();
271 
275  QDomDocument internalDocument() const;
276 
277 public Q_SLOTS:
278  void slotEditBookmarks();
279  void slotEditBookmarksAtAddress( const QString& address );
280 
287  void notifyCompleteChange( const QString &caller );
288 
297  void notifyChanged( const QString &groupAddress, const QDBusMessage &msg );
298 
299  void notifyConfigChanged();
300 
301 Q_SIGNALS:
305  void bookmarkCompleteChange( QString caller );
306 
310  void bookmarksChanged( QString groupAddress );
311 
315  void bookmarkConfigChanged();
316 
323  void changed( const QString & groupAddress, const QString & caller );
324 
328  void configChanged();
329 
335  void error(const QString &errorMessage);
336 
337 private Q_SLOTS:
338  void slotFileChanged(const QString& path); // external bookmarks
339 
340 private:
341  // consts added to avoid a copy-and-paste of internalDocument
342  void parse() const;
343 
352  static KBookmarkManager* managerForFile( const QString&, int);
353  void init( const QString& dbusPath );
354 
355  class Private;
356  Private * const d;
357 
358  friend class KBookmarkGroup;
359 };
360 
382 class KIO_EXPORT KBookmarkOwner
383 {
384 public:
385  virtual ~KBookmarkOwner() {}
386 
396  virtual QString currentTitle() const { return QString(); }
397 
407  virtual QString currentUrl() const { return QString(); }
408 
409 
414  virtual bool supportsTabs() const { return false; }
415 
420  virtual QList<QPair<QString, QString> > currentBookmarkList() const { return QList<QPair<QString, QString> >(); }
421 
422  enum BookmarkOption { ShowAddBookmark, ShowEditBookmark };
423 
424 
431  virtual bool enableOption(BookmarkOption option) const;
432 
436  virtual void openBookmark(const KBookmark & bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) = 0;
437 
443  virtual void openFolderinTabs(const KBookmarkGroup &bm);
444 
445  virtual KBookmarkDialog * bookmarkDialog(KBookmarkManager * mgr, QWidget *parent);
446 
447 private:
448  class KBookmarkOwnerPrivate;
449  KBookmarkOwnerPrivate *d;
450 };
451 
452 #endif
453 
KBookmarkDialog
This class provides a Dialog for editing properties, adding Bookmarks and creating new folders.
Definition: kbookmarkdialog.h:45
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:348
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:66
KBookmarkManager::configChanged
void configChanged()
Signals that the config changed.
KBookmarkManager::bookmarkConfigChanged
void bookmarkConfigChanged()
Signal send over DBUS.
KBookmarkManager::error
void error(const QString &errorMessage)
Emitted when an error occurs.
KBookmarkManager::bookmarksChanged
void bookmarksChanged(QString groupAddress)
Signal send over DBUS.
KBookmarkManager::bookmarkCompleteChange
void bookmarkCompleteChange(QString caller)
Signal send over DBUS.
KBookmarkManager::changed
void changed(const QString &groupAddress, const QString &caller)
Signals that the group (or any of its children) with the address groupAddress (e.g.
KBookmarkOwner
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition: kbookmarkmanager.h:383
KBookmarkOwner::~KBookmarkOwner
virtual ~KBookmarkOwner()
Definition: kbookmarkmanager.h:385
KBookmarkOwner::currentBookmarkList
virtual QList< QPair< QString, QString > > currentBookmarkList() const
Returns a list of title, URL pairs of the open tabs.
Definition: kbookmarkmanager.h:420
KBookmarkOwner::currentUrl
virtual QString currentUrl() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition: kbookmarkmanager.h:407
KBookmarkOwner::currentTitle
virtual QString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition: kbookmarkmanager.h:396
KBookmarkOwner::BookmarkOption
BookmarkOption
Definition: kbookmarkmanager.h:422
KBookmarkOwner::supportsTabs
virtual bool supportsTabs() const
This function returns whether the owner supports tabs.
Definition: kbookmarkmanager.h:414
KBookmarkOwner::openBookmark
virtual void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km)=0
Called if a bookmark is selected.
KBookmark
Definition: kbookmark.h:35
KLineEdit
KMenu
QLabel
QList
QObject
QTreeWidget
QWidget
kbookmark.h
kurl.h
caption
QString caption()
group
group
save
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
saveAs
KAction * saveAs(const QObject *recvr, const char *slot, QObject *parent)
parse
QList< Action > parse(QSettings &ini)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Feb 3 2022 00:00:00 by doxygen 1.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal