Home · All Classes · Annotated · Functions

QAppointment Class Reference

The QAppointment class holds the data of a calendar appointment. More...

#include <QAppointment>

Inherits QPimRecord.

Public Types

Public Functions

Static Public Members

Protected Functions


Detailed Description

The QAppointment class holds the data of a calendar appointment.

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


Member Type Documentation

enum QAppointment::AlarmFlag
flags QAppointment::AlarmFlags

This enum type defines the sound that is made when an appointment alarm occurs The currently defined types are:

ConstantValueDescription
QAppointment::NoAlarm0x00The appointment has no alarm set
QAppointment::Visible0x01The appointment has dialog popup alarm set
QAppointment::Audible0x02 | VisibleThe appontment has an audible alarm set.

The AlarmFlags type is a typedef for QFlags<AlarmFlag>. It stores an OR combination of AlarmFlag values.

See also setAlarm() and alarm().

enum QAppointment::RepeatRule

This enum type defines how an appointment repeats.

ConstantValueDescription
QAppointment::NoRepeat0appointment occurs only once
QAppointment::Daily1appointment occurs every N days
QAppointment::Weekly2appointment occurs every N weeks
QAppointment::MonthlyDate3appointment occurs on the Xth day of the month every N months
QAppointment::MonthlyDay4appointment occurs on the Xth week of the month every N months
QAppointment::MonthlyEndDay6appointment occurs on the Xth last week of the month every N months
QAppointment::Yearly5appointment occurs every N years

See also frequency(), weekOffset(), showOnNearest(), and repeatOnWeekDay().

enum QAppointment::WeekFlag
flags QAppointment::WeekFlags

The WeekFlags only apply to appointments that have a RepeatRule of Weekly.

ConstantValueDescription
QAppointment::OccurMonday0x01The appointment occurs on each Monday
QAppointment::OccurTuesday0x02The appointment occurs on each Tuesday
QAppointment::OccurWednesday0x04The appointment occurs on each Wednesday
QAppointment::OccurThursday0x08The appointment occurs on each Thursday
QAppointment::OccurFriday0x10The appointment occurs on each Friday
QAppointment::OccurSaturday0x20The appointment occurs on each Saturday
QAppointment::OccurSunday0x40The appointment occurs on each Sunday

The WeekFlags type is a typedef for QFlags<WeekFlag>. It stores an OR combination of WeekFlag values.


Member Function Documentation

QAppointment::QAppointment ()

Constructs a new QAppointment.

QAppointment::QAppointment ( const QAppointment & appointment )

Constructs a new QAppointment as a copy of appointment.

QAppointment::QAppointment ( const QDateTime & start, const QDateTime & end )

Constructs a new QAppointment starting at start and running until end.

QAppointment::~QAppointment ()   [virtual]

Destroys a QAppointment.

AlarmFlags QAppointment::alarm () const

Returns the type of alarm to sound.

See also setAlarm() and AlarmFlags.

int QAppointment::alarmDelay () const

Returns the number of minutes before the appointment to activate the alarm for the appointment.

See also setAlarm().

QList<QString> & QAppointment::categoriesRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QList<QString> & QAppointment::categoriesRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

void QAppointment::clearAlarm ()

Clears any alarms set for the appointment.

See also setAlarm().

void QAppointment::clearExceptions ()

Removes all exceptions from the appointment.

Note: clearing exceptions and updating appointment in the QAppointmentModel will NOT store the exception changes. Use the functions QAppointmentModel::removeOccurrence(), QAppointmentModel::replaceOccurrence() and QAppointmentModel::replaceRemaining() instead.

QMap<QString, QString> & QAppointment::customFieldsRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QMap<QString, QString> & QAppointment::customFieldsRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

QString QAppointment::description () const

Returns the description of the appointment.

See also setDescription().

QDateTime QAppointment::end () const

Returns when the first occurrence of the appointment starts.

See also endInCurrentTZ() and setEnd().

QDateTime QAppointment::endInCurrentTZ () const

Returns the end time of the appointment in the current system timezone.

See also end().

QUniqueId QAppointment::exceptionParent () const

Returns the uid of the repeating appointment that this an exception to

See also setExceptionParent().

