• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

kbookmarkmanager.h

Go to the documentation of this file.
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, 2006 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 <QtCore/QString>
00024 #include <QtCore/QStringList>
00025 #include <QtCore/QObject>
00026 #include <QtCore/QPair>
00027 #include <QtXml/QDomDocument>
00028 #include <QtXml/QDomElement>
00029 
00030 #include <kurl.h>
00031 #include "kbookmark.h"
00032 
00033 class KBookmarkGroup;
00034 class QDBusMessage;
00035 
00036 class QTreeWidgetItem;
00037 class QLabel;
00038 class QTreeWidget;
00039 class KLineEdit;
00040 class KMenu;
00041 class KBookmarkDialog;
00042 
00065 class KIO_EXPORT KBookmarkManager : public QObject
00066 {
00067     Q_OBJECT
00068 private:
00086     KBookmarkManager( const QString & bookmarksFile, const QString& dbusObjectName );
00087 
00093     KBookmarkManager( const QString & bookmarksFile );
00094     
00098     KBookmarkManager();
00099 
00100 public:
00104     ~KBookmarkManager();
00105 
00110     void setUpdate( bool update );
00111 
00118     bool saveAs( const QString & filename, bool toolbarCache = true ) const;
00119 
00125     bool updateAccessMetadata( const QString &url );
00126 
00127     /*
00128      * NB. currently *unimplemented*
00129      *
00130      * Update favicon url for a given url.
00131      * @param url the viewed url
00132      * @param faviconurl the favicion url
00133      */
00134     void updateFavicon( const QString &url, const QString &faviconurl );
00135 
00142     QString path() const;
00143 
00150     KBookmarkGroup root() const;
00151 
00158     KBookmarkGroup toolbar();
00159 
00166     KBookmark findByAddress( const QString & address);
00167 
00168 
00173     void emitChanged();
00174 
00179     void emitChanged( const KBookmarkGroup & group );
00180 
00189     bool save( bool toolbarCache = true ) const;
00190 
00191 
00192     void emitConfigChanged();
00193 
00203     void setEditorOptions( const QString& caption, bool browser );
00204 
00224     static KBookmarkManager* managerForFile( const QString& bookmarksFile,
00225                                              const QString& dbusObjectName );
00226 
00233     static KBookmarkManager* managerForExternalFile( const QString& bookmarksFile);
00234     
00238     static KBookmarkManager* createTempManager();
00239 
00243     static KBookmarkManager* userBookmarksManager();
00244 
00248     QDomDocument internalDocument() const;
00249 
00250 public Q_SLOTS:
00251     void slotEditBookmarks();
00252     void slotEditBookmarksAtAddress( const QString& address );
00253 
00260     void notifyCompleteChange( const QString &caller );
00261 
00270     void notifyChanged( const QString &groupAddress, const QDBusMessage &msg );
00271 
00272     void notifyConfigChanged();
00273 
00274 Q_SIGNALS:
00278     void bookmarkCompleteChange( QString caller );
00279 
00283     void bookmarksChanged( QString groupAddress );
00284 
00288     void bookmarkConfigChanged();
00289 
00296     void changed( const QString & groupAddress, const QString & caller );
00297 
00301     void configChanged();
00302 
00303 private Q_SLOTS:    
00304     void slotFileChanged(const QString& path); // external bookmarks
00305     
00306 private:
00307     // consts added to avoid a copy-and-paste of internalDocument
00308     void parse() const;
00309 
00318     static KBookmarkManager* managerForFile( const QString&, int);
00319     void init( const QString& dbusPath );
00320     
00321     class Private;
00322     Private * const d;
00323 
00324     friend class KBookmarkGroup;
00325 };
00326 
00348 class KIO_EXPORT KBookmarkOwner
00349 {
00350 public:
00351     virtual ~KBookmarkOwner() {}
00352 
00361   virtual QString currentTitle() const { return QString(); }
00362 
00371   virtual QString currentUrl() const { return QString(); }
00372 
00373 
00377   virtual bool supportsTabs() const { return false; }
00378 
00382   virtual QList<QPair<QString, QString> > currentBookmarkList() const { return QList<QPair<QString, QString> >(); }
00383 
00384   enum BookmarkOption { ShowAddBookmark, ShowEditBookmark };
00385 
00386 
00393   virtual bool enableOption(BookmarkOption option) const;
00394 
00398   virtual void openBookmark(const KBookmark & bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) = 0;
00399 
00405   virtual void openFolderinTabs(const KBookmarkGroup &bm);
00406 
00407   virtual KBookmarkDialog * bookmarkDialog(KBookmarkManager * mgr, QWidget *parent);
00408 
00409 private:
00410   class KBookmarkOwnerPrivate;
00411   KBookmarkOwnerPrivate *d;
00412 };
00413 
00414 #endif

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal