libkcal

KCal::Alarm Class Reference

#include <alarm.h>

Inheritance diagram for KCal::Alarm:

KCal::CustomProperties

List of all members.


Detailed Description

This class represents an alarm notification.

Definition at line 45 of file alarm.h.


Public Types

enum  Type {
  Invalid, Display, Procedure, Email,
  Audio
}
typedef ListBase< AlarmList

Public Member Functions

 Alarm (Incidence *parent)
virtual ~Alarm ()
Alarmclone ()
Alarmoperator= (const Alarm &)
bool operator== (const Alarm &) const
bool operator!= (const Alarm &a) const
void setType (Type type)
Type type () const
void setDisplayAlarm (const QString &text=QString::null)
void setText (const QString &text)
QString text () const
void setAudioAlarm (const QString &audioFile=QString::null)
void setAudioFile (const QString &audioFile)
QString audioFile () const
void setProcedureAlarm (const QString &programFile, const QString &arguments=QString::null)
void setProgramFile (const QString &programFile)
QString programFile () const
void setProgramArguments (const QString &arguments)
QString programArguments () const
void setEmailAlarm (const QString &subject, const QString &text, const QValueList< Person > &addressees, const QStringList &attachments=QStringList())
void setMailAddress (const Person &mailAlarmAddress)
void setMailAddresses (const QValueList< Person > &mailAlarmAddresses)
void addMailAddress (const Person &mailAlarmAddress)
QValueList< PersonmailAddresses () const
void setMailSubject (const QString &mailAlarmSubject)
QString mailSubject () const
void setMailAttachment (const QString &mailAttachFile)
void setMailAttachments (const QStringList &mailAttachFiles)
void addMailAttachment (const QString &mailAttachFile)
QStringList mailAttachments () const
void setMailText (const QString &text)
QString mailText () const
void setTime (const QDateTime &alarmTime)
QDateTime time () const
QDateTime endTime () const
bool hasTime () const
void setStartOffset (const Duration &)
Duration startOffset () const
bool hasStartOffset () const
void setEndOffset (const Duration &)
Duration endOffset () const
bool hasEndOffset () const
void setSnoozeTime (const Duration &alarmSnoozeTime)
Duration snoozeTime () const
void setRepeatCount (int alarmRepeatCount)
int repeatCount () const
QDateTime nextRepetition (const QDateTime &preTime) const
QDateTime previousRepetition (const QDateTime &afterTime) const
Duration duration () const
void toggleAlarm ()
void setEnabled (bool enable)
bool enabled () const
void setParent (Incidence *)
Incidenceparent () const

Protected Member Functions

virtual void customPropertyUpdated ()

Constructor & Destructor Documentation

Alarm::Alarm ( Incidence parent  )  [explicit]

Construct a new alarm with variables initialized to "sane" values.

Definition at line 32 of file alarm.cpp.

Alarm::~Alarm (  )  [virtual]

Destruct Alarm object.

Definition at line 46 of file alarm.cpp.


Member Function Documentation

Alarm * Alarm::clone (  ) 

Returns an exact copy of this alarm.

The returned object is owned by the caller.

Since:
4.5

Definition at line 50 of file alarm.cpp.

Alarm & Alarm::operator= ( const Alarm a  ) 

Copy operator.

Since:
4.5

Definition at line 55 of file alarm.cpp.

bool Alarm::operator== ( const Alarm rhs  )  const

Compare this alarm with another one.

Definition at line 74 of file alarm.cpp.

void Alarm::setType ( Alarm::Type  type  ) 

Set the type of the alarm.

If the specified type is different from the current type of the alarm, the alarm's type-specific properties are initialised to null.

Parameters:
type type of alarm.

Definition at line 115 of file alarm.cpp.

Alarm::Type Alarm::type (  )  const

Return the type of the alarm.

Definition at line 144 of file alarm.cpp.

void Alarm::setDisplayAlarm ( const QString &  text = QString::null  ) 

Set the alarm to be a display alarm.

Parameters:
text text to display when the alarm is triggered.

Definition at line 300 of file alarm.cpp.

void Alarm::setText ( const QString &  text  ) 

Set the text to be displayed when the alarm is triggered.

Ignored if the alarm is not a display alarm.

Definition at line 308 of file alarm.cpp.

QString Alarm::text (  )  const

Return the text string that displays when the alarm is triggered.

Definition at line 316 of file alarm.cpp.

void Alarm::setAudioAlarm ( const QString &  audioFile = QString::null  ) 

