Akonadi::NoteUtils::NoteMessageWrapper
#include <noteutils.h>
Public Types | |
enum | Classification { Public , Private , Confidential } |
Public Member Functions | |
NoteMessageWrapper (const KMime::MessagePtr &msg) | |
QList< Attachment > & | attachments () |
Classification | classification () const |
QDateTime | creationDate () const |
QMap< QString, QString > & | custom () |
QString | from () const |
QDateTime | lastModifiedDate () const |
KMime::MessagePtr | message () const |
void | setClassification (Classification) |
void | setCreationDate (const QDateTime &creationDate) |
void | setFrom (const QString &from) |
void | setLastModifiedDate (const QDateTime &lastModifiedDate) |
void | setText (const QString &text, Qt::TextFormat format=Qt::PlainText) |
void | setTitle (const QString &title) |
void | setUid (const QString &uid) |
QString | text () const |
Qt::TextFormat | textFormat () const |
QString | title () const |
QString | toPlainText () const |
QString | uid () const |
Detailed Description
A convenience wrapper around KMime::MessagePtr for notes.
This is the format used by the Akonotes Resource
A note has the following properties: uid: globally unique identifier (generated if empty) creationDate: timestamp when the note was created (generated if empty) lastModified: lastModified (generated if empty) classification: one of private, confidential, public. This is only meant as an indication to the user. title: title of the note text: textual content from: author (generated if empty) attachments: inline or url only custom: key value pair for custom values
Reading a note from an Akonotes akonadi item:
Setting the note as payload of an akonadi Item
- Since
- 4.8
Definition at line 170 of file noteutils.h.
Member Enumeration Documentation
◆ Classification
enum Akonadi::NoteUtils::NoteMessageWrapper::Classification |
Definition at line 188 of file noteutils.h.
Constructor & Destructor Documentation
◆ NoteMessageWrapper() [1/2]
Akonadi::NoteUtils::NoteMessageWrapper::NoteMessageWrapper | ( | ) |
Definition at line 356 of file noteutils.cpp.
◆ NoteMessageWrapper() [2/2]
|
explicit |
Definition at line 361 of file noteutils.cpp.
Member Function Documentation
◆ attachments()
|
nodiscard |
Returns a reference to the list of attachments of the note.
Definition at line 549 of file noteutils.cpp.
◆ classification()
|
nodiscard |
Returns the classification of the note.
Definition at line 462 of file noteutils.cpp.
◆ creationDate()
|
nodiscard |
Returns the creation date of the note.
Definition at line 486 of file noteutils.cpp.
◆ custom()
Returns a reference to the custom-value map.
- Returns
- key-value map containing all custom values
Definition at line 555 of file noteutils.cpp.
◆ from()
|
nodiscard |
Returns the origin (creator) of the note.
Definition at line 498 of file noteutils.cpp.
◆ lastModifiedDate()
|
nodiscard |
Returns the lastModified-date of the note.
Definition at line 474 of file noteutils.cpp.
◆ message()
KMime::MessagePtr Akonadi::NoteUtils::NoteMessageWrapper::message | ( | ) | const |
Assemble a KMime message with the given values.
The message can then i.e. be stored inside an akonadi item
Definition at line 368 of file noteutils.cpp.
◆ setClassification()
void Akonadi::NoteUtils::NoteMessageWrapper::setClassification | ( | NoteMessageWrapper::Classification | classification | ) |
Set the classification of the note.
Definition at line 456 of file noteutils.cpp.
◆ setCreationDate()
void Akonadi::NoteUtils::NoteMessageWrapper::setCreationDate | ( | const QDateTime & | creationDate | ) |
Set the creation date of the note (stored in the mime header)
Definition at line 480 of file noteutils.cpp.
◆ setFrom()
void Akonadi::NoteUtils::NoteMessageWrapper::setFrom | ( | const QString & | from | ) |
Set the origin (creator) of the note (stored in the mime header) This is usually the application creating the note.
- Parameters
-
from must be an address in the style of foo@k.nosp@m.de.o.nosp@m.rg.
Definition at line 492 of file noteutils.cpp.
◆ setLastModifiedDate()
void Akonadi::NoteUtils::NoteMessageWrapper::setLastModifiedDate | ( | const QDateTime & | lastModifiedDate | ) |
Set the lastModified-date of the note.
Definition at line 468 of file noteutils.cpp.
◆ setText()
void Akonadi::NoteUtils::NoteMessageWrapper::setText | ( | const QString & | text, |
Qt::TextFormat | format = Qt::PlainText ) |
Set the text of the note.
- Parameters
-
format only Qt::PlainText and Qt::RichText is supported
Definition at line 516 of file noteutils.cpp.
◆ setTitle()
void Akonadi::NoteUtils::NoteMessageWrapper::setTitle | ( | const QString & | title | ) |
Set the title of the note.
Definition at line 504 of file noteutils.cpp.
◆ setUid()
void Akonadi::NoteUtils::NoteMessageWrapper::setUid | ( | const QString & | uid | ) |
Set the uid of the note.
- Parameters
-
uid should be globally unique
Definition at line 444 of file noteutils.cpp.
◆ text()
|
nodiscard |
Returns the text of the note.
Definition at line 523 of file noteutils.cpp.
◆ textFormat()
|
nodiscard |
- Returns
- Qt::PlainText or Qt::RichText
Definition at line 529 of file noteutils.cpp.
◆ title()
|
nodiscard |
Returns the title of the note.
Definition at line 510 of file noteutils.cpp.
◆ toPlainText()
|
nodiscard |
- Returns
- plaintext version of the text (if richtext)
Definition at line 535 of file noteutils.cpp.
◆ uid()
|
nodiscard |
Returns the uid of the note.
Definition at line 450 of file noteutils.cpp.
The documentation for this class was generated from the following files:
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.