KBookmark Class Reference
from PyKDE4.kio import *
Subclasses: KBookmarkGroup
Detailed Description
Method Documentation
__init__ | ( | self ) |
__init__ | ( | self, | ||
QDomElement | elem | |||
) |
Creates the KBookmark wrapper for
- Parameters:
-
elem Mostly for internal usage.
QString address | ( | self ) |
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.
- Returns:
- the common parent of both addresses which has the greatest depth
QString fullText | ( | self ) |
Text shown for the bookmark, not truncated. You should not use this - this is mainly for keditbookmarks.
bool hasParent | ( | self ) |
- 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.
QString icon | ( | self ) |
- Returns:
- the pixmap file for this bookmark (i.e. the name of the icon)
QDomElement internalElement | ( | self ) |
- Internal:
- for KEditBookmarks
bool isGroup | ( | self ) |
Whether the bookmark is a group or a normal bookmark
bool isNull | ( | self ) |
- 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()
bool isSeparator | ( | self ) |
Whether the bookmark is a separator
- Returns:
- the metadata container node for a certain matadata owner
- Since:
- 4.1
Get the value of a specific metadata item (owner = "http://www.kde.org").
- Parameters:
-
key Name of the metadata item
- Returns:
- Value of the metadata item. QString() is returned in case the specified key does not exist.
QString mimeType | ( | self ) |
- Returns:
- Mime-Type of this item
- Since:
- 4.1
- Returns:
- address of next sibling (e.g. /4/5/2 -> /4/5/3) This doesn't check whether it actually exists
bool operator == | ( | self, | ||
KBookmark | rhs | |||
) |
Comparison operator
KBookmarkGroup parentGroup | ( | self ) |
- Returns:
- the group containing this bookmark
populateMimeData | ( | self, | ||
QMimeData | mimeData | |||
) |
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
int positionInParent | ( | self ) |
Return the position in the parent, i.e. the last number in the address
long positionInParent | ( | QString | address | |
) |
- Returns:
- position in parent (e.g. /4/5/2 -> 2)
- Returns:
- address of previous sibling (e.g. /4/5/2 -> /4/5/1) Returns QString() for a first child
setFullText | ( | self, | ||
QString | fullText | |||
) |
Set the text shown for the bookmark.
- Parameters:
-
fullText the new bookmark title
setIcon | ( | self, | ||
QString | icon | |||
) |
Set the icon name of the bookmark
- Parameters:
-
icon the new icon name for this bookmark
setMetaDataItem | ( | self, | ||
QString | key, | |||
QString | value, | |||
KBookmark.MetaDataOverwriteMode | mode=KBookmark.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").
- 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.
setMimeType | ( | self, | ||
QString | mimeType | |||
) |
Set the Mime-Type of this item
- Parameters:
-
Mime-Type
- Since:
- 4.1
setShowInToolbar | ( | self, | ||
bool | show | |||
) |
Set whether this bookmark is show in a filterd toolbar
setUrl | ( | self, | ||
KUrl | url | |||
) |
Set the URL of the bookmark
- Parameters:
-
url the new bookmark URL
bool showInToolbar | ( | self ) |
- Returns:
- if the bookmark should be shown in the toolbar (used by the filtered toolbar)
Creates a stand alone bookmark. This is fairly expensive since a new QDom Tree is build.
QString text | ( | self ) |
Text shown for the bookmark If bigger than 40, the text is shortened by replacing middle characters with "..." (see KStringHandler.csqueeze)
KBookmarkGroup toGroup | ( | self ) |
Convert this to a group - do this only if isGroup() returns true.
updateAccessMetadata | ( | self ) |
Updates the bookmarks access metadata Call when a user accesses the bookmark
KUrl url | ( | self ) |
URL contained by the bookmark
Enumeration Documentation
MetaDataOverwriteMode |
- Enumerator:
-
OverwriteMetaData DontOverwriteMetaData