10#include <kbookmarks_export.h>
32 enum MetaDataOverwriteMode {
34 DontOverwriteMetaData,
43 class KBOOKMARKS_EXPORT
List :
public QList<KBookmark>
236 QDomElement internalElement()
const;
278 QDomNode
metaData(
const QString &owner,
bool create)
const;
295 void setMetaDataItem(
const QString &key,
const QString &value, MetaDataOverwriteMode mode = OverwriteMetaData);
413 QDomElement findToolbar()
const;
421 QDomElement nextKnownTag(
const QDomElement &start,
bool goNext)
const;
443#define KIO_KBOOKMARK_METATYPE_DEFINED 1
447#if defined(Q_CC_MSVC) && defined(KF5Bookmarks_EXPORTS)
450 qWarning(
"inline uint qHash(const KBookmark&) was called");
A class to traverse bookarm groups.
Definition kbookmark.h:434
A group of bookmarks.
Definition kbookmark.h:323
bool isToolbarGroup() const
KBookmark next(const KBookmark ¤t) const
Return the next sibling of a child bookmark of this group.
KBookmark first() const
Return the first child bookmark of this group.
void deleteBookmark(const KBookmark &bk)
Delete a bookmark - it has to be one of our children ! Don't forget to use KBookmarkManager::self()->...
KBookmarkGroup()
Create an invalid group.
KBookmark previous(const KBookmark ¤t) const
Return the previous sibling of a child bookmark of this group.
bool moveBookmark(const KBookmark &bookmark, const KBookmark &after)
Moves bookmark after after (which should be a child of ours).
KBookmark addBookmark(const QString &text, const QUrl &url, const QString &icon)
Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->...
KBookmark createNewSeparator()
Create a new bookmark separator Don't forget to use KBookmarkManager::self()->emitChanged( parentBook...
KBookmark addBookmark(const KBookmark &bm)
Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->...
int indexOf(const KBookmark &child) const
Return the index of a child bookmark, -1 if not found.
KBookmarkGroup(const QDomElement &elem)
Create a bookmark group as specified by the given element.
QList< QUrl > groupUrlList() const
KBookmarkGroup createNewFolder(const QString &text)
Create a new bookmark folder, as the last child of this group.
This class implements the reading/writing of bookmarks in XML.
Definition kbookmarkmanager.h:52
KBookmark::List is a QList that contains bookmarks with a few convenience methods.
Definition kbookmark.h:44
static KBookmark::List fromMimeData(const QMimeData *mimeData, QDomDocument &parentDocument)
Extract a list of bookmarks from the contents of mimeData.
static QStringList mimeDataTypes()
Return the list of mimeTypes that can be decoded by fromMimeData.
static bool canDecode(const QMimeData *mimeData)
Return true if mimeData contains bookmarks.
void populateMimeData(QMimeData *mimeData) const
Adds this list of bookmark into the given QMimeData.
A class representing a bookmark.
Definition kbookmark.h:28
QString text() const
Text shown for the bookmark If bigger than 40, the text is shortened by replacing middle characters w...
KBookmarkGroup parentGroup() const
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 (o...
static QString nextAddress(const QString &address)
void updateAccessMetadata()
Updates the bookmarks access metadata Call when a user accesses the bookmark.
KBookmark()
Constructs a null bookmark, i.e.
QString description() const
bool showInToolbar() const
QDomNode metaData(const QString &owner, bool create) const
bool isGroup() const
Whether the bookmark is a group or a normal bookmark.
QString fullText() const
Text shown for the bookmark, not truncated.
static KBookmark standaloneBookmark(const QString &text, const QUrl &url, const QString &icon)
Creates a stand alone bookmark.
static QString previousAddress(const QString &address)
KBookmarkGroup toGroup() const
Convert this to a group - do this only if isGroup() returns true.
bool isSeparator() const
Whether the bookmark is a separator.
static QString parentAddress(const QString &address)
int positionInParent() const
Return the position in the parent, i.e.
void setDescription(const QString &description)
Set the description of the bookmark.
void setUrl(const QUrl &url)
Set the URL of the bookmark.
void setMimeType(const QString &mimeType)
Set the Mime-Type of this item.
static uint positionInParent(const QString &address)
void setFullText(const QString &fullText)
Set the text shown for the bookmark.
QString address() const
Return the "address" of this bookmark in the whole tree.
bool operator==(const KBookmark &rhs) const
Comparison operator.
KBookmark(const QDomElement &elem)
Creates the KBookmark wrapper for.
static QString commonParent(const QString &A, const QString &B)
void setIcon(const QString &icon)
Set the icon name of the bookmark.
void setShowInToolbar(bool show)
Set whether this bookmark is show in a filterd toolbar.
void populateMimeData(QMimeData *mimeData) const
Adds this bookmark into the given QMimeData.
QUrl url() const
URL contained by the bookmark.
QString metaDataItem(const QString &key) const
Get the value of a specific metadata item (owner = "http://www.kde.org").