Akonadi Notes
noteutils.cpp
94 return d->mUrl == a.d_func()->mUrl && d->mDataBase64Encoded == a.d_func()->mDataBase64Encoded && d->mMimetype == a.d_func()->mMimetype
97 return d->mData == a.d_func()->mData && d->mDataBase64Encoded == a.d_func()->mDataBase64Encoded && d->mMimetype == a.d_func()->mMimetype
197 text = msg->mainBodyPart()->decodedText(true); // remove trailing whitespace, so we get rid of " " in empty notes
202 if (msg->mainBodyPart()->contentType(false) && msg->mainBodyPart()->contentType()->mimeType() == "text/html") {
217 if (KMime::Headers::Base *classificationHeader = msg->headerByType(X_NOTES_CLASSIFICATION_HEADER)) {
255 qWarning("Error loading document: %s, line %lld, column %lld", qPrintable(parseResult.errorMessage), parseResult.errorLine, parseResult.errorColumn);
290 qWarning("XML error: Top tag was %s instead of the expected custom", top.tagName().toLatin1().data());
344 Attachment attachment(QUrl(header->asUnicodeString()), QLatin1StringView(part->contentType()->mimeType()));
349 Attachment attachment(part->decodedContent(), QLatin1StringView(part->contentType()->mimeType()));
403 const QString formatDate = QLocale::c().toString(lastModifiedDate, QStringLiteral("ddd, ")) + lastModifiedDate.toString(Qt::RFC2822Date);
438 msg->mainBodyPart()->contentType(true)->setMimeType(d->textFormat == Qt::RichText ? "text/html" : "text/plain");
543 const QRegularExpression rx(QStringLiteral("<body[^>]*>(.*)</body>"), QRegularExpression::CaseInsensitiveOption);
void setContentID(const QString &contentID)
Sets the unique identifier of the attachment.
Definition noteutils.cpp:130
void setDataBase64Encoded(bool encoded)
Set this to true if inline data provided via ctor is already base64 encoded.
Definition noteutils.cpp:118
QString contentID() const
Returns the unique identifier for inline attachment.
Definition noteutils.cpp:136
void setLabel(const QString &label)
Sets the label to be presented to the user.
Definition noteutils.cpp:148
bool dataBase64Encoded() const
Returns true if data is already base64-encoded.
Definition noteutils.cpp:124
A convenience wrapper around KMime::MessagePtr for notes.
Definition noteutils.h:171
QMap< QString, QString > & custom()
Returns a reference to the custom-value map.
Definition noteutils.cpp:555
void setText(const QString &text, Qt::TextFormat format=Qt::PlainText)
Set the text of the note.
Definition noteutils.cpp:516
QList< Attachment > & attachments()
Returns a reference to the list of attachments of the note.
Definition noteutils.cpp:549
void setFrom(const QString &from)
Set the origin (creator) of the note (stored in the mime header) This is usually the application crea...
Definition noteutils.cpp:492
Qt::TextFormat textFormat() const
Definition noteutils.cpp:529
QDateTime lastModifiedDate() const
Returns the lastModified-date of the note.
Definition noteutils.cpp:474
void setClassification(Classification)
Set the classification of the note.
Definition noteutils.cpp:456
void setCreationDate(const QDateTime &creationDate)
Set the creation date of the note (stored in the mime header)
Definition noteutils.cpp:480
void setLastModifiedDate(const QDateTime &lastModifiedDate)
Set the lastModified-date of the note.
Definition noteutils.cpp:468
Classification classification() const
Returns the classification of the note.
Definition noteutils.cpp:462
KMime::MessagePtr message() const
Assemble a KMime message with the given values.
Definition noteutils.cpp:368
QString toPlainText() const
Definition noteutils.cpp:535
const Headers::ContentType * contentType() const
Headers::Base * headerByType(QByteArrayView type) const
QByteArray decodedContent() const
QByteArray body() const
const Headers::ContentID * contentID() const
QByteArray mimeType() const
QByteArray identifier() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
KIOCORE_EXPORT MimetypeJob * mimetype(const QUrl &url, JobFlags flags=DefaultFlags)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QString label(StandardShortcut id)
char * data()
QDateTime currentDateTime()
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
bool isValid() const const
QString toString(QStringView format, QCalendar cal) const const
QDomElement createElement(const QString &tagName)
QDomProcessingInstruction createProcessingInstruction(const QString &target, const QString &data)
QDomText createTextNode(const QString &value)
QDomElement documentElement() const const
ParseResult setContent(QAnyStringView text, ParseOptions options)
QString toString(int indent) const const
void setAttribute(const QString &name, const QString &value)
QString tagName() const const
QString text() const const
QDomNode appendChild(const QDomNode &newChild)
QDomNode firstChild() const const
bool isNull() const const
QDomDocument ownerDocument() const const
QDomElement toElement() const const
QLocale c()
QString toString(QDate date, FormatType format) const const
iterator begin()
iterator end()
iterator insert(const Key &key, const T &value)
QRegularExpressionMatch match(QStringView subjectView, qsizetype offset, MatchType matchType, MatchOptions matchOptions) const const
CaseInsensitiveOption
QString captured(QStringView name) const const
QString fromLatin1(QByteArrayView str)
QString mid(qsizetype position, qsizetype n) const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QString toHtmlEscaped() const const
QByteArray toLatin1() const const
QString trimmed() const const
RFC2822Date
TextFormat
QUuid createUuid()
QString toString(StringFormat mode) const const
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.