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

tdeio/bookmarks

  • tdeio
  • bookmarks
kbookmarkmanager.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>
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 __kbookmarkmanager_h
19 #define __kbookmarkmanager_h
20 
21 #include <tqstring.h>
22 #include <tqstringlist.h>
23 #include <tqobject.h>
24 #include <tqdom.h>
25 #include <dcopobject.h>
26 #include "kbookmark.h"
27 #include "kbookmarknotifier.h"
28 
51 class TDEIO_EXPORT KBookmarkManager : public TQObject, public DCOPObject
52 {
53  Q_OBJECT
54  K_DCOP
55 protected:
70  KBookmarkManager( const TQString & bookmarksFile, bool bImportDesktopFiles = true );
71 
75  KBookmarkManager();
76 
77 public:
81  ~KBookmarkManager();
82 
87  void setUpdate( bool update );
88 
96  bool save( bool toolbarCache = true ) const;
97 
104  bool saveAs( const TQString & filename, bool toolbarCache = true ) const;
105 
113  bool updateAccessMetadata( const TQString &url, bool emitSignal = true );
114 
115  /*
116  * NB. currently *unimplemented*
117  *
118  * Update favicon url for a given url.
119  * @param url the viewed url
120  * @param faviconurl the favicion url
121  * @emitSignal iff true emit KBookmarkNotifier signal
122  * @since 3.3
123  */
124  void updateFavicon( const TQString &url, const TQString &faviconurl, bool emitSignal = true );
125 
132  TQString path() { return m_bookmarksFile; }
133 
140  KBookmarkGroup root() const;
141 
148  KBookmarkGroup toolbar();
149 
156  KBookmark findByAddress( const TQString & address, bool tolerate = false );
157 
162  void emitChanged( KBookmarkGroup & group );
163 
164  void emitConfigChanged();
165 
171  bool showNSBookmarks() const;
172 
177  void setShowNSBookmarks( bool show );
178 
189  void setEditorOptions( const TQString& caption, bool browser );
190 
207  static KBookmarkManager* managerForFile( const TQString& bookmarksFile,
208  bool bImportDesktopFiles = true );
209 
210 
211  static KBookmarkManager* createTempManager();
212 
217  static KBookmarkManager* userBookmarksManager();
218 
223  static TQString userBookmarksFile();
224 
228  const TQDomDocument & internalDocument() const;
229 
235  KBookmarkNotifier& notifier() { return m_notifier; }
236 
240  KBookmarkGroup addBookmarkDialog( const TQString & _url, const TQString & _title,
241  const TQString & _parentBookmarkAddress = TQString::null );
242 
243 public slots:
244  void slotEditBookmarks();
245  void slotEditBookmarksAtAddress( const TQString& address );
246 
247 public:
248 k_dcop:
253  ASYNC notifyCompleteChange( TQString caller );
254 
261  ASYNC notifyChanged( TQString groupAddress );
262 
263  ASYNC notifyConfigChanged();
264 
265 signals:
271  void changed( const TQString & groupAddress, const TQString & caller );
272 
273 protected:
274  // consts added to avoid a copy-and-paste of internalDocument
275  void parse() const;
276  void importDesktopFiles();
277  static void convertToXBEL( TQDomElement & group );
278  static void convertAttribute( TQDomElement elem, const TQString & oldName, const TQString & newName );
279 
280 private:
281  KBookmarkNotifier m_notifier;
282  TQString m_bookmarksFile;
283  mutable TQDomDocument m_doc;
284  mutable TQDomDocument m_toolbarDoc;
285  mutable bool m_docIsLoaded;
286  bool m_update;
287  static TQPtrList<KBookmarkManager>* s_pSelf;
288  bool m_showNSBookmarks;
289 
290 private:
291  class KBookmarkManagerPrivate* dptr() const;
292 };
293 
315 class TDEIO_EXPORT KBookmarkOwner
316 {
317 public:
322  virtual void openBookmarkURL(const TQString& _url);
323 
332  virtual TQString currentTitle() const { return TQString::null; }
333 
342  virtual TQString currentURL() const { return TQString::null; }
343 
344 protected:
345  virtual void virtual_hook( int id, void* data );
346 };
347 
351 class TDEIO_EXPORT KExtendedBookmarkOwner : public TQObject, virtual public KBookmarkOwner
352 {
353  Q_OBJECT
354 public:
355  typedef TQValueList<QPair<TQString,TQString> > QStringPairList;
356 public slots:
357  void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); };
358 signals:
359  void signalFillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list );
360 private:
361  class KExtendedBookmarkOwnerPrivate;
362  KExtendedBookmarkOwnerPrivate *d;
363 };
364 
365 #endif
KBookmarkManager::notifier
KBookmarkNotifier & notifier()
Access to bookmark notifier, for emitting signals.
Definition: kbookmarkmanager.h:235
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:342
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:51
KExtendedBookmarkOwner
Definition: kbookmarkmanager.h:351
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:197
KBookmarkOwner
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition: kbookmarkmanager.h:315
KBookmarkManager::path
TQString path()
This will return the path that this manager is using to read the bookmarks.
Definition: kbookmarkmanager.h:132
KBookmarkNotifier
DCOP interface for a bookmark notifier (an object which emits signals upon changes to the bookmarks) ...
Definition: kbookmarknotifier.h:29
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:332

tdeio/bookmarks

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

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/bookmarks by doxygen 1.8.8
This website is maintained by Timothy Pearson.