.TH "KBookmarkManager" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KBookmarkManager \- This class implements the reading/writing of bookmarks in XML.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kbookmarkmanager.h>\fP
.PP
Inherits \fBQObject\fP, and \fBDCOPObject\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBslotEditBookmarks\fP ()"
.br
.ti -1c
.RI "void \fBslotEditBookmarksAtAddress\fP (const \fBQString\fP &address)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBchanged\fP (const \fBQString\fP &groupAddress, const \fBQString\fP &caller)"
.br
.in -1c
.SS "DCOP Member Functions"

.in +1c
.ti -1c
.RI "ASYNC \fBnotifyCompleteChange\fP (\fBQString\fP caller)"
.br
.ti -1c
.RI "ASYNC \fBnotifyChanged\fP (\fBQString\fP groupAddress)"
.br
.ti -1c
.RI "ASYNC \fBnotifyConfigChanged\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fB~KBookmarkManager\fP ()"
.br
.ti -1c
.RI "void \fBsetUpdate\fP (bool update)"
.br
.ti -1c
.RI "bool \fBsave\fP (bool toolbarCache=true) const "
.br
.ti -1c
.RI "bool \fBsaveAs\fP (const \fBQString\fP &filename, bool toolbarCache=true) const "
.br
.ti -1c
.RI "bool \fBupdateAccessMetadata\fP (const \fBQString\fP &url, bool emitSignal=true)"
.br
.ti -1c
.RI "void \fBupdateFavicon\fP (const \fBQString\fP &url, const \fBQString\fP &faviconurl, bool emitSignal=true)"
.br
.ti -1c
.RI "\fBQString\fP \fBpath\fP ()"
.br
.ti -1c
.RI "\fBKBookmarkGroup\fP \fBroot\fP () const "
.br
.ti -1c
.RI "\fBKBookmarkGroup\fP \fBtoolbar\fP ()"
.br
.ti -1c
.RI "KBookmark \fBfindByAddress\fP (const \fBQString\fP &address, bool tolerate=false)"
.br
.ti -1c
.RI "void \fBemitChanged\fP (\fBKBookmarkGroup\fP &group)"
.br
.ti -1c
.RI "void \fBemitConfigChanged\fP ()"
.br
.ti -1c
.RI "bool \fBshowNSBookmarks\fP () const "
.br
.ti -1c
.RI "void \fBsetShowNSBookmarks\fP (bool show)"
.br
.ti -1c
.RI "void \fBsetEditorOptions\fP (const \fBQString\fP &caption, bool browser)"
.br
.ti -1c
.RI "const \fBQDomDocument\fP & \fBinternalDocument\fP () const "
.br
.ti -1c
.RI "\fBKBookmarkNotifier\fP & \fBnotifier\fP ()"
.br
.ti -1c
.RI "\fBKBookmarkGroup\fP \fBaddBookmarkDialog\fP (const \fBQString\fP &_url, const \fBQString\fP &_title, const \fBQString\fP &_parentBookmarkAddress=QString::null)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKBookmarkManager\fP * \fBmanagerForFile\fP (const \fBQString\fP &bookmarksFile, bool bImportDesktopFiles=true)"
.br
.ti -1c
.RI "static \fBKBookmarkManager\fP * \fBcreateTempManager\fP ()"
.br
.ti -1c
.RI "static \fBKBookmarkManager\fP * \fBuserBookmarksManager\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKBookmarkManager\fP (const \fBQString\fP &bookmarksFile, bool bImportDesktopFiles=true)"
.br
.ti -1c
.RI "\fBKBookmarkManager\fP ()"
.br
.ti -1c
.RI "void \fBparse\fP () const "
.br
.ti -1c
.RI "void \fBimportDesktopFiles\fP ()"
.br
.in -1c
.SS "Static Protected Member Functions"

.in +1c
.ti -1c
.RI "static void \fBconvertToXBEL\fP (\fBQDomElement\fP &group)"
.br
.ti -1c
.RI "static void \fBconvertAttribute\fP (\fBQDomElement\fP elem, const \fBQString\fP &oldName, const \fBQString\fP &newName)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class implements the reading/writing of bookmarks in XML. 

The bookmarks file is read and written using the XBEL standard (http://pyxml.sourceforge.net/topics/xbel/)
.PP
A sample file looks like this : 
.PP
.nf
 <xbel>
   <bookmark href='http://developer.kde.org'><title>Developer Web Site</title></bookmark>
   <folder folded='no'>
     <title>Title of this folder</title>
     <bookmark icon='kde' href='http://www.kde.org'><title>KDE Web Site</title></bookmark>
     <folder toolbar='yes'>
       <title>My own bookmarks</title>
       <bookmark href='http://www.koffice.org'><title>KOffice Web Site</title></bookmark>
       <separator/>
       <bookmark href='http://www.kdevelop.org'><title>KDevelop Web Site</title></bookmark>
     </folder>
   </folder>
 </xbel>

.fi
.PP
 
.PP
Definition at line 53 of file kbookmarkmanager.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KBookmarkManager::KBookmarkManager (const \fBQString\fP & bookmarksFile, bool bImportDesktopFiles = \fCtrue\fP)\fC [protected]\fP"
.PP
Creates a bookmark manager with a path to the bookmarks. 
.PP
By default, it will use the \fBKDE\fP standard dirs to find and create the correct location. If you are using your own app-specific bookmarks directory, you must instantiate this class with your own path \fIbefore\fP \fBKBookmarkManager::managerForFile()\fP is ever called.
.PP
\fBParameters:\fP
.RS 4
\fIbookmarksFile\fP full path to the bookmarks file, Use ~/.kde/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks
.br
\fIbImportDesktopFiles\fP if true, and if the bookmarksFile doesn't already exist, import bookmarks from desktop files 
.RE
.PP

.PP
Definition at line 128 of file kbookmarkmanager.cc.
.PP
References DCOPObject::connectDCOPSignal(), QDomDocument::createElement(), QDomDocument::createProcessingInstruction(), and DCOPObject::objId().
.SS "KBookmarkManager::KBookmarkManager ()\fC [protected]\fP"
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 153 of file kbookmarkmanager.cc.
.PP
References DCOPObject::connectDCOPSignal(), QDomDocument::createElement(), QDomDocument::createProcessingInstruction(), and DCOPObject::objId().
.PP
Referenced by managerForFile().
.SS "KBookmarkManager::~\fBKBookmarkManager\fP ()"
.PP
Destructor. 
.PP
Definition at line 174 of file kbookmarkmanager.cc.
.PP
References QPtrList::removeRef().
.SH "Member Function Documentation"
.PP 
.SS "void KBookmarkManager::setUpdate (bool update)"
.PP
Set the update flag. 
.PP
Defaults to true. TODO - check 
.PP
\fBParameters:\fP
.RS 4
\fIupdate\fP if true then KBookmarkManager will listen to DCOP update requests. 
.RE
.PP

.PP
Definition at line 180 of file kbookmarkmanager.cc.
.SS "bool KBookmarkManager::save (bool toolbarCache = \fCtrue\fP) const"
.PP
Save the bookmarks to the default konqueror XML file on disk. 
.PP
\fBParameters:\fP
.RS 4
\fItoolbarCache\fP iff true save a cache of the toolbar folder, too 
.RE
.PP
\fBReturns:\fP
.RS 4
true if saving was successful 
.RE
.PP

.PP
Definition at line 319 of file kbookmarkmanager.cc.
.PP
References saveAs().
.SS "bool KBookmarkManager::saveAs (const \fBQString\fP & filename, bool toolbarCache = \fCtrue\fP) const"
.PP
Save the bookmarks to the given XML file on disk. 
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP full path to the desired bookmarks file location 
.br
\fItoolbarCache\fP iff true save a cache of the toolbar folder, too 
.RE
.PP
\fBReturns:\fP
.RS 4
true if saving was successful 
.RE
.PP

.PP
Definition at line 324 of file kbookmarkmanager.cc.
.PP
References KSaveFile::abort(), KSaveFile::backupFile(), KSaveFile::close(), endl(), KMessageBox::error(), KSaveFile::file(), KBookmarkGroup::findToolbar(), QString::fromLatin1(), KBookmarkGroup::isToolbarGroup(), kdDebug(), kdError(), QCString::length(), KSaveFile::name(), QFile::remove(), root(), KSaveFile::status(), QDomDocument::toCString(), and QString::utf8().
.PP
Referenced by save().
.SS "bool KBookmarkManager::updateAccessMetadata (const \fBQString\fP & url, bool emitSignal = \fCtrue\fP)"
.PP
Update access time stamps for a given url. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the viewed url 
.br
\fIemitSignal\fP iff true emit \fBKBookmarkNotifier\fP signal 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP
\fBReturns:\fP
.RS 4
true if any metadata was modified (bookmarks file is not saved automatically) 
.RE
.PP

.PP
Definition at line 646 of file kbookmarkmanager.cc.
.PP
References QValueList::begin(), QValueList::count(), QValueList::end(), notifier(), path(), and KBookmarkNotifier::updatedAccessMetadata().
.SS "\fBQString\fP KBookmarkManager::path ()\fC [inline]\fP"
.PP
This will return the path that this manager is using to read the bookmarks. 
.PP
Definition at line 132 of file kbookmarkmanager.h.
.PP
Referenced by KBookmarkMenu::fillBookmarkMenu(), and updateAccessMetadata().
.SS "\fBKBookmarkGroup\fP KBookmarkManager::root () const"
.PP
This will return the root bookmark. 
.PP
It is used to iterate through the bookmarks manually. It is mostly used internally.
.PP
\fBReturns:\fP
.RS 4
the root (top-level) bookmark 
.RE
.PP

.PP
Definition at line 377 of file kbookmarkmanager.cc.
.PP
Referenced by findByAddress(), saveAs(), KBookmarkMenu::showDynamicBookmarks(), and toolbar().
.SS "\fBKBookmarkGroup\fP KBookmarkManager::toolbar ()"
.PP
This returns the root of the toolbar menu. 
.PP
In the XML, this is the group with the attribute TOOLBAR=1
.PP
\fBReturns:\fP
.RS 4
the toolbar group 
.RE
.PP

.PP
Definition at line 382 of file kbookmarkmanager.cc.
.PP
References endl(), QFile::exists(), KBookmarkGroup::findToolbar(), QString::fromLatin1(), kdDebug(), QFileInfo::lastModified(), QFile::open(), root(), and QDomDocument::setContent().
.PP
Referenced by KBookmarkBar::parentAddress().
.SS "KBookmark KBookmarkManager::findByAddress (const \fBQString\fP & address, bool tolerate = \fCfalse\fP)"
.PP
\fBReturns:\fP
.RS 4
the bookmark designated by \fCaddress\fP 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIaddress\fP the address belonging to the bookmark you're looking for 
.br
\fItolerate\fP when true tries to find the most tolerable bookmark position 
.RE
.PP
\fBSee also:\fP
.RS 4
KBookmark::address 
.RE
.PP

.PP
Definition at line 423 of file kbookmarkmanager.cc.
.PP
References endl(), KBookmarkGroup::first(), kdWarning(), KBookmarkGroup::next(), root(), QStringList::split(), and QString::toUInt().
.PP
Referenced by addBookmarkDialog(), and KBookmarkMenu::fillBookmarkMenu().
.SS "bool KBookmarkManager::showNSBookmarks () const"
.PP
\fBReturns:\fP
.RS 4
true if the NS bookmarks should be dynamically shown in the toplevel kactionmenu 
.RE
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP

.PP
Definition at line 593 of file kbookmarkmanager.cc.
.PP
References KBookmarkMenu::showDynamicBookmarks().
.SS "void KBookmarkManager::setShowNSBookmarks (bool show)"
.PP
Shows an extra menu for NS bookmarks. 
.PP
Set this to false, if you don't want this. 
.PP
Definition at line 598 of file kbookmarkmanager.cc.
.PP
References KBookmarkMenu::setDynamicBookmarks(), KBookmarkMenu::DynMenuInfo::show, KBookmarkMenu::showDynamicBookmarks(), and userBookmarksManager().
.SS "void KBookmarkManager::setEditorOptions (const \fBQString\fP & caption, bool browser)"
.PP
Set options with which slotEditBookmarks called keditbookmarks this can be used to change the appearance of the keditbookmarks in order to provide a slightly differing outer shell depending on the bookmarks file / app which calls it. 
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP the --caption string, for instance 'Konsole' 
.br
\fIbrowser\fP iff false display no browser specific menu items in keditbookmarks :: --nobrowser 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 609 of file kbookmarkmanager.cc.
.SS "\fBKBookmarkManager\fP * KBookmarkManager::managerForFile (const \fBQString\fP & bookmarksFile, bool bImportDesktopFiles = \fCtrue\fP)\fC [static]\fP"
.PP
This static function will return an instance of the KBookmarkManager, responsible for the given \fCbookmarksFile\fP. 
.PP
If you do not instantiate this class either natively or in a derived class, then it will return an object with the default behaviors. If you wish to use different behaviors, you \fImust\fP derive your own class and instantiate it before this method is ever called.
.PP
\fBParameters:\fP
.RS 4
\fIbookmarksFile\fP full path to the bookmarks file, Use ~/.kde/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks
.br
\fIbImportDesktopFiles\fP if true, and if the bookmarksFile doesn't already exist, import bookmarks from desktop files 
.RE
.PP
\fBReturns:\fP
.RS 4
a pointer to an instance of the KBookmarkManager. 
.RE
.PP

.PP
Definition at line 98 of file kbookmarkmanager.cc.
.PP
References QPtrList::append(), QPtrListIterator::current(), KBookmarkManager(), QPtrList::setAutoDelete(), and KStaticDeleter< type >::setObject().
.PP
Referenced by userBookmarksManager().
.SS "\fBKBookmarkManager\fP * KBookmarkManager::userBookmarksManager ()\fC [static]\fP"
.PP
Returns a pointer to the users main bookmark collection. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 692 of file kbookmarkmanager.cc.
.PP
References locateLocal(), and managerForFile().
.PP
Referenced by setShowNSBookmarks(), and KBookmarkMenu::showDynamicBookmarks().
.SS "\fBKBookmarkNotifier\fP& KBookmarkManager::notifier ()\fC [inline]\fP"
.PP
Access to bookmark notifier, for emitting signals. 
.PP
We need this object to exist in one instance only, so we could connectDCOP to it by name. 
.PP
Definition at line 228 of file kbookmarkmanager.h.
.PP
Referenced by updateAccessMetadata().
.SS "\fBKBookmarkGroup\fP KBookmarkManager::addBookmarkDialog (const \fBQString\fP & _url, const \fBQString\fP & _title, const \fBQString\fP & _parentBookmarkAddress = \fCQString::null\fP)"
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 494 of file kbookmarkmanager.cc.
.PP
References KBookmarkGroup::addBookmark(), KMessageBox::error(), findByAddress(), QString::isEmpty(), and QString::isNull().
.SS "void KBookmarkManager::notifyCompleteChange (\fBQString\fP caller)"
.PP
Reparse the whole bookmarks file and notify about the change (Called by the bookmark editor). 
.PP
Definition at line 554 of file kbookmarkmanager.cc.
.SS "void KBookmarkManager::notifyChanged (\fBQString\fP groupAddress)"
.PP
Emit the changed signal for the group whose address is given. 
.PP
\fBSee also:\fP
.RS 4
KBookmark::address() Called by the instance of konqueror that saved the file after a small change (new bookmark or new folder). 
.RE
.PP

.PP
Definition at line 578 of file kbookmarkmanager.cc.
.SS "void KBookmarkManager::changed (const \fBQString\fP & groupAddress, const \fBQString\fP & caller)\fC [signal]\fP"
.PP
Signals that the group with the address \fCgroupAddress\fP (e.g. 
.PP
'/4/5') has been modified by the caller \fCcaller\fP. 

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