QList<Exception> QAppointment::exceptions () const

Returns the list of exceptions to the appointments repeat rule.

See also setExceptions().

QOccurrence QAppointment::firstOccurrence () const

Returns the first occurrence for the appointment.

If there are no valid occurrence for the appointment will return a null occurrence.

int QAppointment::frequency () const

Returns how often the appointment repeats.

See also setFrequency().

WeekFlag QAppointment::fromDateDay ( int day )   [static]

Returns the WeekFlag associated with day as a Qt::DayOfWeek.

bool QAppointment::hasAlarm () const

Returns true if there is an alarm set for the appointment. Otherwise returns false.

See also setAlarm().

bool QAppointment::hasRepeat () const

Returns false if the appointment has repeat type NoRepeat. Otherwise returns true.

See also setRepeatRule() and RepeatRule.

bool QAppointment::isAllDay () const

Returns true if the appointment is an all day appointment. Otherwise returns false.

See also setAllDay().

bool QAppointment::isException () const

Returns true if the appointment is an exception of another repeating appointment.

bool QAppointment::isValid () const

Returns true if the appointment can occur. Otherwise returns false.

QString QAppointment::location () const

Returns the location of the appointment.

See also setLocation().

QOccurrence QAppointment::nextOccurrence ( const QDate & from ) const

Returns the first date on or after from that the appointment will next occur. If the appointment only occurs once (no repeat) will return the date of the start of the appointment if the start of the appointment is on or after from.

If the appointment does not occur on or after from then a null date is returned.

QString QAppointment::notes () const   [virtual]

Returns the notes of the appointment.

Reimplemented from QPimRecord.

See also setNotes().

QList<QAppointment> QAppointment::readVCalendar ( const QString & filename )   [static]

Reads the file specified by filename as a list of vCalendar objects and returns the list of near equivalent appointments.

See also writeVCalendar().

bool QAppointment::repeatForever () const

Returns true if the appointment will repeat forever. Otherwise returns false.

See also repeatUntil() and setRepeatForever().

bool QAppointment::repeatOnWeekDay ( int day ) const

If the repeat type of the appointment is Weekly and the appointment is set to repeat on day of the week, then returns true. Otherwise returns false.

See also setRepeatOnWeekDay().

RepeatRule QAppointment::repeatRule () const

Returns the RepeatRule of the appointment.

See also setRepeatRule() and RepeatRule.

QDate QAppointment::repeatUntil () const

Returns the date the appointment will repeat until

See also repeatForever() and setRepeatUntil().

QDate QAppointment::repeatUntilInCurrentTZ () const

Returns the date the appointment will repeat till in the current system timezone.

See also repeatUntil().

void QAppointment::setAlarm ( int minutes, AlarmFlags s )

Sets an alarm for the appointment, minutes before the start of the appointment, with an alarm type of s.

See also clearAlarm(), hasAlarm(), alarm(), and alarmDelay().

void QAppointment::setAllDay ( bool enable = true )

Sets whether the appointment is an an all day appointment to enable. All day appointments have a no set time-zone (empty string).

See also isAllDay() and setTimeZone().

void QAppointment::setDescription ( const QString & text )

Sets the description of the appointment to text.

See also description().

void QAppointment::setEnd ( const QDateTime & time )

Sets the end time of the appointment to time. This will also change the duration of the appointment. time must be at least 5 minutes after the start time of the appointment.

See also end() and endInCurrentTZ().

void QAppointment::setExceptionParent ( const QUniqueId & id )

Sets the uid of the repeating appointment that this an exception to id.

See also exceptionParent().

void QAppointment::setExceptions ( const QList<Exception> & list )

Sets the exceptions for the appointment to those in list.

Note: setting exceptions and updating appointment in the QAppointmentModel will NOT store the exception. Use the functions QAppointmentModel::removeOccurrence(), QAppointmentModel::replaceOccurrence() and QAppointmentModel::replaceRemaining() instead.

See also exceptions().

void QAppointment::setFrequency ( int freq )

Sets the frequency of the appointment to freq. If freq is less than 1 will set the frequency of the appointment to 1.

See also frequency().

void QAppointment::setLocation ( const QString & text )

Set the location of the appointment to text.

See also location().

