• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/bookmarks
 

tdeio/bookmarks

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
KBookmarkManager Class Reference

#include <kbookmarkmanager.h>

Inherits TQObject, and DCOPObject.

Public Slots

void slotEditBookmarks ()
 
void slotEditBookmarksAtAddress (const TQString &address)
 

Signals

void changed (const TQString &groupAddress, const TQString &caller)
 

Public Member Functions

 ~KBookmarkManager ()
 
void setUpdate (bool update)
 
bool save (bool toolbarCache=true) const
 
bool saveAs (const TQString &filename, bool toolbarCache=true) const
 
bool updateAccessMetadata (const TQString &url, bool emitSignal=true)
 
void updateFavicon (const TQString &url, const TQString &faviconurl, bool emitSignal=true)
 
TQString path ()
 
KBookmarkGroup root () const
 
KBookmarkGroup toolbar ()
 
KBookmark findByAddress (const TQString &address, bool tolerate=false)
 
void emitChanged (KBookmarkGroup &group)
 
void emitConfigChanged ()
 
bool showNSBookmarks () const
 
void setShowNSBookmarks (bool show)
 
void setEditorOptions (const TQString &caption, bool browser)
 
const TQDomDocument & internalDocument () const
 
KBookmarkNotifier & notifier ()
 
KBookmarkGroup addBookmarkDialog (const TQString &_url, const TQString &_title, const TQString &_parentBookmarkAddress=TQString::null)
 

Static Public Member Functions

static KBookmarkManager * managerForFile (const TQString &bookmarksFile, bool bImportDesktopFiles=true)
 
static KBookmarkManager * createTempManager ()
 
static KBookmarkManager * userBookmarksManager ()
 
static TQString userBookmarksFile ()
 

Protected Member Functions

 KBookmarkManager (const TQString &bookmarksFile, bool bImportDesktopFiles=true)
 
 KBookmarkManager ()
 
void parse () const
 
void importDesktopFiles ()
 

Static Protected Member Functions

static void convertToXBEL (TQDomElement &group)
 
static void convertAttribute (TQDomElement elem, const TQString &oldName, const TQString &newName)
 

Detailed Description

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/)

A sample file looks like this :

<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>
KBookmarkManager::toolbar
KBookmarkGroup toolbar()
This returns the root of the toolbar menu.
Definition: kbookmarkmanager.cpp:388

Definition at line 51 of file kbookmarkmanager.h.

Constructor & Destructor Documentation

◆ KBookmarkManager() [1/2]

KBookmarkManager::KBookmarkManager ( const TQString &  bookmarksFile,
bool  bImportDesktopFiles = true 
)
protected

Creates a bookmark manager with a path to the bookmarks.

By default, it will use the KDE 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 before KBookmarkManager::managerForFile() is ever called.

Parameters
bookmarksFilefull path to the bookmarks file, Use ~/.trinity/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks
bImportDesktopFilesif true, and if the bookmarksFile doesn't already exist, import bookmarks from desktop files

Definition at line 128 of file kbookmarkmanager.cpp.

◆ KBookmarkManager() [2/2]

KBookmarkManager::KBookmarkManager ( )
protected
Since
3.2

Definition at line 153 of file kbookmarkmanager.cpp.

◆ ~KBookmarkManager()

KBookmarkManager::~KBookmarkManager ( )

Destructor.

Definition at line 174 of file kbookmarkmanager.cpp.

Member Function Documentation

◆ addBookmarkDialog()

KBookmarkGroup KBookmarkManager::addBookmarkDialog ( const TQString &  _url,
const TQString &  _title,
const TQString &  _parentBookmarkAddress = TQString::null 
)
Since
3.2

Definition at line 500 of file kbookmarkmanager.cpp.

◆ changed

void KBookmarkManager::changed ( const TQString &  groupAddress,
const TQString &  caller 
)
signal

Signals that the group (or any of its children) with the address groupAddress (e.g.

"/4/5") has been modified by the caller caller.

◆ convertAttribute()

void KBookmarkManager::convertAttribute ( TQDomElement  elem,
const TQString &  oldName,
const TQString &  newName 
)
staticprotected

Definition at line 306 of file kbookmarkmanager.cpp.

◆ convertToXBEL()

void KBookmarkManager::convertToXBEL ( TQDomElement &  group)
staticprotected

Definition at line 249 of file kbookmarkmanager.cpp.

◆ createTempManager()

KBookmarkManager * KBookmarkManager::createTempManager ( )
static

Definition at line 115 of file kbookmarkmanager.cpp.

◆ emitChanged()

void KBookmarkManager::emitChanged ( KBookmarkGroup &  group)

Saves the bookmark file and notifies everyone.

Parameters
groupthe parent of all changed bookmarks

Definition at line 539 of file kbookmarkmanager.cpp.

◆ emitConfigChanged()

void KBookmarkManager::emitConfigChanged ( )

Definition at line 556 of file kbookmarkmanager.cpp.

◆ findByAddress()

KBookmark KBookmarkManager::findByAddress ( const TQString &  address,
bool  tolerate = false 
)
Returns
the bookmark designated by address
Parameters
addressthe address belonging to the bookmark you're looking for
toleratewhen true tries to find the most tolerable bookmark position
See also
KBookmark::address

Definition at line 429 of file kbookmarkmanager.cpp.

◆ importDesktopFiles()

void KBookmarkManager::importDesktopFiles ( )
protected

Definition at line 315 of file kbookmarkmanager.cpp.

◆ internalDocument()

const TQDomDocument & KBookmarkManager::internalDocument ( ) const

Definition at line 185 of file kbookmarkmanager.cpp.

◆ managerForFile()

KBookmarkManager * KBookmarkManager::managerForFile ( const TQString &  bookmarksFile,
bool  bImportDesktopFiles = true 
)
static

This static function will return an instance of the KBookmarkManager, responsible for the given bookmarksFile.

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 must derive your own class and instantiate it before this method is ever called.

Parameters
bookmarksFilefull path to the bookmarks file, Use ~/.trinity/share/apps/konqueror/bookmarks.xml for the konqueror bookmarks
bImportDesktopFilesif true, and if the bookmarksFile doesn't already exist, import bookmarks from desktop files
Returns
a pointer to an instance of the KBookmarkManager.

Definition at line 98 of file kbookmarkmanager.cpp.

◆ notifier()

KBookmarkNotifier & KBookmarkManager::notifier ( )
inline

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 235 of file kbookmarkmanager.h.

◆ notifyChanged

void KBookmarkManager::notifyChanged ( TQString  groupAddress)

Emit the changed signal for the group whose address is given.

See also
KBookmark::address() Called by the instance of konqueror that saved the file after a small change (new bookmark or new folder).

Definition at line 581 of file kbookmarkmanager.cpp.

◆ notifyCompleteChange

void KBookmarkManager::notifyCompleteChange ( TQString  caller)

Reparse the whole bookmarks file and notify about the change (Called by the bookmark editor)

Definition at line 561 of file kbookmarkmanager.cpp.

◆ notifyConfigChanged

void KBookmarkManager::notifyConfigChanged ( )

Definition at line 574 of file kbookmarkmanager.cpp.

◆ parse()

void KBookmarkManager::parse ( ) const
protected

Definition at line 196 of file kbookmarkmanager.cpp.

◆ path()

TQString KBookmarkManager::path ( )
inline

This will return the path that this manager is using to read the bookmarks.

Definition at line 132 of file kbookmarkmanager.h.

◆ root()

KBookmarkGroup KBookmarkManager::root ( ) const

This will return the root bookmark.

It is used to iterate through the bookmarks manually. It is mostly used internally.

Returns
the root (top-level) bookmark

Definition at line 383 of file kbookmarkmanager.cpp.

