.TH "KBookmarkManager" 3 "28 Jan 2004" "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
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBchanged\fP (const  \fBQString\fP &groupAddress, const  \fBQString\fP &caller)"
.br
.RI "\fISignals that the group with the address \fCgroupAddress\fP (e.g. \fP"
.in -1c
.SS "DCOP Member Functions"

.in +1c
.ti -1c
.RI "ASYNC \fBnotifyCompleteChange\fP (\fBQString\fP caller)"
.br
.RI "\fIReparse the whole bookmarks file and notify about the change (Called by the bookmark editor). \fP"
.ti -1c
.RI "ASYNC \fBnotifyChanged\fP (\fBQString\fP groupAddress)"
.br
.RI "\fIEmit the changed signal for the group whose address is given. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBsetUpdate\fP (bool update)"
.br
.RI "\fISet the update flag. \fP"
.ti -1c
.RI "bool \fBsave\fP (bool toolbarCache=true) const "
.br
.RI "\fISave the bookmarks to the default konqueror XML file on disk. \fP"
.ti -1c
.RI "bool \fBsaveAs\fP (const  \fBQString\fP &filename, bool toolbarCache=true) const "
.br
.RI "\fISave the bookmarks to the given XML file on disk. \fP"
.ti -1c
.RI "\fBQString\fP \fBpath\fP ()"
.br
.RI "\fIThis will return the path that this manager is using to read the bookmarks. \fP"
.ti -1c
.RI "\fBKBookmarkGroup\fP \fBroot\fP () const "
.br
.RI "\fIThis will return the root bookmark. \fP"
.ti -1c
.RI "\fBKBookmarkGroup\fP \fBtoolbar\fP ()"
.br
.RI "\fIThis returns the root of the toolbar menu. \fP"
.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 "bool \fBshowNSBookmarks\fP () const "
.br
.ti -1c
.RI "void \fBsetShowNSBookmarks\fP (bool show)"
.br
.RI "\fIShows an extra menu for NS bookmarks. \fP"
.ti -1c
.RI "const  \fBQDomDocument\fP & \fBinternalDocument\fP () const "
.br
.ti -1c
.RI "\fBKBookmarkNotifier\fP & \fBnotifier\fP ()"
.br
.RI "\fIAccess to bookmark notifier, for emitting signals. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKBookmarkManager\fP * \fBmanagerForFile\fP (const  \fBQString\fP &bookmarksFile, bool bImportDesktopFiles=true)"
.br
.RI "\fIThis static function will return an instance of the KBookmarkManager, responsible for the given \fCbookmarksFile\fP. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKBookmarkManager\fP (const  \fBQString\fP &bookmarksFile, bool bImportDesktopFiles=true)"
.br
.RI "\fICreates a bookmark manager with a path to the bookmarks. \fP"
.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 "void \fBconvertToXBEL\fP (\fBQDomElement\fP &group)"
.br
.ti -1c
.RI "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 :  Developer Web Site  Title of this folder \fBKDE\fP Web Site  My own bookmarks KOffice Web Site <separator/> KDevelop Web Site    
.PP
Definition at line 48 of file kbookmarkmanager.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KBookmarkManager::KBookmarkManager (const \fBQString\fP & bookmarksFile, bool bImportDesktopFiles = true)\fC [protected]\fP"
.PP
Creates a bookmark manager with a path to the bookmarks. 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
Definition at line 56 of file kbookmarkmanager.cc.
.PP
References QDomDocument::createElement(), QFile::exists(), and QString::isEmpty().
.PP
Referenced by managerForFile().
.SH "Member Function Documentation"
.PP 
.SS "void KBookmarkManager::setUpdate (bool update)"
.PP
Set the update flag. \fBParameters:\fP
.RS 4
\fIupdate\fP iff true will KBookmarkManager listen to DCOP update requests. 
.RE
.PP
Definition at line 84 of file kbookmarkmanager.cc.
.SS "bool KBookmarkManager::save (bool toolbarCache = true) const"
.PP
Save the bookmarks to the default konqueror XML file on disk. \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
Definition at line 208 of file kbookmarkmanager.cc.
.PP
References saveAs().
.SS "bool KBookmarkManager::saveAs (const \fBQString\fP & filename, bool toolbarCache = true) const"
.PP
Save the bookmarks to the given XML file on disk. \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
Definition at line 213 of file kbookmarkmanager.cc.
.PP
References KSaveFile::close(), KMessageBox::error(), KSaveFile::file(), KBookmarkGroup::findToolbar(), QString::fromLatin1(), KBookmarkGroup::isToolbarGroup(), QCString::length(), QFile::remove(), root(), KSaveFile::status(), QDomDocument::toCString(), and QString::utf8().
.PP
Referenced by save().
.SS "\fBQString\fP KBookmarkManager::path ()\fC [inline]\fP"
.PP
This will return the path that this manager is using to read the bookmarks. Definition at line 100 of file kbookmarkmanager.h.
.PP
Referenced by KBookmarkGroup::addBookmark(), and KBookmarkGroup::createNewFolder().
.SS "\fBKBookmarkGroup\fP KBookmarkManager::root () const"
.PP
This will return the root bookmark. 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
Definition at line 255 of file kbookmarkmanager.cc.
.PP
Referenced by findByAddress(), saveAs(), setShowNSBookmarks(), showNSBookmarks(), and toolbar().
.SS "\fBKBookmarkGroup\fP KBookmarkManager::toolbar ()"
.PP
This returns the root of the toolbar menu. In the XML, this is the group with the attribute TOOLBAR=1
.PP
\fBReturns:\fP
.RS 4
the toolbar group 
.RE
.PP
Definition at line 260 of file kbookmarkmanager.cc.
.PP
References QFile::exists(), KBookmarkGroup::findToolbar(), QString::fromLatin1(), QFileInfo::lastModified(), QFile::open(), root(), and QDomDocument::setContent().
.PP
Referenced by KBookmarkBar::KBookmarkBar().
.SS "KBookmark KBookmarkManager::findByAddress (const \fBQString\fP & address, bool tolerate = false)"
.PP
\fBReturns:\fP
.RS 4
the bookmark designated by \fCaddress\fP 
.RE
.PP
\fBParameters:\fP
.RS 4
\fItolerate\fP when true tries to find the most tolerable bookmark position 
.RE
.PP
\fBSee also:\fP
.RS 4
KBookmark::address 
.RE
.PP
Definition at line 301 of file kbookmarkmanager.cc.
.PP
References KBookmarkGroup::first(), KBookmarkGroup::next(), KIO::number(), root(), QStringList::split(), and QString::toUInt().
.PP
Referenced by 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
Definition at line 386 of file kbookmarkmanager.cc.
.PP
References root().
.PP
Referenced by KBookmarkMenu::fillBookmarkMenu().
.SS "void KBookmarkManager::setShowNSBookmarks (bool show)"
.PP
Shows an extra menu for NS bookmarks. Set this to false, if you don't want this. Definition at line 392 of file kbookmarkmanager.cc.
.PP
References root().
.SS "\fBKBookmarkManager\fP * KBookmarkManager::managerForFile (const \fBQString\fP & bookmarksFile, bool bImportDesktopFiles = true)\fC [static]\fP"
.PP
This static function will return an instance of the KBookmarkManager, responsible for the given \fCbookmarksFile\fP. 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
Definition at line 40 of file kbookmarkmanager.cc.
.PP
References QPtrList< KBookmarkManager >::append(), QPtrListIterator::current(), KBookmarkManager(), and QPtrList< KBookmarkManager >::setAutoDelete().
.SS "\fBKBookmarkNotifier\fP& KBookmarkManager::notifier ()\fC [inline]\fP"
.PP
Access to bookmark notifier, for emitting signals. We need this object to exist in one instance only, so we could connectDCOP to it by name. Definition at line 169 of file kbookmarkmanager.h.
.PP
Referenced by KBookmarkGroup::addBookmark(), and KBookmarkGroup::createNewFolder().
.SS "void KBookmarkManager::notifyCompleteChange (\fBQString\fP caller)"
.PP
Reparse the whole bookmarks file and notify about the change (Called by the bookmark editor). Definition at line 355 of file kbookmarkmanager.cc.
.SS "void KBookmarkManager::notifyChanged (\fBQString\fP groupAddress)"
.PP
Emit the changed signal for the group whose address is given. \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
Definition at line 372 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. '/4/5') has been modified by the caller \fCcaller\fP. 

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