akonadi
#include <noteutils.h>
Public Types | |
enum | Classification { Public, Private, Confidential } |
Public Member Functions | |
NoteMessageWrapper (const KMime::MessagePtr &) | |
QList< Attachment > & | attachments () |
Classification | classification () const |
KDateTime | creationDate () const |
QMap< QString, QString > & | custom () |
QString | from () const |
KDateTime | lastModifiedDate () const |
KMime::MessagePtr | message () const |
void | setClassification (Classification) |
void | setCreationDate (const KDateTime &creationDate) |
void | setFrom (const QString &from) |
void | setLastModifiedDate (const KDateTime &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::Message::Ptr 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 144 of file noteutils.h.
Member Function Documentation
QList< Attachment > & Akonadi::NoteUtils::NoteMessageWrapper::attachments | ( | ) |
Returns a reference to the list of attachments of the note.
Definition at line 518 of file noteutils.cpp.
NoteMessageWrapper::Classification Akonadi::NoteUtils::NoteMessageWrapper::classification | ( | ) | const |
Returns the classification of the note.
Definition at line 430 of file noteutils.cpp.
KDateTime Akonadi::NoteUtils::NoteMessageWrapper::creationDate | ( | ) | const |
Returns the creation date of the note.
Definition at line 454 of file noteutils.cpp.
Returns a reference to the custom-value map.
- Returns
- key-value map containing all custom values
Definition at line 524 of file noteutils.cpp.
QString Akonadi::NoteUtils::NoteMessageWrapper::from | ( | ) | const |
Returns the origin (creator) of the note.
Definition at line 466 of file noteutils.cpp.
KDateTime Akonadi::NoteUtils::NoteMessageWrapper::lastModifiedDate | ( | ) | const |
Returns the lastModified-date of the note.
Definition at line 442 of file noteutils.cpp.
KMime::Message::Ptr 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 346 of file noteutils.cpp.
void Akonadi::NoteUtils::NoteMessageWrapper::setClassification | ( | NoteMessageWrapper::Classification | classification | ) |
Set the classification of the note.
Definition at line 424 of file noteutils.cpp.
void Akonadi::NoteUtils::NoteMessageWrapper::setCreationDate | ( | const KDateTime & | creationDate | ) |
Set the creation date of the note (stored in the mime header)
Definition at line 448 of file noteutils.cpp.
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. de.o rg
Definition at line 460 of file noteutils.cpp.
void Akonadi::NoteUtils::NoteMessageWrapper::setLastModifiedDate | ( | const KDateTime & | lastModifiedDate | ) |
Set the lastModified-date of the note.
Definition at line 436 of file noteutils.cpp.
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 484 of file noteutils.cpp.
void Akonadi::NoteUtils::NoteMessageWrapper::setTitle | ( | const QString & | title | ) |
Set the title of the note.
Definition at line 472 of file noteutils.cpp.
void Akonadi::NoteUtils::NoteMessageWrapper::setUid | ( | const QString & | uid | ) |
Set the uid of the note.
- Parameters
-
uid should be globally unique
Definition at line 412 of file noteutils.cpp.
QString Akonadi::NoteUtils::NoteMessageWrapper::text | ( | ) | const |
Returns the text of the note.
Definition at line 491 of file noteutils.cpp.
Qt::TextFormat Akonadi::NoteUtils::NoteMessageWrapper::textFormat | ( | ) | const |
- Returns
- Qt::PlainText or Qt::RichText
Definition at line 497 of file noteutils.cpp.
QString Akonadi::NoteUtils::NoteMessageWrapper::title | ( | ) | const |
Returns the title of the note.
Definition at line 478 of file noteutils.cpp.
QString Akonadi::NoteUtils::NoteMessageWrapper::toPlainText | ( | ) | const |
- Returns
- plaintext version of the text (if richtext)
Definition at line 503 of file noteutils.cpp.
QString Akonadi::NoteUtils::NoteMessageWrapper::uid | ( | ) | const |
Returns the uid of the note.
Definition at line 418 of file noteutils.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.