◆ save()

bool KBookmarkManager::save ( bool  toolbarCache = true) const

Save the bookmarks to the default konqueror XML file on disk.

You should use emitChanged() instead of this function, it saves and notifies everyone that the file has changed.

Parameters
toolbarCacheiff true save a cache of the toolbar folder, too
Returns
true if saving was successful

Definition at line 325 of file kbookmarkmanager.cpp.

◆ saveAs()

bool KBookmarkManager::saveAs ( const TQString &  filename,
bool  toolbarCache = true 
) const

Save the bookmarks to the given XML file on disk.

Parameters
filenamefull path to the desired bookmarks file location
toolbarCacheiff true save a cache of the toolbar folder, too
Returns
true if saving was successful

Definition at line 330 of file kbookmarkmanager.cpp.

◆ setEditorOptions()

void KBookmarkManager::setEditorOptions ( const TQString &  caption,
bool  browser 
)

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.

Parameters
captionthe –caption string, for instance "Konsole"
browseriff false display no browser specific menu items in keditbookmarks :: –nobrowser
Since
3.2

Definition at line 612 of file kbookmarkmanager.cpp.

◆ setShowNSBookmarks()

void KBookmarkManager::setShowNSBookmarks ( bool  show)

Shows an extra menu for NS bookmarks.

Set this to false, if you don't want this.

Definition at line 601 of file kbookmarkmanager.cpp.

◆ setUpdate()

void KBookmarkManager::setUpdate ( bool  update)

Set the update flag.

Defaults to true. TODO - check

Parameters
updateif true then KBookmarkManager will listen to DCOP update requests.

Definition at line 180 of file kbookmarkmanager.cpp.

◆ showNSBookmarks()

bool KBookmarkManager::showNSBookmarks ( ) const
Returns
true if the NS bookmarks should be dynamically shown in the toplevel tdeactionmenu
Deprecated:

Definition at line 596 of file kbookmarkmanager.cpp.

◆ slotEditBookmarks

void KBookmarkManager::slotEditBookmarks ( )
slot

Definition at line 618 of file kbookmarkmanager.cpp.

◆ slotEditBookmarksAtAddress

void KBookmarkManager::slotEditBookmarksAtAddress ( const TQString &  address)
slot

Definition at line 630 of file kbookmarkmanager.cpp.

◆ toolbar()

KBookmarkGroup KBookmarkManager::toolbar ( )

This returns the root of the toolbar menu.

In the XML, this is the group with the attribute TOOLBAR=1

Returns
the toolbar group

Definition at line 388 of file kbookmarkmanager.cpp.

◆ updateAccessMetadata()

bool KBookmarkManager::updateAccessMetadata ( const TQString &  url,
bool  emitSignal = true 
)

Update access time stamps for a given url.

Parameters
urlthe viewed url
emitSignaliff true emit KBookmarkNotifier signal
Since
3.2
Returns
true if any metadata was modified (bookmarks file is not saved automatically)

Definition at line 649 of file kbookmarkmanager.cpp.

◆ updateFavicon()

void KBookmarkManager::updateFavicon ( const TQString &  url,
const TQString &  faviconurl,
bool  emitSignal = true 
)

Definition at line 670 of file kbookmarkmanager.cpp.

◆ userBookmarksFile()

TQString KBookmarkManager::userBookmarksFile ( )
static

Returns the path to the user's main bookmark collection file.

Since
3.5.5

Definition at line 695 of file kbookmarkmanager.cpp.

◆ userBookmarksManager()

KBookmarkManager * KBookmarkManager::userBookmarksManager ( )
static

Returns a pointer to the users main bookmark collection.

Since
3.2

Definition at line 700 of file kbookmarkmanager.cpp.


The documentation for this class was generated from the following files:
  • kbookmarkmanager.h
  • kbookmarkmanager.cpp

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/bookmarks by doxygen 1.9.4
This website is maintained by Timothy Pearson.