void QAppointment::setNotes ( const QString & text )   [virtual]

Sets the notes of the appointment to text.

Reimplemented from QPimRecord.

See also notes().

void QAppointment::setRepeatForever ()

Sets the appointment to repeat forever.

See also repeatForever().

void QAppointment::setRepeatOnWeekDay ( int day, bool enable )

Sets the appointment to repeat on the day of the wekif enable is true. Otherwise sets the appointment not to repeat on the day of the week.

Event will always repeat on the day of the week that it started on.

See also repeatOnWeekDay().

void QAppointment::setRepeatRule ( RepeatRule t )

Sets the repeat type of the appointment to t.

See also repeatRule(), hasRepeat(), and RepeatRule.

void QAppointment::setRepeatUntil ( const QDate & date )

Sets the date the appointment will repeat until to date. If date is before the end of the first appointment will set the appointment to occur once.

See also repeatUntil() and repeatForever().

void QAppointment::setShowOnNearest ( bool b )

Sets whether to show a repeating appointment on the nearest previous date if the day it would repeat on does not exist to b.

An example would be a repeating appointment that occures on the 31st of each month. Setting showOnNearest to true will have the appointment show up on the 30th on months that do not have 31 days, (or 28/29 in the case of Febuary).

See also showOnNearest().

void QAppointment::setStart ( const QDateTime & time )

Sets the start time of the appointment to time. This will change the end time fo the appointment to maintain the same duration.

See also start() and startInCurrentTZ().

void QAppointment::setTimeZone ( const QTimeZone & zone )

Sets the time zone of the appointment to zone. This will affect when the appointment occurs in UTC. All day appointments cannot have a time zone set.

Setting the time zone to an invalid QTimeZone will cause the appointment to have no associated time zone.

See also timeZone() and isAllDay().

void QAppointment::setWeekFlags ( WeekFlags f )

Sets the days of the weeek the appointment occurs on to be those specified by the flags f.

See also weekFlags().

bool QAppointment::showOnNearest () const

Returns if the exact date the appointment would occur is not a valid date. and the appointment should be shown on the nearest match of an occurrence

See also setShowOnNearest().

QDateTime QAppointment::start () const

Returns when the first occurrence of the appointment starts.

See also startInCurrentTZ() and setStart().

QDateTime QAppointment::startInCurrentTZ () const

Returns the start time of the appointment in the current system timezone.

See also start().

QTimeZone QAppointment::timeZone () const

Returns the time zone of the appointment or an invalid QTimeZone if the appointment has no time zone. All day appointments allways have no time zone.

See also setTimeZone() and isAllDay().

int QAppointment::toDateDay ( WeekFlag day )   [static]

Returns the Qt::DayOfWeek associated with day.

QUniqueId & QAppointment::uidRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QUniqueId & QAppointment::uidRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

WeekFlags QAppointment::weekFlags () const

Returns the flags representing the days of the week the appointment occurs on when set as a Weekly recuring event.

See also setWeekFlags().

int QAppointment::weekOffset () const

Returns the instance of the week the appointment will occur for the repeat types MonthlyDay and MonthlyEndDay. The week offset is determined by the starting date of the appointment.

if (weekOffset() == 1) appointment occurs in first week of the month. if (weekOffset() == 3) appointment occurs in third week of the month. if (weekOffset() == -1) appointment occurs in last week of the month.

Returns 0 if there is no week offset for the appointment.

void QAppointment::writeVCalendar ( const QString & filename, const QList<QAppointment> & appointments )   [static]

Write the list of appointments as vCalendar objects to the file specified by filename.

See also readVCalendar().

void QAppointment::writeVCalendar ( const QString & filename, const QAppointment & appointment )   [static]

This is an overloaded member function, provided for convenience.

Write the appointment as a vCalendar to the file specified by filename.

See also readVCalendar().

bool QAppointment::operator!= ( const QAppointment & other ) const

Returns true if the appoinment is not equal to other. Otherwise returns false.

QAppointment & QAppointment::operator= ( const QAppointment & other )

Sets the appointment to be a copy of other.

bool QAppointment::operator== ( const QAppointment & other ) const

Returns true if the appointment is equal to other. Otherwise returns false.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7