• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/bookmarks
 

kio/bookmarks

  • kio
  • bookmarks
kbookmarkmanager.h
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 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 <tqstring.h>
24 #include <tqstringlist.h>
25 #include <tqobject.h>
26 #include <tqdom.h>
27 #include <dcopobject.h>
28 #include "kbookmark.h"
29 #include "kbookmarknotifier.h"
30 
53 class KIO_EXPORT KBookmarkManager : public TQObject, public DCOPObject
54 {
55  Q_OBJECT
56  K_DCOP
57 protected:
72  KBookmarkManager( const TQString & bookmarksFile, bool bImportDesktopFiles = true );
73 
77  KBookmarkManager();
78 
79 public:
83  ~KBookmarkManager();
84 
89  void setUpdate( bool update );
90 
98  bool save( bool toolbarCache = true ) const;
99 
106  bool saveAs( const TQString & filename, bool toolbarCache = true ) const;
107 
115  bool updateAccessMetadata( const TQString &url, bool emitSignal = true );
116 
117  /*
118  * NB. currently *unimplemented*
119  *
120  * Update favicon url for a given url.
121  * @param url the viewed url
122  * @param faviconurl the favicion url
123  * @emitSignal iff true emit KBookmarkNotifier signal
124  * @since 3.3
125  */
126  void updateFavicon( const TQString &url, const TQString &faviconurl, bool emitSignal = true );
127 
134  TQString path() { return m_bookmarksFile; }
135 
142  KBookmarkGroup root() const;
143 
150  KBookmarkGroup toolbar();
151 
158  KBookmark findByAddress( const TQString & address, bool tolerate = false );
159 
164  void emitChanged( KBookmarkGroup & group );
165 
166  void emitConfigChanged();
167 
173  bool showNSBookmarks() const;
174 
179  void setShowNSBookmarks( bool show );
180 
191  void setEditorOptions( const TQString& caption, bool browser );
192 
209  static KBookmarkManager* managerForFile( const TQString& bookmarksFile,
210  bool bImportDesktopFiles = true );
211 
212 
213  static KBookmarkManager* createTempManager();
214 
219  static KBookmarkManager* userBookmarksManager();
220 
225  static TQString userBookmarksFile();
226 
230  const TQDomDocument & internalDocument() const;
231 
237  KBookmarkNotifier& notifier() { return m_notifier; }
238 
242  KBookmarkGroup addBookmarkDialog( const TQString & _url, const TQString & _title,
243  const TQString & _parentBookmarkAddress = TQString::null );
244 
245 public slots:
246  void slotEditBookmarks();
247  void slotEditBookmarksAtAddress( const TQString& address );
248 
249 public:
250 k_dcop:
255  ASYNC notifyCompleteChange( TQString caller );
256 
263  ASYNC notifyChanged( TQString groupAddress );
264 
265  ASYNC notifyConfigChanged();
266 
267 signals:
273  void changed( const TQString & groupAddress, const TQString & caller );
274 
275 protected:
276  // consts added to avoid a copy-and-paste of internalDocument
277  void parse() const;
278  void importDesktopFiles();
279  static void convertToXBEL( TQDomElement & group );
280  static void convertAttribute( TQDomElement elem, const TQString & oldName, const TQString & newName );
281 
282 private:
283  KBookmarkNotifier m_notifier;
284  TQString m_bookmarksFile;
285  mutable TQDomDocument m_doc;
286  mutable TQDomDocument m_toolbarDoc;
287  mutable bool m_docIsLoaded;
288  bool m_update;
289  static TQPtrList<KBookmarkManager>* s_pSelf;
290  bool m_showNSBookmarks;
291 
292 private:
293  class KBookmarkManagerPrivate* dptr() const;
294 };
295 
317 class KIO_EXPORT KBookmarkOwner
318 {
319 public:
324  virtual void openBookmarkURL(const TQString& _url);
325 
334  virtual TQString currentTitle() const { return TQString::null; }
335 
344  virtual TQString currentURL() const { return TQString::null; }
345 
346 protected:
347  virtual void virtual_hook( int id, void* data );
348 };
349 
353 class KIO_EXPORT KExtendedBookmarkOwner : public TQObject, virtual public KBookmarkOwner
354 {
355  Q_OBJECT
356 public:
357  typedef TQValueList<QPair<TQString,TQString> > QStringPairList;
358 public slots:
359  void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); };
360 signals:
361  void signalFillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list );
362 private:
363  class KExtendedBookmarkOwnerPrivate;
364  KExtendedBookmarkOwnerPrivate *d;
365 };
366 
367 #endif
KBookmarkManager::notifier
KBookmarkNotifier & notifier()
Access to bookmark notifier, for emitting signals.
Definition: kbookmarkmanager.h:237
KBookmarkOwner::currentURL
virtual TQString currentURL() const
This function is called whenever the user wants to add the current page to the bookmarks list...
Definition: kbookmarkmanager.h:344
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:53
KBookmarkOwner::currentTitle
virtual TQString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list...
Definition: kbookmarkmanager.h:334
KExtendedBookmarkOwner
Definition: kbookmarkmanager.h:353
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:199
KBookmarkOwner
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition: kbookmarkmanager.h:317
KBookmarkManager::path
TQString path()
This will return the path that this manager is using to read the bookmarks.
Definition: kbookmarkmanager.h:134
KBookmarkNotifier
DCOP interface for a bookmark notifier (an object which emits signals upon changes to the bookmarks) ...
Definition: kbookmarknotifier.h:31

kio/bookmarks

Skip menu "kio/bookmarks"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/bookmarks

Skip menu "kio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/bookmarks by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |