Qtopia library API Documentation

Event Class Reference

The Event class holds the data of a calendar event. More...

#include <event.h>

Inheritance diagram for Event:

Inheritance graph
[legend]
Collaboration diagram for Event:

Collaboration graph
[legend]
List of all members.

Public Types

enum  RepeatType {
  NoRepeat = -1, Daily, Weekly, MonthlyDay,
  MonthlyDate, Yearly
}
enum  Days {
  MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08,
  FRI = 0x10, SAT = 0x20, SUN = 0x40
}
enum  Type { Normal, AllDay }
enum  SoundTypeChoice { Silent, Loud }

Public Member Functions

 Event ()
 Event (const QMap< int, QString > &map)
virtual ~Event ()
QMap< int, QStringtoMap () const
bool operator< (const Event &e1) const
bool operator<= (const Event &e1) const
bool operator!= (const Event &e1) const
bool operator> (const Event &e1) const
bool operator>= (const Event &e1) const
bool operator== (const Event &e) const
void setDescription (const QString &s)
const QStringdescription () const
void setLocation (const QString &s)
const QStringlocation () const
void setNotes (const QString &n)
const QStringnotes () const
void setType (Type t)
Type type () const
void setAllDay (bool)
bool isAllDay () const
void setStart (const QDateTime &d)
void setStart (time_t time)
QDateTime start (bool actual=FALSE) const
time_t startTime () const
void setEnd (const QDateTime &e)
void setEnd (time_t time)
QDateTime end (bool actual=FALSE) const
time_t endTime () const
void setTimeZone (const QString &)
const QStringtimeZone () const
void setAlarm (int minutes, SoundTypeChoice)
void clearAlarm ()
void setAlarm (bool b, int minutes, SoundTypeChoice)
bool hasAlarm () const
int alarmDelay () const
int alarmTime () const
SoundTypeChoice alarmSound () const
RepeatType repeatType () const
int frequency () const
int weekOffset () const
QDate repeatTill () const
bool repeatForever () const
bool repeatOnWeekDay (int day) const
void setRepeatType (RepeatType)
void setFrequency (int)
void setRepeatTill (const QDate &)
void setRepeatForever (bool)
void setRepeatOnWeekDay (int day, bool enable)
void setRepeat (bool b, const RepeatPattern &p)
void setRepeat (const RepeatPattern &p)
bool hasRepeat () const
const RepeatPatternrepeatPattern () const
RepeatPatternrepeatPattern ()
bool doRepeat () const
void save (QString &buf)
bool match (const QRegExp &r) const

Static Public Member Functions

void writeVCalendar (const QString &filename, const QValueList< Event > &events)
void writeVCalendar (const QString &filename, const Event &event)
QValueList< EventreadVCalendar (const QString &filename)
int week (const QDate &date)
int occurrence (const QDate &date)
char day (int dayOfWeek)
int dayOfWeek (char day)
int monthDiff (const QDate &first, const QDate &second)

Detailed Description

The Event class holds the data of a calendar event.

This data includes descriptive data of the event and schedualing information.

Definition at line 41 of file event.h.


Member Enumeration Documentation

enum Event::RepeatType
 

This enum defines how a event will repeat, if at all.

  • NoRepeat - Event does not repeat.
  • Daily - Event occurs every n days.
  • Weekly - Event occurs every n weeks.
  • MonthlyDay - Event occurs every n months. Event will always occur in the same week and same day of week as the first event.
  • MonthlyDate - Event occurs every n months. Event will always occur on the same day of the month as the first event.
  • Yearly - Event occurs every n years.

Definition at line 44 of file event.h.

Referenced by repeatType().

enum Event::SoundTypeChoice
 

This enum type defines what kind of sound is made when an alarm occurs for an event. The currently defined types are:

  • Silent - No sound is produced.
  • Loud - A loud sound is produced.

Definition at line 80 of file event.h.

Referenced by alarmSound().


Constructor & Destructor Documentation

Event::Event  ) 
 

Creates a new, empty event.

Definition at line 323 of file event.cpp.

References Event::RepeatPattern::frequency, and Event::RepeatPattern::type.

Event::~Event  )  [virtual]
 

Destroys an event.

Definition at line 364 of file event.cpp.


Member Function Documentation

void Event::writeVCalendar const QString filename,
const QValueList< Event > &  events
[static]
 

Writes the list of events as a set of VCards to the file filename.

Definition at line 1250 of file event.cpp.

References QValueList::begin(), QValueList::end(), and QString::utf8().

void Event::writeVCalendar const QString filename,
const Event event
[static]
 

Writes event as a VCard to the file filename.

Definition at line 1278 of file event.cpp.

References QString::utf8().

QValueList< Event > Event::readVCalendar const QString filename  )  [static]
 

Returns the set of events read as VCards from the file filename.

Definition at line 1302 of file event.cpp.

References QValueList::append(), and QString::utf8().

void Event::setDescription const QString s  ) 
 

Sets the description of the event to s.

Definition at line 465 of file event.cpp.

const QString & Event::description  )  const
 

Returns the description of the event.

Definition at line 563 of file event.cpp.

Referenced by EffectiveEvent::description().

void Event::setLocation const QString s  ) 
 

Sets the location of the event to s.

Definition at line 473 of file event.cpp.

const QString & Event::location  )  const
 

Returns the location of the event.

Definition at line 571 of file event.cpp.

void Event::setNotes const QString n  ) 
 

Sets the notes for the event to n.

Definition at line 555 of file event.cpp.

const QString & Event::notes  )  const
 

Returns the notes for the event.

Definition at line 683 of file event.cpp.

void Event::setAllDay bool  enable  )  [inline]
 

If allday is TRUE, will set the event to be an all day event. Otherwise sets the event to not be an all day event.

Warning:
This function may affect the start and end times of the event.

Definition at line 265 of file event.h.

bool Event::isAllDay  )  const [inline]
 

Returns TRUE if the event is an all day event. Otherwise returns FALSE.

Definition at line 273 of file event.h.

void Event::setStart const QDateTime d  ) 
 

Sets the start date and time of the first or only occurance of this event to the date and time d. d should be in local time.

Definition at line 495 of file event.cpp.

QDateTime Event::start bool  actual = FALSE  )  const
 

Returns the start date and time of the first occurance of the event.

Definition at line 596 of file event.cpp.

References QDateTime::setTime(), and QDateTime::time().

Referenced by weekOffset().

void Event::setEnd const QDateTime d  ) 
 

Sets the end date and time of the first or only occurance of this event to the date and time d. d should be in local time.

Definition at line 512 of file event.cpp.

QDateTime Event::end bool  actual = FALSE  )  const
 

Returns the end date and time of the first occurance of the event.

Definition at line 615 of file event.cpp.

References QDateTime::setTime().

Referenced by setRepeatForever().

void Event::setAlarm int  minutes,
SoundTypeChoice  s
[inline]
 

Sets the alarm delay of the event to delay and the sound type of the alarm to s.

Definition at line 250 of file event.h.

Referenced by clearAlarm().

void Event::clearAlarm  )  [inline]
 

Clears the alarm for the event.

Definition at line 255 of file event.h.

References setAlarm().

int Event::alarmDelay  )  const [inline]
 

Returns the delay in minutes between the alarm for an event and the start of the event.

Definition at line 260 of file event.h.

Event::SoundTypeChoice Event::alarmSound  )  const
 

Returns the sound type for the alarm of this event.

Definition at line 651 of file event.cpp.

References SoundTypeChoice.

Event::RepeatType Event::repeatType  )  const [inline]
 

Returns the repeat pattern type for the event.

See also:
frequency()

Definition at line 278 of file event.h.

References RepeatType, and Event::RepeatPattern::type.

int Event::frequency  )  const [inline]
 

Returns how often the event repeats.

See also:
repeatType()

Definition at line 283 of file event.h.

References Event::RepeatPattern::frequency.

int Event::weekOffset  )  const [inline]
 

Returns the number of weeks from the start of the month that this event occurs.

Definition at line 288 of file event.h.

References QDateTime::date(), and start().

QDate Event::repeatTill  )  const [inline]
 

Returns the date that the event will continue to repeat until. If the event repeats forever the value returned is undefined.

See also:
repeatForever()

Definition at line 295 of file event.h.

References Event::RepeatPattern::endDate().

bool Event::repeatForever  )  const [inline]
 

Returns FALSE if there is a date set for the event to continue until. Otherwise returns TRUE.

Definition at line 300 of file event.h.

References Event::RepeatPattern::hasEndDate.

bool Event::repeatOnWeekDay int  day  )  const [inline]
 

Returns TRUE if the event has a RepeatType of Weekly and is set to occur on day each week. Otherwise returns FALSE.

See also:
QDate::dayName()

Definition at line 330 of file event.h.

References Event::RepeatPattern::days, and Event::RepeatPattern::type.

Referenced by setRepeatOnWeekDay().

void Event::setRepeatType RepeatType  t  )  [inline]
 

Sets the repeat pattern type of the event to t.

See also:
setFrequency()

Definition at line 305 of file event.h.

References Event::RepeatPattern::type.

void Event::setFrequency int  f  )  [inline]
 

Sets how often the event occurs with in its repeat pattern.

See also:
setRepeatType()

Definition at line 310 of file event.h.

References Event::RepeatPattern::frequency.

void Event::setRepeatTill const QDate d  )  [inline]
 

Sets the event to repeat until d.

Definition at line 315 of file event.h.

References Event::RepeatPattern::hasEndDate, and Event::RepeatPattern::setEndDate().

void Event::setRepeatForever bool  b  )  [inline]
 

If enable is TRUE, sets the event to repeat forever. Otherwise sets the event to stop repeating at some date.

Warning:
This function may affect the specific date the event will repeat till.

Definition at line 321 of file event.h.

References end(), Event::RepeatPattern::hasEndDate, and Event::RepeatPattern::setEndDate().

void Event::setRepeatOnWeekDay int  day,
bool  enable
[inline]
 

If enable is TRUE then sets the event to occur on day each week. Otherwise sets the event not to occur on day.

Warning:
this function is only relavent for a event with RepeatType of Weekly.
See also:
QDate::dayName()

Definition at line 337 of file event.h.

References Event::RepeatPattern::days, and repeatOnWeekDay().

bool Event::match const QRegExp r  )  const [virtual]
 

Returns TRUE if the event matches the regular expression r. Otherwise returns FALSE.

Reimplemented from Qtopia::Record.

Definition at line 1331 of file event.cpp.

References Event::RepeatPattern::endDateUTC, QString::find(), and Event::RepeatPattern::hasEndDate.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:19 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001