• 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
33class KBookmarkGroup;
34class QDBusMessage;
35
36class QTreeWidgetItem;
37class QLabel;
38class QTreeWidget;
39class KLineEdit;
40class KMenu;
41class KBookmarkDialog;
42
65class KIO_EXPORT KBookmarkManager : public QObject
66{
67 Q_OBJECT
68private:
86 KBookmarkManager( const QString & bookmarksFile, const QString& dbusObjectName );
87
93 KBookmarkManager( const QString & bookmarksFile );
94
98 KBookmarkManager();
99
100public:
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
277public 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
301Q_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
337private Q_SLOTS:
338 void slotFileChanged(const QString& path); // external bookmarks
339
340private:
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
382class KIO_EXPORT KBookmarkOwner
383{
384public:
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
447private:
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::autoErrorHandlingEnabled
bool autoErrorHandlingEnabled() const
Check whether auto error handling is enabled.
Definition kbookmarkmanager.cc:317
KBookmarkManager::setAutoErrorHandlingEnabled
void setAutoErrorHandlingEnabled(bool enable, QWidget *parent)
Enable or disable auto error handling is enabled.
Definition kbookmarkmanager.cc:322
KBookmarkManager::findByAddress
KBookmark findByAddress(const QString &address)
Definition kbookmarkmanager.cc:519
KBookmarkManager::notifyChanged
void notifyChanged(const QString &groupAddress, const QDBusMessage &msg)
Emit the changed signal for the group whose address is given.
Definition kbookmarkmanager.cc:595
KBookmarkManager::managerForFile
static KBookmarkManager * managerForFile(const QString &bookmarksFile, const QString &dbusObjectName)
This static function will return an instance of the KBookmarkManager, responsible for the given bookm...
Definition kbookmarkmanager.cc:150
KBookmarkManager::updateFavicon
void updateFavicon(const QString &url, const QString &faviconurl)
Definition kbookmarkmanager.cc:660
KBookmarkManager::internalDocument
QDomDocument internalDocument() const
Definition kbookmarkmanager.cc:333
KBookmarkManager::updateAccessMetadata
bool updateAccessMetadata(const QString &url)
Update access time stamps for a given url.
Definition kbookmarkmanager.cc:646
KBookmarkManager::toolbar
KBookmarkGroup toolbar()
This returns the root of the toolbar menu.
Definition kbookmarkmanager.cc:473
KBookmarkManager::notifyConfigChanged
void notifyConfigChanged()
Definition kbookmarkmanager.cc:587
KBookmarkManager::slotEditBookmarks
void slotEditBookmarks()
Definition kbookmarkmanager.cc:618
KBookmarkManager::setUpdate
void setUpdate(bool update)
Set the update flag.
Definition kbookmarkmanager.cc:328
KBookmarkManager::bookmarkConfigChanged
void bookmarkConfigChanged()
Signal send over DBUS.
KBookmarkManager::userBookmarksManager
static KBookmarkManager * userBookmarksManager()
Returns a pointer to the user's main (konqueror) bookmark collection.
Definition kbookmarkmanager.cc:673
KBookmarkManager::save
bool save(bool toolbarCache=true) const
Save the bookmarks to an XML file on disk.
Definition kbookmarkmanager.cc:396
KBookmarkManager::path
QString path() const
This will return the path that this manager is using to read the bookmarks.
Definition kbookmarkmanager.cc:463
KBookmarkManager::notifyCompleteChange
void notifyCompleteChange(const QString &caller)
Reparse the whole bookmarks file and notify about the change Doesn't send signal over DBUS to the oth...
Definition kbookmarkmanager.cc:573
KBookmarkManager::root
KBookmarkGroup root() const
This will return the root bookmark.
Definition kbookmarkmanager.cc:468
KBookmarkManager::managerForExternalFile
static KBookmarkManager * managerForExternalFile(const QString &bookmarksFile)
Returns a KBookmarkManager, which will use KDirWatch for change detection This is important when shar...
Definition kbookmarkmanager.cc:172
KBookmarkManager::KBookmarkGroup
friend class KBookmarkGroup
Definition kbookmarkmanager.h:358
KBookmarkManager::error
void error(const QString &errorMessage)
Emitted when an error occurs.
KBookmarkManager::saveAs
bool saveAs(const QString &filename, bool toolbarCache=true) const
Save the bookmarks to the given XML file on disk.
Definition kbookmarkmanager.cc:401
KBookmarkManager::bookmarksChanged
void bookmarksChanged(QString groupAddress)
Signal send over DBUS.
KBookmarkManager::emitConfigChanged
void emitConfigChanged()
Definition kbookmarkmanager.cc:568
KBookmarkManager::slotEditBookmarksAtAddress
void slotEditBookmarksAtAddress(const QString &address)
Definition kbookmarkmanager.cc:631
KBookmarkManager::bookmarkCompleteChange
void bookmarkCompleteChange(QString caller)
Signal send over DBUS.
KBookmarkManager::createTempManager
static KBookmarkManager * createTempManager()
only used for KBookmarkBar
Definition kbookmarkmanager.cc:196
KBookmarkManager::setEditorOptions
void setEditorOptions(const QString &caption, bool browser)
Set options with which slotEditBookmarks called keditbookmarks this can be used to change the appeara...
Definition kbookmarkmanager.cc:612
KBookmarkManager::emitChanged
void emitChanged()
Saves the bookmark file and notifies everyone.
Definition kbookmarkmanager.cc:549
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::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::currentBookmarkList
virtual QList< QPair< QString, QString > > currentBookmarkList() const
Returns a list of title, URL pairs of the open tabs.
Definition kbookmarkmanager.h:420
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::bookmarkDialog
virtual KBookmarkDialog * bookmarkDialog(KBookmarkManager *mgr, QWidget *parent)
Definition kbookmarkmanager.cc:716
KBookmarkOwner::BookmarkOption
BookmarkOption
Definition kbookmarkmanager.h:422
KBookmarkOwner::ShowAddBookmark
@ ShowAddBookmark
Definition kbookmarkmanager.h:422
KBookmarkOwner::ShowEditBookmark
@ ShowEditBookmark
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.
KBookmarkOwner::openFolderinTabs
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
Definition kbookmarkmanager.cc:721
KBookmark
Definition kbookmark.h:35
KLineEdit
KMenu
QLabel
QList
QObject
QTreeWidget
QWidget
kbookmark.h
kurl.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 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