KBookmarks
kbookmark.cpp
116 return element.attribute(QStringLiteral("folded")) == QLatin1String("no"); // default is: folded
149 if (tag == QLatin1String("folder") || tag == QLatin1String("bookmark") || tag == QLatin1String("separator")) {
253 for (QDomElement e = element.firstChildElement(QStringLiteral("folder")); !e.isNull(); e = e.nextSiblingElement(QStringLiteral("folder"))) {
400 QDomElement iconElement = cd_or_create(metaDataNode, QStringLiteral("bookmark:icon")).toElement();
440 QDomElement mimeTypeElement = cd(metaDataNode, QStringLiteral("mime:mime-type"), false).toElement();
447 QDomElement iconElement = cd_or_create(metaDataNode, QStringLiteral("mime:mime-type")).toElement();
463 setMetaDataItem(QStringLiteral("showintoolbar"), show ? QStringLiteral("yes") : QStringLiteral("no"));
573 return pp > 0 ? parentAddress(address) + QLatin1Char('/') + QString::number(pp - 1) : QString();
578 return parentAddress(address) + QLatin1Char('/') + QString::number(positionInParent(address) + 1);
593 for (QDomElement e = metaDataNode.firstChildElement(); !e.isNull(); e = e.nextSiblingElement()) {
601void KBookmark::setMetaDataItem(const QString &key, const QString &value, MetaDataOverwriteMode mode)
722 bookmarks.append(KBookmark::standaloneBookmark(url.toDisplayString(), url, QString() /*TODO icon*/));
KBookmark next(const KBookmark ¤t) const
Return the next sibling of a child bookmark of this group.
Definition kbookmark.cpp:129
void deleteBookmark(const KBookmark &bk)
Delete a bookmark - it has to be one of our children ! Don't forget to use KBookmarkManager::self()->...
Definition kbookmark.cpp:238
KBookmark previous(const KBookmark ¤t) const
Return the previous sibling of a child bookmark of this group.
Definition kbookmark.cpp:124
bool moveBookmark(const KBookmark &bookmark, const KBookmark &after)
Moves bookmark after after (which should be a child of ours).
Definition kbookmark.cpp:187
KBookmark createNewSeparator()
Create a new bookmark separator Don't forget to use KBookmarkManager::self()->emitChanged( parentBook...
Definition kbookmark.cpp:175
KBookmark addBookmark(const KBookmark &bm)
Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->...
Definition kbookmark.cpp:212
int indexOf(const KBookmark &child) const
Return the index of a child bookmark, -1 if not found.
Definition kbookmark.cpp:134
KBookmarkGroup createNewFolder(const QString &text)
Create a new bookmark folder, as the last child of this group.
Definition kbookmark.cpp:161
KBookmark::List is a QList that contains bookmarks with a few convenience methods.
Definition kbookmark.h:43
static KBookmark::List fromMimeData(const QMimeData *mimeData, QDomDocument &parentDocument)
Extract a list of bookmarks from the contents of mimeData.
Definition kbookmark.cpp:704
static bool canDecode(const QMimeData *mimeData)
Return true if mimeData contains bookmarks.
Definition kbookmark.cpp:694
static QStringList mimeDataTypes()
Return the list of mimeTypes that can be decoded by fromMimeData.
Definition kbookmark.cpp:699
void populateMimeData(QMimeData *mimeData) const
Adds this list of bookmark into the given QMimeData.
Definition kbookmark.cpp:675
QString text() const
Text shown for the bookmark If bigger than 40, the text is shortened by replacing middle characters w...
Definition kbookmark.cpp:308
static QString nextAddress(const QString &address)
Definition kbookmark.cpp:576
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...
Definition kbookmark.cpp:601
void updateAccessMetadata()
Updates the bookmarks access metadata Call when a user accesses the bookmark.
Definition kbookmark.cpp:540
QDomNode metaData(const QString &owner, bool create) const
Definition kbookmark.cpp:581
bool isGroup() const
Whether the bookmark is a group or a normal bookmark.
Definition kbookmark.cpp:285
KBookmarkGroup toGroup() const
Convert this to a group - do this only if isGroup() returns true.
Definition kbookmark.cpp:471
static QString commonParent(const QString &A, const QString &B)
Definition kbookmark.cpp:515
void setDescription(const QString &description)
Set the description of the bookmark.
Definition kbookmark.cpp:420
static QString previousAddress(const QString &address)
Definition kbookmark.cpp:570
void setMimeType(const QString &mimeType)
Set the Mime-Type of this item.
Definition kbookmark.cpp:444
static QString parentAddress(const QString &address)
Definition kbookmark.cpp:560
void setFullText(const QString &fullText)
Set the text shown for the bookmark.
Definition kbookmark.cpp:324
QString address() const
Return the "address" of this bookmark in the whole tree.
Definition kbookmark.cpp:477
void setShowInToolbar(bool show)
Set whether this bookmark is show in a filterd toolbar.
Definition kbookmark.cpp:461
void populateMimeData(QMimeData *mimeData) const
Adds this bookmark into the given QMimeData.
Definition kbookmark.cpp:663
static KBookmark standaloneBookmark(const QString &text, const QUrl &url, const QString &icon)
Creates a stand alone bookmark.
Definition kbookmark.cpp:505
QString metaDataItem(const QString &key) const
Get the value of a specific metadata item (owner = "http://www.kde.org").
Definition kbookmark.cpp:590
Q_SCRIPTABLE Q_NOREPLY void start()
KCOREADDONS_EXPORT QString csqueeze(const QString &str, int maxlen=40)
KCOREADDONS_EXPORT QStringList mimeDataTypes()
KCOREADDONS_EXPORT QList< QUrl > urlsFromMimeData(const QMimeData *mimeData, DecodeOptions decodeOptions=PreferKdeUrls, MetaDataMap *metaData=nullptr)
bool isEmpty() const const
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
QDateTime currentDateTimeUtc()
qint64 toSecsSinceEpoch() const const
void setData(const QString &v)
QDomElement createElement(const QString &tagName)
QDomText createTextNode(const QString &value)
QDomElement documentElement() const const
ParseResult setContent(QAnyStringView text, ParseOptions options)
QByteArray toByteArray(int indent) const const
QString attribute(const QString &name, const QString &defValue) const const
bool hasAttribute(const QString &name) const const
void removeAttribute(const QString &name)
void setAttribute(const QString &name, const QString &value)
QString tagName() const const
QString text() const const
QDomNode appendChild(const QDomNode &newChild)
QDomNodeList childNodes() const const
QDomNode firstChild() const const
QDomElement firstChildElement(const QString &tagName, const QString &namespaceURI) const const
QDomNode insertAfter(const QDomNode &newChild, const QDomNode &refChild)
QDomNode insertBefore(const QDomNode &newChild, const QDomNode &refChild)
bool isNull() const const
QDomNode namedItem(const QString &name) const const
QDomElement nextSiblingElement(const QString &tagName, const QString &namespaceURI) const const
QDomDocument ownerDocument() const const
QDomNode parentNode() const const
QDomElement previousSiblingElement(const QString &tagName, const QString &namespaceURI) const const
QDomNode removeChild(const QDomNode &oldChild)
QDomElement toElement() const const
QDomText toText() const const
int count() const const
QDomNode item(int index) const const
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
iterator begin()
qsizetype count() const const
iterator end()
bool isEmpty() const const
void reserve(qsizetype size)
qsizetype size() const const
QByteArray data(const QString &mimeType) const const
virtual bool hasFormat(const QString &mimeType) const const
bool hasUrls() const const
void setData(const QString &mimeType, const QByteArray &data)
void setUrls(const QList< QUrl > &urls)
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
QMimeType mimeTypeForUrl(const QUrl &url) const const
iconName
bool isValid() const const
T pop()
void push(const T &t)
T & top()
QChar * data()
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
qsizetype length() const const
QString number(double n, char format, int precision)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
int toInt(bool *ok, int base) const const
QStringView mid(qsizetype start, qsizetype length) const const
int toInt(bool *ok, int base) const const
FullyEncoded
QString toDisplayString(FormattingOptions options) const const
QString toString(FormattingOptions options) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.