akonadi
noteutils.cpp
180 void NoteMessageWrapper::NoteMessageWrapperPrivate::readMimeMessage(const KMime::Message::Ptr& msg)
187 text = msg->mainBodyPart()->decodedText( true ); //remove trailing whitespace, so we get rid of " " in empty notes
191 if ( msg->mainBodyPart()->contentType( false ) && msg->mainBodyPart()->contentType()->mimeType() == "text/html" ) {
207 if (KMime::Headers::Base *classificationHeader = msg->headerByType(X_NOTES_CLASSIFICATION_HEADER)) {
247 qWarning( "Error loading document: %s, line %d, column %d", qPrintable( errorMsg ), errorLine, errorColumn );
256 content->appendHeader( new KMime::Headers::Generic( X_NOTES_CONTENTTYPE_HEADER, content, CONTENT_TYPE_CUSTOM, ENCODING ) );
260 for ( QMap <QString, QString >::const_iterator it = custom.begin(); it != custom.end(); ++it ) {
295 KMime::Content* NoteMessageWrapper::NoteMessageWrapperPrivate::createAttachmentPart( const Attachment &a ) const
298 content->appendHeader( new KMime::Headers::Generic( X_NOTES_CONTENTTYPE_HEADER, content, CONTENT_TYPE_ATTACHMENT, ENCODING ) );
300 content->appendHeader( new KMime::Headers::Generic( X_NOTES_URL_HEADER, content, a.url().toString().toLatin1(), ENCODING ) );
306 content->appendHeader( new KMime::Headers::Generic( X_NOTES_LABEL_HEADER, content, a.label().toLatin1(), ENCODING ) );
382 msg->mainBodyPart()->contentType( true )->setMimeType( d->textFormat == Qt::RichText ? "text/html" : "text/plain" );
383 msg->appendHeader( new KMime::Headers::Generic(X_NOTES_LASTMODIFIED_HEADER, msg.get(), lastModifiedDate.toString( KDateTime::RFCDateDay ).toLatin1(), ENCODING ) );
384 msg->appendHeader( new KMime::Headers::Generic( X_NOTES_UID_HEADER, msg.get(), uid, ENCODING ) );
398 msg->appendHeader( new KMime::Headers::Generic( X_NOTES_CLASSIFICATION_HEADER, msg.get(), classification, ENCODING ) );
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:460
Classification classification() const
Returns the classification of the note.
Definition: noteutils.cpp:430
QString cap(int nth) const
QString & append(QChar ch)
QDomProcessingInstruction createProcessingInstruction(const QString &target, const QString &data)
QDomNode appendChild(const QDomNode &newChild)
Qt::TextFormat textFormat() const
Definition: noteutils.cpp:497
QString toString(int indent) const
void setText(const QString &text, Qt::TextFormat format=Qt::PlainText)
Set the text of the note.
Definition: noteutils.cpp:484
QDomElement documentElement() const
int length() const
QString & remove(int position, int n)
void setClassification(Classification)
Set the classification of the note.
Definition: noteutils.cpp:424
QDomElement toElement() const
void setLastModifiedDate(const KDateTime &lastModifiedDate)
Set the lastModified-date of the note.
Definition: noteutils.cpp:436
int indexIn(const QString &str, int offset, CaretMode caretMode) const
KDateTime lastModifiedDate() const
Returns the lastModified-date of the note.
Definition: noteutils.cpp:442
QDomDocument ownerDocument() const
QString text() const
void setAttribute(const QString &name, const QString &value)
QString trimmed() const
const char * constData() const
void setCreationDate(const KDateTime &creationDate)
Set the creation date of the note (stored in the mime header)
Definition: noteutils.cpp:448
QString toPlainText() const
Definition: noteutils.cpp:503
void setLabel(const QString &label)
Sets the label to be presented to the user.
Definition: noteutils.cpp:133
A convenience wrapper around KMime::Message::Ptr for notes.
Definition: noteutils.h:144
Attachment(const QUrl &url, const QString &mimetype)
Create an attachment referencing a url only.
Definition: noteutils.cpp:76
iterator begin()
QDomText createTextNode(const QString &value)
bool isNull() const
QMap< QString, QString > & custom()
Returns a reference to the custom-value map.
Definition: noteutils.cpp:524
QList< Attachment > & attachments()
Returns a reference to the list of attachments of the note.
Definition: noteutils.cpp:518
QDomNode firstChild() const
QByteArray toLatin1() const
QString escape(const QString &plain)
char * data()
QString fromLatin1(const char *str, int size)
QString tagName() const
QDomElement createElement(const QString &tagName)
QUuid createUuid()
KMime::MessagePtr message() const
Assemble a KMime message with the given values.
Definition: noteutils.cpp:346
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.