KBookmarks 5.109.0
|
A class representing a bookmark. More...
#include <KBookmark>
Classes | |
class | List |
KBookmark::List is a QList that contains bookmarks with a few convenience methods. More... | |
Public Types | |
enum | MetaDataOverwriteMode { OverwriteMetaData , DontOverwriteMetaData } |
Public Member Functions | |
KBookmark () | |
Constructs a null bookmark, i.e. | |
KBookmark (const QDomElement &elem) | |
Creates the KBookmark wrapper for. | |
QString | address () const |
Return the "address" of this bookmark in the whole tree. | |
QString | description () const |
QString | fullText () const |
Text shown for the bookmark, not truncated. | |
bool | hasParent () const |
QString | icon () const |
QDomElement | internalElement () const |
bool | isGroup () const |
Whether the bookmark is a group or a normal bookmark. | |
bool | isNull () const |
bool | isSeparator () const |
Whether the bookmark is a separator. | |
QDomNode | metaData (const QString &owner, bool create) const |
QString | metaDataItem (const QString &key) const |
Get the value of a specific metadata item (owner = "http://www.kde.org"). | |
QString | mimeType () const |
bool | operator== (const KBookmark &rhs) const |
Comparison operator. | |
KBookmarkGroup | parentGroup () const |
void | populateMimeData (QMimeData *mimeData) const |
Adds this bookmark into the given QMimeData. | |
int | positionInParent () const |
Return the position in the parent, i.e. | |
void | setDescription (const QString &description) |
Set the description of the bookmark. | |
void | setFullText (const QString &fullText) |
Set the text shown for the bookmark. | |
void | setIcon (const QString &icon) |
Set the icon name of the bookmark. | |
void | 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 (owner = "http://www.kde.org"). | |
void | setMimeType (const QString &mimeType) |
Set the Mime-Type of this item. | |
void | setShowInToolbar (bool show) |
Set whether this bookmark is show in a filterd toolbar. | |
void | setUrl (const QUrl &url) |
Set the URL of the bookmark. | |
bool | showInToolbar () const |
QString | text () const |
Text shown for the bookmark If bigger than 40, the text is shortened by replacing middle characters with "..." (see KStringHandler::csqueeze) | |
KBookmarkGroup | toGroup () const |
Convert this to a group - do this only if isGroup() returns true. | |
void | updateAccessMetadata () |
Updates the bookmarks access metadata Call when a user accesses the bookmark. | |
QUrl | url () const |
URL contained by the bookmark. | |
Static Public Member Functions | |
static QString | commonParent (const QString &A, const QString &B) |
static QString | nextAddress (const QString &address) |
static QString | parentAddress (const QString &address) |
static uint | positionInParent (const QString &address) |
static QString | previousAddress (const QString &address) |
static KBookmark | standaloneBookmark (const QString &text, const QUrl &url, const QString &icon) |
Creates a stand alone bookmark. | |
Protected Attributes | |
QDomElement | element |
A class representing a bookmark.
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.
|
explicit |
Creates the KBookmark wrapper for.
elem | Mostly for internal usage. |
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.
|
static |
QString KBookmark::description | ( | ) | const |
QString KBookmark::fullText | ( | ) | const |
Text shown for the bookmark, not truncated.
You should not use this - this is mainly for keditbookmarks.
bool KBookmark::hasParent | ( | ) | const |
QString KBookmark::icon | ( | ) | const |
bool KBookmark::isGroup | ( | ) | const |
Whether the bookmark is a group or a normal bookmark.
bool KBookmark::isNull | ( | ) | const |
bool KBookmark::isSeparator | ( | ) | const |
Whether the bookmark is a separator.
QDomNode KBookmark::metaData | ( | const QString & | owner, |
bool | create | ||
) | const |
QString KBookmark::metaDataItem | ( | const QString & | key | ) | const |
Get the value of a specific metadata item (owner = "http://www.kde.org").
key | Name of the metadata item |
QString KBookmark::mimeType | ( | ) | const |
|
static |
bool KBookmark::operator== | ( | const KBookmark & | rhs | ) | const |
Comparison operator.
|
static |
KBookmarkGroup KBookmark::parentGroup | ( | ) | const |
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.
mimeData | the QMimeData instance used to drag or copy this bookmark |
int KBookmark::positionInParent | ( | ) | const |
Return the position in the parent, i.e.
the last number in the address
|
static |
|
static |
void KBookmark::setDescription | ( | const QString & | description | ) |
Set the description of the bookmark.
description |
void KBookmark::setFullText | ( | const QString & | fullText | ) |
Set the text shown for the bookmark.
fullText | the new bookmark title |
void KBookmark::setIcon | ( | const QString & | icon | ) |
Set the icon name of the bookmark.
icon | the new icon name for this bookmark |
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 (owner = "http://www.kde.org").
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. |
void KBookmark::setMimeType | ( | const QString & | mimeType | ) |
Set the Mime-Type of this item.
Mime-Type |
void KBookmark::setShowInToolbar | ( | bool | show | ) |
Set whether this bookmark is show in a filterd toolbar.
void KBookmark::setUrl | ( | const QUrl & | url | ) |
Set the URL of the bookmark.
url | the new bookmark URL |
bool KBookmark::showInToolbar | ( | ) | const |
|
static |
Creates a stand alone bookmark.
This is fairly expensive since a new QDom Tree is build.
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)
KBookmarkGroup KBookmark::toGroup | ( | ) | const |
Convert this to a group - do this only if isGroup() returns true.
void KBookmark::updateAccessMetadata | ( | ) |
Updates the bookmarks access metadata Call when a user accesses the bookmark.
QUrl KBookmark::url | ( | ) | const |
URL contained by the bookmark.