Set the alarm to be an audio alarm.

Parameters:
audioFile optional file to play when the alarm is triggered.

Definition at line 149 of file alarm.cpp.

void Alarm::setAudioFile ( const QString &  audioFile  ) 

Set the file to play when the audio alarm is triggered.

Ignored if the alarm is not an audio alarm.

Definition at line 156 of file alarm.cpp.

QString Alarm::audioFile (  )  const

Return the name of the audio file for the alarm.

Returns:
The audio file for the alarm, or QString::null if not an audio alarm.

Definition at line 164 of file alarm.cpp.

void Alarm::setProcedureAlarm ( const QString &  programFile,
const QString &  arguments = QString::null 
)

Set the alarm to be a procedure alarm.

Parameters:
programFile program to execute when the alarm is triggered.
arguments arguments to supply to programFile.

Definition at line 169 of file alarm.cpp.

void Alarm::setProgramFile ( const QString &  programFile  ) 

Set the program file to execute when the alarm is triggered.

Ignored if the alarm is not a procedure alarm.

Definition at line 177 of file alarm.cpp.

QString Alarm::programFile (  )  const

Return the name of the program file to execute when the alarm is triggered.

Returns:
the program file name, or QString::null if not a procedure alarm.

Definition at line 185 of file alarm.cpp.

void Alarm::setProgramArguments ( const QString &  arguments  ) 

Set the arguments to the program to execute when the alarm is triggered.

Ignored if the alarm is not a procedure alarm.

Definition at line 190 of file alarm.cpp.

QString Alarm::programArguments (  )  const

Return the arguments to the program to run when the alarm is triggered.

Returns:
the program arguments, or QString::null if not a procedure alarm.

Definition at line 198 of file alarm.cpp.

void Alarm::setEmailAlarm ( const QString &  subject,
const QString &  text,
const QValueList< Person > &  addressees,
const QStringList &  attachments = QStringList() 
)

Set the alarm to be an email alarm.

Parameters:
subject subject line of email.
text body of email.
addressees email addresses of recipient(s).
attachments optional names of files to attach to the email.

Definition at line 203 of file alarm.cpp.

void Alarm::setMailAddress ( const Person mailAlarmAddress  ) 

Send mail to this address when the alarm is triggered.

Ignored if the alarm is not an email alarm.

Definition at line 214 of file alarm.cpp.

void Alarm::setMailAddresses ( const QValueList< Person > &  mailAlarmAddresses  ) 

Send mail to these addresses when the alarm is triggered.

Ignored if the alarm is not an email alarm.

Definition at line 223 of file alarm.cpp.

void Alarm::addMailAddress ( const Person mailAlarmAddress  ) 

Add this address to the list of addresses to send mail to when the alarm is triggered.

Ignored if the alarm is not an email alarm.

Definition at line 231 of file alarm.cpp.

QValueList< Person > Alarm::mailAddresses (  )  const

Return the addresses to send mail to when an alarm goes off.

Definition at line 239 of file alarm.cpp.

void Alarm::setMailSubject ( const QString &  mailAlarmSubject  ) 

Set the subject line of the mail.

Ignored if the alarm is not an email alarm.

Definition at line 244 of file alarm.cpp.

QString Alarm::mailSubject (  )  const

Return the subject line of the mail.

Definition at line 252 of file alarm.cpp.

void Alarm::setMailAttachment ( const QString &  mailAttachFile  ) 

Attach this filename to the email.

Ignored if the alarm is not an email alarm.

Definition at line 257 of file alarm.cpp.

void Alarm::setMailAttachments ( const QStringList &  mailAttachFiles  ) 

Attach these filenames to the email.

Ignored if the alarm is not an email alarm.

Definition at line 266 of file alarm.cpp.

void Alarm::addMailAttachment ( const QString &  mailAttachFile  ) 

Add this filename to the list of files to attach to the email.

Ignored if the alarm is not an email alarm.

Definition at line 274 of file alarm.cpp.

QStringList Alarm::mailAttachments (  )  const

Return the filenames to attach to the email.

Definition at line 282 of file alarm.cpp.

void Alarm::setMailText ( const QString &  text  ) 

Set the email body text.

Ignored if the alarm is not an email alarm.

Definition at line 287 of file alarm.cpp.

QString Alarm::mailText (  )  const

Return the email body text.

Returns:
the body text, or QString::null if not an email alarm.

Definition at line 295 of file alarm.cpp.

void Alarm::setTime ( const QDateTime &  alarmTime  ) 

Set the time to trigger an alarm.

Definition at line 321 of file alarm.cpp.

QDateTime Alarm::time (  )  const

Return the date/time when an alarm goes off.

Definition at line 329 of file alarm.cpp.

QDateTime Alarm::endTime (  )  const

Return the date/time when the last repetition of the alarm goes off.

If the alarm does not repeat, this is equivalent to calling time().

Definition at line 418 of file alarm.cpp.

bool Alarm::hasTime (  )  const

Return true, if the alarm has an explicit date/time.

Definition at line 349 of file alarm.cpp.

void Alarm::setStartOffset ( const Duration offset  ) 

Set offset of alarm in time relative to the start of the event.

Definition at line 443 of file alarm.cpp.

Duration Alarm::startOffset (  )  const

Return offset of alarm in time relative to the start of the event.

If the alarm's time is not defined in terms of an offset relative to the start of the event, returns zero.

Definition at line 451 of file alarm.cpp.

bool Alarm::hasStartOffset (  )  const

Return whether the alarm is defined in terms of an offset relative to the start of the event.

Definition at line 456 of file alarm.cpp.

void Alarm::setEndOffset ( const Duration offset  ) 

Set offset of alarm in time relative to the end of the event.

Definition at line 466 of file alarm.cpp.

Duration Alarm::endOffset (  )  const

Return offset of alarm in time relative to the end of the event.

If the alarm's time is not defined in terms of an offset relative to the end of the event, returns zero.

Definition at line 474 of file alarm.cpp.

bool Alarm::hasEndOffset (  )  const

Return whether the alarm is defined in terms of an offset relative to the end of the event.

Definition at line 461 of file alarm.cpp.

void Alarm::setSnoozeTime ( const Duration alarmSnoozeTime  ) 

Set the interval between snoozes for the alarm.

Parameters:
alarmSnoozeTime the time in minutes between snoozes.

Definition at line 354 of file alarm.cpp.

Duration Alarm::snoozeTime (  )  const

Get how long the alarm snooze interval is.

Returns:
the number of minutes between snoozes.

Definition at line 362 of file alarm.cpp.

void Alarm::setRepeatCount ( int  alarmRepeatCount  ) 

Set how many times an alarm is to repeat itself after its initial occurrence (w/snoozes).

Definition at line 367 of file alarm.cpp.

int Alarm::repeatCount (  )  const

Get how many times an alarm repeats, after its initial occurrence.

Definition at line 373 of file alarm.cpp.

QDateTime Alarm::nextRepetition ( const QDateTime &  preTime  )  const

Get the time of the alarm's initial occurrence or its next repetition, after a given time.

Parameters:
preTime the date and time after which to find the next repetition.
Returns:
the date and time of the next repetition, or an invalid date/time if the specified time is at or after the alarm's last repetition.

Definition at line 384 of file alarm.cpp.

QDateTime Alarm::previousRepetition ( const QDateTime &  afterTime  )  const

Get the time of the alarm's latest repetition, or its initial occurrence if none, before a given time.

Parameters:
afterTime the date and time before which to find the latest repetition.
Returns:
the date and time of the latest repetition, or an invalid date/time if the specified time is at or before the alarm's initial occurrence.

Definition at line 401 of file alarm.cpp.

Duration Alarm::duration (  )  const

Get how long between the alarm's initial occurrence and its final repetition.

Returns:
the number of seconds between the initial occurrence and final repetition.

Definition at line 378 of file alarm.cpp.

void Alarm::toggleAlarm (  ) 

Toggles the value of alarm to be either on or off.

Set's the alarm time to be x minutes before dtStart time.

Definition at line 426 of file alarm.cpp.

void Alarm::setEnabled ( bool  enable  ) 

Set the alarm enabled status.

Definition at line 432 of file alarm.cpp.

bool Alarm::enabled (  )  const

Get the alarm enabled status.

Definition at line 438 of file alarm.cpp.

void Alarm::setParent ( Incidence parent  ) 

Set the alarm's parent incidence.

Definition at line 479 of file alarm.cpp.

Incidence* KCal::Alarm::parent (  )  const [inline]

Get the alarm's parent incidence.

Definition at line 351 of file alarm.h.

void Alarm::customPropertyUpdated (  )  [protected, virtual]

Called when a custom property has been changed.

The default implementation does nothing: override in derived classes to perform change processing.

Reimplemented from KCal::CustomProperties.

Definition at line 484 of file alarm.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys