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

KAlarm Library

  • KAlarmCal
  • AlarmText
Public Member Functions | Static Public Member Functions
KAlarmCal::AlarmText Class Reference

#include <alarmtext.h>

List of all members.

Public Member Functions

 AlarmText (const QString &text=QString())
 AlarmText (const AlarmText &other)
QString body () const
QString cc () const
QString description () const
QString displayText () const
QString due () const
QString from () const
bool isEmail () const
bool isEmpty () const
bool isScript () const
bool isTodo () const
unsigned long kmailSerialNumber () const
QString location () const
AlarmText & operator= (const AlarmText &other)
void setEmail (const QString &to, const QString &from, const QString &cc, const QString &time, const QString &subject, const QString &body, unsigned long kmailSerialNumber=0)
void setScript (const QString &text)
void setText (const QString &text)
void setTodo (const KCalCore::Todo::Ptr &todo)
QString subject () const
QString summary () const
QString time () const
QString to () const

Static Public Member Functions

static bool checkIfEmail (const QString &text)
static QString emailHeaders (const QString &text, bool subjectOnly)
static QString fromCalendarText (const QString &text, bool &email)
static QString summary (const KAEvent &event, int maxLines=1, bool *truncated=0)
static QString toCalendarText (const QString &text)

Detailed Description

Parses email, todo and script alarm texts.

This class parses email, todo and script texts, enabling drag and drop of these items to be recognised and interpreted. It also holds plain alarm texts.

  • Email texts must contain headers (To, From, etc.) in normal RFC format.
  • Todos should be in iCalendar format.
  • Scripts are assumed if the alarm text starts with '#!'.
Author:
David Jarvie <djarvie@kde.org>

Constructor & Destructor Documentation

KAlarmCal::AlarmText::AlarmText ( const QString &  text = QString()) [explicit]

Constructor which sets the alarm text.

If text starts with '#!', it is flagged as a script, else plain text.

Parameters:
textalarm text to set.

Definition at line 97 of file alarmtext.cpp.


Member Function Documentation

QString KAlarmCal::AlarmText::body ( ) const

Return the email message body.

Returns:
message body, or empty if not an email text.

Definition at line 247 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::cc ( ) const

Return the 'Cc' header parameter for an email alarm.

Returns:
'cc' value, or empty if not an email text.

Definition at line 232 of file alarmtext.cpp.

bool KAlarmCal::AlarmText::checkIfEmail ( const QString &  text) [static]

Return whether a text is an email, with at least To and From headers.

Parameters:
texttext to check.

Definition at line 379 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::description ( ) const

Return the description text for a todo.

Returns:
description text, or empty if not a todo.

Definition at line 267 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::displayText ( ) const

Return the text for a text message alarm, in display format.

  • An email is returned as a sequence of headers followed by the message body.
  • A todo is returned as a subject, location and due date followed by any text.
  • A script or plain text is returned without interpretation.

Definition at line 174 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::due ( ) const

Return the due date text for a todo.

Returns:
due date text, or empty if not a todo.

Definition at line 262 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::emailHeaders ( const QString &  text,
bool  subjectOnly 
) [static]

Check whether a text is an email (with at least To and From headers), and if so return its headers or optionally only its subject line.

Parameters:
texttext to check
subjectOnlytrue to only return the subject line, false to return all headers.
Returns:
headers/subject line, or QString() if not the text of an email.

Definition at line 390 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::from ( ) const

Return the 'From' header parameter for an email alarm.

Returns:
'from' value, or empty if not an email text.

Definition at line 227 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::fromCalendarText ( const QString &  text,
bool &  email 
) [static]

Translate an alarm calendar text to a display text.

Translation is needed for email texts, since the alarm calendar stores untranslated email prefixes.

Parameters:
texttext to translate
emailupdated to indicate whether it is an email text.

Definition at line 413 of file alarmtext.cpp.

bool KAlarmCal::AlarmText::isEmail ( ) const

Return whether the instance contains the text of an email.

Definition at line 284 of file alarmtext.cpp.

bool KAlarmCal::AlarmText::isEmpty ( ) const

Return whether there is any text.

Definition at line 275 of file alarmtext.cpp.

bool KAlarmCal::AlarmText::isScript ( ) const

Return whether the instance contains the text of a script.

Definition at line 289 of file alarmtext.cpp.

bool KAlarmCal::AlarmText::isTodo ( ) const

Return whether the instance contains the text of a todo.

Definition at line 294 of file alarmtext.cpp.

unsigned long KAlarmCal::AlarmText::kmailSerialNumber ( ) const

Return the kmail serial number of an email.

Returns:
serial number, or 0 if none.

Definition at line 299 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::location ( ) const

Return the location text for a todo.

Returns:
location text, or empty if not a todo.

Definition at line 257 of file alarmtext.cpp.

void KAlarmCal::AlarmText::setEmail ( const QString &  to,
const QString &  from,
const QString &  cc,
const QString &  time,
const QString &  subject,
const QString &  body,
unsigned long  kmailSerialNumber = 0 
)

Set the instance contents to be an email.

Parameters:
to'To' header parameter
from'From' header parameter
cc'Cc' header parameter
time'Date' header parameter
subject'Subject' header parameter
bodyemail body text

Definition at line 135 of file alarmtext.cpp.

void KAlarmCal::AlarmText::setScript ( const QString &  text)

Set the instance contents to be a script.

Parameters:
texttext of script to set

Definition at line 129 of file alarmtext.cpp.

void KAlarmCal::AlarmText::setText ( const QString &  text)

Set the alarm text.

If text starts with '#!', it is flagged as a script, else plain text.

Definition at line 121 of file alarmtext.cpp.

void KAlarmCal::AlarmText::setTodo ( const KCalCore::Todo::Ptr &  todo)

Set the instance contents to be a todo.

Parameters:
todoTodo instance to set as the text

Definition at line 150 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::subject ( ) const

Return the 'Subject' header parameter for an email alarm.

Returns:
'subject' value, or empty if not an email text.

Definition at line 242 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::summary ( ) const

Return the summary text for a todo.

Returns:
summary text, or empty if not a todo.

Definition at line 252 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::summary ( const KAEvent &  event,
int  maxLines = 1,
bool *  truncated = 0 
) [static]

Return the alarm summary text for either single line or tooltip display.

Parameters:
eventevent whose summary text is to be returned
maxLinesthe maximum number of lines returned
truncatedif non-null, points to a variable which will be set true if the text returned has been truncated, other than to strip a trailing newline, or false otherwise.

Definition at line 310 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::time ( ) const

Return the 'Date' header parameter for an email alarm.

Returns:
'date' value, or empty if not an email text.

Definition at line 237 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::to ( ) const

Return the 'To' header parameter for an email alarm.

Returns:
'from' value, or empty if not an email text.

Definition at line 222 of file alarmtext.cpp.

QString KAlarmCal::AlarmText::toCalendarText ( const QString &  text) [static]

Return the text for an alarm message text, in alarm calendar format.

(The prefix strings are untranslated in the calendar.)

Parameters:
textalarm message text.

Definition at line 453 of file alarmtext.cpp.


The documentation for this class was generated from the following files:
  • alarmtext.h
  • alarmtext.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:26:20 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KAlarm Library

Skip menu "KAlarm Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 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