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

KIO

KBookmark Class Reference

#include <kbookmark.h>

Inheritance diagram for KBookmark:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 33 of file kbookmark.h.


Public Types

enum  MetaDataOverwriteMode { OverwriteMetaData, DontOverwriteMetaData }

Public Member Functions

 KBookmark ()
 KBookmark (const QDomElement &elem)
bool isGroup () const
bool isSeparator () const
bool isNull () const
bool hasParent () const
QString text () const
QString fullText () const
void setFullText (const QString &fullText)
KUrl url () const
void setUrl (const KUrl &url)
QString icon () const
void setIcon (const QString &icon)
bool showInToolbar () const
void setShowInToolbar (bool show)
KBookmarkGroup parentGroup () const
KBookmarkGroup toGroup () const
QString address () const
int positionInParent () const
QDomElement internalElement () const
void updateAccessMetadata ()
QString metaDataItem (const QString &key) const
void setMetaDataItem (const QString &key, const QString &value, MetaDataOverwriteMode mode=OverwriteMetaData)
void populateMimeData (QMimeData *mimeData) const
bool operator== (const KBookmark &rhs) const

Static Public Member Functions

static KBookmark standaloneBookmark (const QString &text, const KUrl &url, const QString &icon=QString())
static QString parentAddress (const QString &address)
static uint positionInParent (const QString &address)
static QString previousAddress (const QString &address)
static QString nextAddress (const QString &address)
static QString commonParent (const QString &A, const QString &B)

Protected Attributes

QDomElement element

Friends

class KBookmarkGroup

Classes

class  List
 KUrl::Bookmark is a QList that contains bookmarks with a few convenience methods. More...

Member Enumeration Documentation

enum KBookmark::MetaDataOverwriteMode

Enumerator:
OverwriteMetaData 
DontOverwriteMetaData 

Definition at line 37 of file kbookmark.h.


Constructor & Destructor Documentation

KBookmark::KBookmark (  ) 

Constructs a null bookmark, i.e.

a bookmark for which isNull() returns true If you want to create a new bookmark use eitehr KBookmarkGroup.addBookmark or if you want an interactive dialog use KBookmarkDialog.

Definition at line 214 of file kbookmark.cc.

KBookmark::KBookmark ( const QDomElement &  elem  )  [explicit]

Creates the KBookmark wrapper for.

Parameters:
elem Mostly for internal usage.

Definition at line 218 of file kbookmark.cc.


Member Function Documentation

KBookmark KBookmark::standaloneBookmark ( const QString &  text,
const KUrl &  url,
const QString &  icon = QString() 
) [static]

Creates a stand alone bookmark.

This is fairly expensive since a new QDom Tree is build.

Definition at line 372 of file kbookmark.cc.

bool KBookmark::isGroup (  )  const

Whether the bookmark is a group or a normal bookmark.

Definition at line 222 of file kbookmark.cc.

bool KBookmark::isSeparator (  )  const

Whether the bookmark is a separator.

Definition at line 229 of file kbookmark.cc.

bool KBookmark::isNull (  )  const

Returns:
true if this is a null bookmark.

This will never be the case for a real bookmark (in a menu), but it's used for instance as the end condition for KBookmarkGroup::next()

Definition at line 234 of file kbookmark.cc.

bool KBookmark::hasParent (  )  const

Returns:
true if bookmark is contained by a QDomDocument, if not it is most likely that it has become separated and is thus invalid and/or has been deleted from the bookmarks.

Definition at line 239 of file kbookmark.cc.

QString KBookmark::text (  )  const

Text shown for the bookmark If bigger than 40, the text is shortened by replacing middle characters with "..." (see KStringHandler::csqueeze).

Definition at line 245 of file kbookmark.cc.

QString KBookmark::fullText (  )  const

Text shown for the bookmark, not truncated.

You should not use this - this is mainly for keditbookmarks.

Definition at line 250 of file kbookmark.cc.

void KBookmark::setFullText ( const QString &  fullText  ) 

Set the text shown for the bookmark.

Parameters:
fullText the new bookmark title

Definition at line 258 of file kbookmark.cc.

KUrl KBookmark::url (  )  const

URL contained by the bookmark.

Definition at line 275 of file kbookmark.cc.

void KBookmark::setUrl ( const KUrl &  url  ) 

Set the URL of the bookmark.

Parameters:
url the new bookmark URL

Definition at line 280 of file kbookmark.cc.

QString KBookmark::icon (  )  const

Returns:
the pixmap file for this bookmark (i.e.

the name of the icon)

Definition at line 285 of file kbookmark.cc.

void KBookmark::setIcon ( const QString &  icon  ) 

Set the icon name of the bookmark.

Parameters:
icon the new icon name for this bookmark

Definition at line 309 of file kbookmark.cc.

bool KBookmark::showInToolbar (  )  const

Returns:
if the bookmark should be shown in the toolbar (used by the filtered toolbar)

Definition at line 314 of file kbookmark.cc.

void KBookmark::setShowInToolbar ( bool  show  ) 

Set wheter this bookmark is show in a filterd toolbar.

Definition at line 326 of file kbookmark.cc.

KBookmarkGroup KBookmark::parentGroup (  )  const

Returns:
the group containing this bookmark

Definition at line 331 of file kbookmark.cc.

KBookmarkGroup KBookmark::toGroup (  )  const

Convert this to a group - do this only if isGroup() returns true.

Definition at line 336 of file kbookmark.cc.

QString KBookmark::address (  )  const

Return the "address" of this bookmark in the whole tree.

This is used when telling other processes about a change in a given bookmark. The encoding of the address is "/4/2", for instance, to designate the 2nd child inside the 4th child of the root bookmark.

Definition at line 342 of file kbookmark.cc.

int KBookmark::positionInParent (  )  const

Return the position in the parent, i.e.

the last number in the address

Definition at line 362 of file kbookmark.cc.

QDomElement KBookmark::internalElement (  )  const

Definition at line 367 of file kbookmark.cc.

void KBookmark::updateAccessMetadata (  ) 

Updates the bookmarks access metadata Call when a user accesses the bookmark.

Definition at line 451 of file kbookmark.cc.

QString KBookmark::parentAddress ( const QString &  address  )  [static]

Returns:
address of parent

Definition at line 470 of file kbookmark.cc.

uint KBookmark::positionInParent ( const QString &  address  )  [static]

Returns:
position in parent (e.g.

/4/5/2 -> 2)

Definition at line 475 of file kbookmark.cc.

QString KBookmark::previousAddress ( const QString &  address  )  [static]

Returns:
address of previous sibling (e.g.

/4/5/2 -> /4/5/1) Returns QString() for a first child

Definition at line 480 of file kbookmark.cc.

QString KBookmark::nextAddress ( const QString &  address  )  [static]

Returns:
address of next sibling (e.g.

/4/5/2 -> /4/5/3) This doesn't check whether it actually exists

Definition at line 488 of file kbookmark.cc.

QString KBookmark::commonParent ( const QString &  A,
const QString &  B 
) [static]

Returns:
the common parent of both addresses which has the greatest depth

Definition at line 383 of file kbookmark.cc.

QString KBookmark::metaDataItem ( const QString &  key  )  const

Get the value of a specific metadata item.

Parameters:
key Name of the metadata item
Returns:
Value of the metadata item. QString() is returned in case the specified key does not exist.

Definition at line 494 of file kbookmark.cc.

void KBookmark::setMetaDataItem ( const QString &  key,
const QString &  value,
MetaDataOverwriteMode  mode = OverwriteMetaData 
)

Change the value of a specific metadata item, or create the given item if it doesn't exist already.

Parameters:
key Name of the metadata item to change
value Value to use for the specified metadata item
mode Whether to overwrite the item's value if it exists already or not.

Definition at line 510 of file kbookmark.cc.

void KBookmark::populateMimeData ( QMimeData *  mimeData  )  const

Adds this bookmark into the given QMimeData.

WARNING: do not call this method multiple times, use KBookmark::List::populateMimeData instead.

Parameters:
mimeData the QMimeData instance used to drag or copy this bookmark

Definition at line 574 of file kbookmark.cc.

bool KBookmark::operator== ( const KBookmark &  rhs  )  const

Comparison operator.

Definition at line 525 of file kbookmark.cc.


Friends And Related Function Documentation

friend class KBookmarkGroup [friend]

Definition at line 35 of file kbookmark.h.


Member Data Documentation

QDomElement KBookmark::element [protected]

Definition at line 281 of file kbookmark.h.


The documentation for this class was generated from the following files:
  • kbookmark.h
  • kbookmark.cc

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
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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