# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# 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., 59 Temple Place - Suite 330,
    00018    Boston, MA 02111-1307, USA.
    00019 */
    00020 #ifndef __kbookmarkmanager_h
    00021 #define __kbookmarkmanager_h
    00022
    00023 #include <qstring.h>
    00024 #include <qstringlist.h>
    00025 #include <qobject.h>
    00026 #include <qdom.h>
    00027 #include <dcopobject.h>
    00028 #include "kbookmark.h"
    00029 #include "kbookmarknotifier.h"
    00030
    00053 class KIO_EXPORT KBookmarkManager : public QObject, public DCOPObject
    00054 {
    00055     Q_OBJECT
    00056     K_DCOP
    00057 protected:
    00072     KBookmarkManager( const QString & bookmarksFile, bool bImportDesktopFiles = true );
    00073
    00077     KBookmarkManager();
    00078
    00079 public:
    00083     ~KBookmarkManager();
    00084
    00089     void setUpdate( bool update );
    00090
    00096     bool save( bool toolbarCache = true ) const;
    00097
    00104     bool saveAs( const QString & filename, bool toolbarCache = true ) const;
    00105
    00113     bool updateAccessMetadata( const QString &url, bool emitSignal = true );
    00114
    00115     /*
    00116      * NB. currently *unimplemented*
    00117      *
    00118      * Update favicon url for a given url.
    00119      * @param url the viewed url
    00120      * @param faviconurl the favicion url
    00121      * @emitSignal iff true emit KBookmarkNotifier signal
    00122      * @since 3.3
    00123      */
    00124     void updateFavicon( const QString &url, const QString &faviconurl, bool emitSignal = true );
    00125
    00132     QString path() { return m_bookmarksFile; }
    00133
    00140     KBookmarkGroup root() const;
    00141
    00148     KBookmarkGroup toolbar();
    00149
    00156     KBookmark findByAddress( const QString & address, bool tolerate = false );
    00157
    00161     void emitChanged( KBookmarkGroup & group );
    00162
    00163     void emitConfigChanged();
    00164
    00170     bool showNSBookmarks() const;
    00171
    00176     void setShowNSBookmarks( bool show );
    00177
    00188     void setEditorOptions( const QString& caption, bool browser );
    00189
    00206     static KBookmarkManager* managerForFile( const QString& bookmarksFile,
    00207                                    bool bImportDesktopFiles = true );
    00208
    00209
    00210     static KBookmarkManager* createTempManager();
    00211
    00216     static KBookmarkManager* userBookmarksManager();
    00217
    00221     const QDomDocument & internalDocument() const;
    00222
    00228     KBookmarkNotifier& notifier() { return m_notifier; }
    00229
    00233     KBookmarkGroup addBookmarkDialog( const QString & _url, const QString & _title,
    00234                                       const QString & _parentBookmarkAddress = QString::null );
    00235
    00236 public slots:
    00237     void slotEditBookmarks();
    00238     void slotEditBookmarksAtAddress( const QString& address );
    00239
    00240 public:
    00241 k_dcop:
    00246     ASYNC notifyCompleteChange( QString caller );
    00247
    00254     ASYNC notifyChanged( QString groupAddress );
    00255
    00256     ASYNC notifyConfigChanged();
    00257
    00258 signals:
    00263     void changed( const QString & groupAddress, const QString & caller );
    00264
    00265 protected:
    00266     // consts added to avoid a copy-and-paste of internalDocument
    00267     void parse() const;
    00268     void importDesktopFiles();
    00269     static void convertToXBEL( QDomElement & group );
    00270     static void convertAttribute( QDomElement elem, const QString & oldName, const QString & newName );
    00271
    00272 private:
    00273     KBookmarkNotifier m_notifier;
    00274     QString m_bookmarksFile;
    00275     mutable QDomDocument m_doc;
    00276     mutable QDomDocument m_toolbarDoc;
    00277     mutable bool m_docIsLoaded;
    00278     bool m_update;
    00279     static QPtrList<KBookmarkManager>* s_pSelf;
    00280     bool m_showNSBookmarks;
    00281
    00282 private:
    00283     class KBookmarkManagerPrivate* dptr() const;
    00284 };
    00285
    00307 class KIO_EXPORT KBookmarkOwner
    00308 {
    00309 public:
    00314   virtual void openBookmarkURL(const QString& _url);
    00315
    00324   virtual QString currentTitle() const { return QString::null; }
    00325
    00334   virtual QString currentURL() const { return QString::null; }
    00335
    00336 protected:
    00337   virtual void virtual_hook( int id, void* data );
    00338 };
    00339
    00343 class KIO_EXPORT KExtendedBookmarkOwner : public QObject, virtual public KBookmarkOwner
    00344 {
    00345     Q_OBJECT
    00346 public:
    00347     typedef QValueList<QPair<QString,QString> > QStringPairList;
    00348 public slots:
    00349     void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); };
    00350 signals:
    00351     void signalFillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list );
    00352 private:
    00353     class KExtendedBookmarkOwnerPrivate;
    00354     KExtendedBookmarkOwnerPrivate *d;
    00355 };
    00356
    00357 #endif

This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:23:55 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003