KBookmarks

kbookmarkmanager.h
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000, 2006 David Faure <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef __kbookmarkmanager_h
20 #define __kbookmarkmanager_h
21 
22 #include <QString>
23 #include <QObject>
24 #include <QDomDocument>
25 class KBookmarkManagerPrivate;
26 
27 #include "kbookmark.h"
28 #include "kbookmarkowner.h" // for SC reasons
29 
30 class KBookmarkGroup;
31 class QDBusMessage;
32 
33 class KBookmarkDialog;
34 
57 class KBOOKMARKS_EXPORT KBookmarkManager : public QObject
58 {
59  Q_OBJECT
60 private:
78  KBookmarkManager(const QString &bookmarksFile, const QString &dbusObjectName);
79 
85  KBookmarkManager(const QString &bookmarksFile);
86 
91 
92 public:
97 
107  bool autoErrorHandlingEnabled() const;
108 
120  void setAutoErrorHandlingEnabled(bool enable, QWidget *parent);
121 
126  void setUpdate(bool update);
127 
134  // KF6 TODO: Use an enum and not a bool
135  bool saveAs(const QString &filename, bool toolbarCache = true) const;
136 
142  bool updateAccessMetadata(const QString &url);
143 
144  /*
145  * NB. currently *unimplemented*
146  *
147  * Update favicon url for a given url.
148  * @param url the viewed url
149  * @param faviconurl the favicion url
150  */
151  void updateFavicon(const QString &url, const QString &faviconurl);
152 
159  QString path() const;
160 
167  KBookmarkGroup root() const;
168 
175  KBookmarkGroup toolbar();
176 
183  KBookmark findByAddress(const QString &address);
184 
189  void emitChanged();
190 
195  void emitChanged(const KBookmarkGroup &group);
196 
205  // KF6 TODO: Use an enum and not a bool
206  bool save(bool toolbarCache = true) const;
207 
208  void emitConfigChanged();
209 
219  // KF6 TODO: Use an enum and not a bool
220  void setEditorOptions(const QString &caption, bool browser);
221 
241  static KBookmarkManager *managerForFile(const QString &bookmarksFile,
242  const QString &dbusObjectName);
243 
250  static KBookmarkManager *managerForExternalFile(const QString &bookmarksFile);
251 
255  static KBookmarkManager *createTempManager();
256 
260  static KBookmarkManager *userBookmarksManager();
261 
265  QDomDocument internalDocument() const;
266 
267 public Q_SLOTS:
268  void slotEditBookmarks();
269  void slotEditBookmarksAtAddress(const QString &address);
270 
277  void notifyCompleteChange(const QString &caller);
278 
279 #ifndef KBOOKMARKS_NO_DBUS
280 
288  void notifyChanged(const QString &groupAddress, const QDBusMessage &msg);
289 #endif
290 
291  void notifyConfigChanged();
292 
293 Q_SIGNALS:
297  void bookmarkCompleteChange(QString caller);
298 
302  void bookmarksChanged(QString groupAddress);
303 
307  void bookmarkConfigChanged();
308 
315  void changed(const QString &groupAddress, const QString &caller);
316 
320  void configChanged();
321 
327  void error(const QString &errorMessage);
328 
329 private Q_SLOTS:
330  void slotFileChanged(const QString &path); // external bookmarks
331 
332 private:
333  // consts added to avoid a copy-and-paste of internalDocument
334  void parse() const;
335  void init(const QString &dbusPath);
336 
337  void startKEditBookmarks(const QStringList &args);
338 
339  KBookmarkManagerPrivate *const d;
340 
341  friend class KBookmarkGroup;
342 };
343 
344 #endif
345 
This class implements the reading/writing of bookmarks in XML.
A group of bookmarks.
Definition: kbookmark.h:327
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
QCA_EXPORT void init()
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 Mon Jul 6 2020 22:39:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.