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

kio/bookmarks

kbookmarkmanager.h
00001 //  -*- c-basic-offset:4; indent-tabs-mode:nil -*-
00002 // vim: set ts=4 sts=4 sw=4 et:
00003 /* This file is part of the KDE libraries
00004    Copyright (C) 2000 David Faure <faure@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 #ifndef __kbookmarkmanager_h
00021 #define __kbookmarkmanager_h
00022 
00023 #include <tqstring.h>
00024 #include <tqstringlist.h>
00025 #include <tqobject.h>
00026 #include <tqdom.h>
00027 #include <dcopobject.h>
00028 #include "kbookmark.h"
00029 #include "kbookmarknotifier.h"
00030 
00053 class KIO_EXPORT KBookmarkManager : public TQObject, public DCOPObject
00054 {
00055     Q_OBJECT
00056     K_DCOP
00057 protected:
00072     KBookmarkManager( const TQString & bookmarksFile, bool bImportDesktopFiles = true );
00073 
00077     KBookmarkManager();
00078 
00079 public:
00083     ~KBookmarkManager();
00084 
00089     void setUpdate( bool update );
00090 
00098     bool save( bool toolbarCache = true ) const;
00099 
00106     bool saveAs( const TQString & filename, bool toolbarCache = true ) const;
00107 
00115     bool updateAccessMetadata( const TQString &url, bool emitSignal = true );
00116 
00117     /*
00118      * NB. currently *unimplemented*
00119      *
00120      * Update favicon url for a given url.
00121      * @param url the viewed url
00122      * @param faviconurl the favicion url
00123      * @emitSignal iff true emit KBookmarkNotifier signal
00124      * @since 3.3
00125      */
00126     void updateFavicon( const TQString &url, const TQString &faviconurl, bool emitSignal = true );
00127 
00134     TQString path() { return m_bookmarksFile; }
00135 
00142     KBookmarkGroup root() const;
00143 
00150     KBookmarkGroup toolbar();
00151 
00158     KBookmark findByAddress( const TQString & address, bool tolerate = false );
00159 
00164     void emitChanged( KBookmarkGroup & group );
00165 
00166     void emitConfigChanged();
00167 
00173     bool showNSBookmarks() const;
00174 
00179     void setShowNSBookmarks( bool show );
00180 
00191     void setEditorOptions( const TQString& caption, bool browser );
00192 
00209     static KBookmarkManager* managerForFile( const TQString& bookmarksFile,
00210                                    bool bImportDesktopFiles = true );
00211 
00212 
00213     static KBookmarkManager* createTempManager();
00214 
00219     static KBookmarkManager* userBookmarksManager();
00220     
00225     static TQString userBookmarksFile();
00226 
00230     const TQDomDocument & internalDocument() const;
00231 
00237     KBookmarkNotifier& notifier() { return m_notifier; }
00238 
00242     KBookmarkGroup addBookmarkDialog( const TQString & _url, const TQString & _title,
00243                                       const TQString & _parentBookmarkAddress = TQString::null );
00244 
00245 public slots:
00246     void slotEditBookmarks();
00247     void slotEditBookmarksAtAddress( const TQString& address );
00248 
00249 public:
00250 k_dcop:
00255     ASYNC notifyCompleteChange( TQString caller );
00256 
00263     ASYNC notifyChanged( TQString groupAddress );
00264 
00265     ASYNC notifyConfigChanged();
00266 
00267 signals:
00273     void changed( const TQString & groupAddress, const TQString & caller );
00274 
00275 protected:
00276     // consts added to avoid a copy-and-paste of internalDocument
00277     void parse() const;
00278     void importDesktopFiles();
00279     static void convertToXBEL( TQDomElement & group );
00280     static void convertAttribute( TQDomElement elem, const TQString & oldName, const TQString & newName );
00281 
00282 private:
00283     KBookmarkNotifier m_notifier;
00284     TQString m_bookmarksFile;
00285     mutable TQDomDocument m_doc;
00286     mutable TQDomDocument m_toolbarDoc;
00287     mutable bool m_docIsLoaded;
00288     bool m_update;
00289     static TQPtrList<KBookmarkManager>* s_pSelf;
00290     bool m_showNSBookmarks;
00291 
00292 private:
00293     class KBookmarkManagerPrivate* dptr() const;
00294 };
00295 
00317 class KIO_EXPORT KBookmarkOwner
00318 {
00319 public:
00324   virtual void openBookmarkURL(const TQString& _url);
00325 
00334   virtual TQString currentTitle() const { return TQString::null; }
00335 
00344   virtual TQString currentURL() const { return TQString::null; }
00345 
00346 protected:
00347   virtual void virtual_hook( int id, void* data );
00348 };
00349 
00353 class KIO_EXPORT KExtendedBookmarkOwner : public TQObject, virtual public KBookmarkOwner
00354 {
00355     Q_OBJECT
00356 public:
00357     typedef TQValueList<QPair<TQString,TQString> > QStringPairList;
00358 public slots:
00359     void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); };
00360 signals:
00361     void signalFillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list );
00362 private:
00363     class KExtendedBookmarkOwnerPrivate;
00364     KExtendedBookmarkOwnerPrivate *d;
00365 };
00366 
00367 #endif

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.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |