libkcal Library API Documentation

KCal::Alarm Class Reference

This class represents an alarm notification. More...

#include <alarm.h>

Inheritance diagram for KCal::Alarm:

KCal::CustomProperties List of all members.

Public Types

typedef ListBase< Alarm > List
enum  Type {
  Invalid, Display, Procedure, Email,
  Audio
}

Public Methods

 Alarm (Incidence *parent)
 ~Alarm ()
bool operator== (const Alarm &) const
bool operator!= (const Alarm &a) const
void setType (Type type)
Type type () const
void setDisplayAlarm (const QString &text)
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
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 (int alarmSnoozeTime)
int snoozeTime () const
void setRepeatCount (int alarmRepeatCount)
int repeatCount () const
void toggleAlarm ()
void setEnabled (bool enable)
bool enabled () const
void setParent (Incidence *)
Incidenceparent () const

Detailed Description

This class represents an alarm notification.

Definition at line 40 of file alarm.h.


Constructor & Destructor Documentation

Alarm::Alarm Incidence   parent [explicit]
 

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

Definition at line 31 of file alarm.cpp.

Alarm::~Alarm  
 

Destruct Alarm object.

Definition at line 45 of file alarm.cpp.


Member Function Documentation

bool Alarm::operator== const Alarm &    const
 

Compare this alarm with another one.

Definition at line 49 of file alarm.cpp.

References mAlarmEnabled, mAlarmRepeatCount, mAlarmSnoozeTime, mAlarmTime, mDescription, mEndOffset, mFile, mHasTime, mMailAddresses, mMailAttachFiles, mMailSubject, mOffset, and mType.

void Alarm::setType 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 90 of file alarm.cpp.

References QValueList< Person >::clear(), type(), and KCal::IncidenceBase::updated().

Alarm::Type Alarm::type   const
 

Return the type of the alarm.

Definition at line 119 of file alarm.cpp.

Referenced by KCal::VCalFormat::eventToVEvent(), KCal::VCalFormat::eventToVTodo(), and setType().

void Alarm::setDisplayAlarm const QString   text
 

Set the alarm to be a display alarm.

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

Definition at line 275 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 282 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::ResourceKABC::load().

QString Alarm::text   const
 

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

Definition at line 290 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 124 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::VCalFormat::VEventToEvent(), and KCal::VCalFormat::VTodoToEvent().

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 131 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 139 of file alarm.cpp.

Referenced by KCal::VCalFormat::eventToVEvent(), and KCal::VCalFormat::eventToVTodo().

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 144 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::VCalFormat::VEventToEvent(), and KCal::VCalFormat::VTodoToEvent().

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 152 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 160 of file alarm.cpp.

Referenced by KCal::VCalFormat::eventToVEvent(), and KCal::VCalFormat::eventToVTodo().

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 165 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 173 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 178 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 189 of file alarm.cpp.

References QValueList< Person >::clear(), and KCal::IncidenceBase::updated().

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 198 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 206 of file alarm.cpp.

References KCal::IncidenceBase::updated().

QValueList< Person > Alarm::mailAddresses   const
 

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

Definition at line 214 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 219 of file alarm.cpp.

References KCal::IncidenceBase::updated().

QString Alarm::mailSubject   const
 

Return the subject line of the mail.

Definition at line 227 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 232 of file alarm.cpp.

References KCal::IncidenceBase::updated().

void Alarm::setMailAttachments const QStringList   mailAttachFiles
 

Attach these filenames to the email.

Ignored if the alarm is not an email alarm.

Definition at line 241 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 249 of file alarm.cpp.

References KCal::IncidenceBase::updated().

QStringList Alarm::mailAttachments   const
 

Return the filenames to attach to the email.

Definition at line 257 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 262 of file alarm.cpp.

References KCal::IncidenceBase::updated().

QString Alarm::mailText   const
 

Return the email body text.

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

Definition at line 270 of file alarm.cpp.

void Alarm::setTime const QDateTime   alarmTime
 

Set the time to trigger an alarm.

Definition at line 295 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::ResourceKABC::load(), KCal::VCalFormat::VEventToEvent(), and KCal::VCalFormat::VTodoToEvent().

QDateTime Alarm::time   const
 

Return the date/time when an alarm goes off.

Definition at line 303 of file alarm.cpp.

References KCal::Todo::dtDue(), KCal::Incidence::dtEnd(), KCal::IncidenceBase::dtStart(), KCal::Duration::end(), hasTime(), and KCal::IncidenceBase::type().

Referenced by KCal::CalendarLocal::appendRecurringAlarms(), KCal::VCalFormat::eventToVEvent(), and KCal::VCalFormat::eventToVTodo().

bool Alarm::hasTime   const
 

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

Definition at line 320 of file alarm.cpp.

Referenced by KCal::CalendarLocal::appendRecurringAlarms(), and time().

void Alarm::setStartOffset const Duration  
 

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

Definition at line 367 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::ResourceKABC::load().

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 375 of file alarm.cpp.

Referenced by KCal::CalendarLocal::appendRecurringAlarms().

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 380 of file alarm.cpp.

Referenced by KCal::CalendarLocal::appendRecurringAlarms().

void Alarm::setEndOffset const Duration  
 

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

Definition at line 390 of file alarm.cpp.

References KCal::IncidenceBase::updated().

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 398 of file alarm.cpp.

Referenced by KCal::CalendarLocal::appendRecurringAlarms().

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 385 of file alarm.cpp.

Referenced by KCal::CalendarLocal::appendRecurringAlarms().

void Alarm::setSnoozeTime int    alarmSnoozeTime
 

Set the interval between snoozes for the alarm.

Parameters:
alarmSnoozeTime  the time in minutes between snoozes.

Definition at line 325 of file alarm.cpp.

References KCal::IncidenceBase::updated().

int Alarm::snoozeTime   const
 

Get how long the alarm snooze interval is.

Returns:
the number of minutes between snoozes.

Definition at line 331 of file alarm.cpp.

void Alarm::setRepeatCount int    alarmRepeatCount
 

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

Definition at line 336 of file alarm.cpp.

References KCal::IncidenceBase::updated().

int Alarm::repeatCount   const
 

Get how many times an alarm repeats.

Definition at line 344 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 350 of file alarm.cpp.

References KCal::IncidenceBase::updated().

void Alarm::setEnabled bool    enable
 

Set the alarm enabled status.

Definition at line 356 of file alarm.cpp.

References KCal::IncidenceBase::updated().

Referenced by KCal::ResourceKABC::load(), KCal::VCalFormat::VEventToEvent(), and KCal::VCalFormat::VTodoToEvent().

bool Alarm::enabled   const
 

Get the alarm enabled status.

Definition at line 362 of file alarm.cpp.

Referenced by KCal::VCalFormat::eventToVEvent(), and KCal::VCalFormat::eventToVTodo().

void Alarm::setParent Incidence  
 

Set the alarm's parent incidence.

Definition at line 403 of file alarm.cpp.

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

Get the alarm's parent incidence.

Definition at line 304 of file alarm.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkcal Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:23 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003