• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • NoteUtils
  • NoteMessageWrapper
Public Member Functions
Akonadi::NoteUtils::NoteMessageWrapper Class Reference

#include <noteutils.h>

List of all members.

Public Member Functions

 NoteMessageWrapper (const KMime::MessagePtr &)
KDateTime creationDate () const
QString from () const
KMime::MessagePtr message () const
void setCreationDate (const KDateTime &creationDate)
void setFrom (const QString &from)
void setText (const QString &text, Qt::TextFormat format=Qt::PlainText)
void setTitle (const QString &title)
QString text () const
Qt::TextFormat textFormat () const
QString title () const
QString toPlainText () const

Detailed Description

A convenience wrapper around KMime::Message::Ptr for notes.

This is the format used by the Akonotes Resource

Reading a note from an Akonotes akonadi item:

 if ( item.hasPayload<KMime::Message::Ptr>() ) {
   NoteUtils::NoteMessageWrapper note(item.payload<KMime::Message::Ptr>());
   kDebug() << note.text();
   textIsRich = messageWrapper.textFormat() == Qt::RichText;
 }

Setting the note as payload of an akonadi Item

 item.setMimeType(NoteUtils::noteMimeType());
 NoteUtils::NoteMessageWrapper note;
 note.setTitle( "title" );
 note.setText( "text" );
 note.setFrom( QString::fromLatin1( "MyApplication@kde4" ) );
 item.setPayload( note.message() );
Author:
Christian Mollekopf chrig.nosp@m.i_1@.nosp@m.fastm.nosp@m.ail..nosp@m.fm
Since:
4.8

Definition at line 79 of file noteutils.h.


Member Function Documentation

KDateTime Akonadi::NoteUtils::NoteMessageWrapper::creationDate ( ) const

Returns the creation date of the note.

Definition at line 117 of file noteutils.cpp.

QString Akonadi::NoteUtils::NoteMessageWrapper::from ( ) const

Returns the origin (creator) of the note.

Definition at line 129 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 79 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 111 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.

Definition at line 123 of file noteutils.cpp.

void Akonadi::NoteUtils::NoteMessageWrapper::setText ( const QString &  text,
Qt::TextFormat  format = Qt::PlainText 
)

Set the text of the note.

Parameters:
formatonly Qt::PlainText and Qt::RichText is supported

Definition at line 147 of file noteutils.cpp.

void Akonadi::NoteUtils::NoteMessageWrapper::setTitle ( const QString &  title)

Set the title of the note.

Definition at line 135 of file noteutils.cpp.

QString Akonadi::NoteUtils::NoteMessageWrapper::text ( ) const

Returns the text of the note.

Definition at line 154 of file noteutils.cpp.

Qt::TextFormat Akonadi::NoteUtils::NoteMessageWrapper::textFormat ( ) const
Returns:
Qt::PlainText or Qt::RichText

Definition at line 160 of file noteutils.cpp.

QString Akonadi::NoteUtils::NoteMessageWrapper::title ( ) const

Returns the title of the note.

Definition at line 141 of file noteutils.cpp.

QString Akonadi::NoteUtils::NoteMessageWrapper::toPlainText ( ) const
Returns:
plaintext version of the text (if richtext)

Definition at line 166 of file noteutils.cpp.


The documentation for this class was generated from the following files:
  • noteutils.h
  • noteutils.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue May 8 2012 00:00:53 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal