kbookmarkmanager.h
// -*- c-basic-offset:4; indent-tabs-mode:nil -*-
// vim: set ts=4 sts=4 sw=4 et:
/* This file is part of the KDE libraries
Copyright (C) 2000 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kbookmarkmanager_h
#define __kbookmarkmanager_h
#include <qstring.h>
#include <qstringlist.h>
#include <qobject.h>
#include <qdom.h>
#include <dcopobject.h>
#include "kbookmark.h"
#include "kbookmarknotifier.h"
class KIO_EXPORT KBookmarkManager : public QObject, public DCOPObject
{
Q_OBJECT
K_DCOP
protected:
KBookmarkManager( const QString & bookmarksFile, bool bImportDesktopFiles = true );
KBookmarkManager();
public:
~KBookmarkManager();
void setUpdate( bool update );
bool save( bool toolbarCache = true ) const;
bool saveAs( const QString & filename, bool toolbarCache = true ) const;
bool updateAccessMetadata( const QString &url, bool emitSignal = true );
/*
* NB. currently *unimplemented*
*
* Update favicon url for a given url.
* @param url the viewed url
* @param faviconurl the favicion url
* @emitSignal iff true emit KBookmarkNotifier signal
* @since 3.3
*/
void updateFavicon( const QString &url, const QString &faviconurl, bool emitSignal = true );
QString path() { return m_bookmarksFile; }
KBookmarkGroup root() const;
KBookmarkGroup toolbar();
KBookmark findByAddress( const QString & address, bool tolerate = false );
void emitChanged( KBookmarkGroup & group );
void emitConfigChanged();
bool showNSBookmarks() const;
void setShowNSBookmarks( bool show );
void setEditorOptions( const QString& caption, bool browser );
static KBookmarkManager* managerForFile( const QString& bookmarksFile,
bool bImportDesktopFiles = true );
static KBookmarkManager* createTempManager();
static KBookmarkManager* userBookmarksManager();
static QString userBookmarksFile();
const QDomDocument & internalDocument() const;
KBookmarkNotifier& notifier() { return m_notifier; }
KBookmarkGroup addBookmarkDialog( const QString & _url, const QString & _title,
const QString & _parentBookmarkAddress = QString::null );
public slots:
void slotEditBookmarks();
void slotEditBookmarksAtAddress( const QString& address );
public:
k_dcop:
ASYNC notifyCompleteChange( QString caller );
ASYNC notifyChanged( QString groupAddress );
ASYNC notifyConfigChanged();
signals:
void changed( const QString & groupAddress, const QString & caller );
protected:
// consts added to avoid a copy-and-paste of internalDocument
void parse() const;
void importDesktopFiles();
static void convertToXBEL( QDomElement & group );
static void convertAttribute( QDomElement elem, const QString & oldName, const QString & newName );
private:
KBookmarkNotifier m_notifier;
QString m_bookmarksFile;
mutable QDomDocument m_doc;
mutable QDomDocument m_toolbarDoc;
mutable bool m_docIsLoaded;
bool m_update;
static QPtrList<KBookmarkManager>* s_pSelf;
bool m_showNSBookmarks;
private:
class KBookmarkManagerPrivate* dptr() const;
};
class KIO_EXPORT KBookmarkOwner
{
public:
virtual void openBookmarkURL(const QString& _url);
virtual QString currentTitle() const { return QString::null; }
virtual QString currentURL() const { return QString::null; }
protected:
virtual void virtual_hook( int id, void* data );
};
class KIO_EXPORT KExtendedBookmarkOwner : public QObject, virtual public KBookmarkOwner
{
Q_OBJECT
public:
typedef QValueList<QPair<QString,QString> > QStringPairList;
public slots:
void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); };
signals:
void signalFillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list );
private:
class KExtendedBookmarkOwnerPrivate;
KExtendedBookmarkOwnerPrivate *d;
};
#endif
KBookmarkManager::path
QString path()
This will return the path that this manager is using to read the bookmarks.
Definition: kbookmarkmanager.h:134
KBookmarkManager::notifier
KBookmarkNotifier & notifier()
Access to bookmark notifier, for emitting signals.
Definition: kbookmarkmanager.h:237
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:53
KBookmarkOwner::currentTitle
virtual QString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list...
Definition: kbookmarkmanager.h:334
KBookmarkOwner::currentURL
virtual QString currentURL() const
This function is called whenever the user wants to add the current page to the bookmarks list...
Definition: kbookmarkmanager.h:344
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
KBookmarkNotifier
DCOP interface for a bookmark notifier (an object which emits signals upon changes to the bookmarks) ...
Definition: kbookmarknotifier.h:31

KDE Home | KDE Accessibility Home | Description of Access Keys