Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QAppointment Class Reference
[QtMessagingModule, QtPimModule, QtTelephonyModule, QtUiModule]

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 scheduling information. Appointments can also repeat and have exceptions to their repeat rules. Repetition of appointments is defined by the appointment's repeatRule(), frequency(), weekFlags() and start(). The repeat rule defines what type of repetition the appointment has and how to interpret the other aspect of repetition information. For instance Daily indicates that the appointment repeats every N days, where N is provided by the frequency() of the appointment. Whereas Weekly would indicate every N weeks, where N is the frequency() and the weekFlags() function indicates on which days of the week the appointment occurs.

The start date is used to determine the Instance of the occurrence. For example if the start date of the appointment is the 16th of April, then for the purposes of the repeat MonthlyDate rule, the Instance is 16. This differs from some other systems that explicitly store the Instance information separate from the start information. In Qt Extended the start of an appointment must always be a valid occurrence for the appointments repetition behavior.

See also Pim Library.


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 appointment 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, MonthlyDay or MonthlyEndDay.

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. The start time is set to the current time, and the end time is five minutes after the current time.

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. If end is less than five minutes after start, the appointment will be created with an end time of five minutes after the start value.

QAppointment::~QAppointment ()   [virtual]

Destroys the appointment.

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 ends.

See also endInCurrentTZ() and setEnd().

QDateTime QAppointment::endInCurrentTZ () const

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

See also end().

QDate QAppointment::exceptionDate () const

Returns the date of the repeating appointment to which this appointment is an exception.

QUniqueId QAppointment::exceptionParent () const

Returns the identifier of the repeating appointment to which this appointment is an exception.

See also setExceptionParent().

QList<Exception> QAppointment::exceptions () const

Returns the list of exceptions to the appointment's 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::hasExceptions () const

Returns if there are any exceptions to the appointments recurrence rule.

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 does not occur on or after from then a null occurrence is returned.

QString QAppointment::notes () const   [virtual]

Returns the notes of the appointment.

Reimplemented from QPimRecord.

See also setNotes().

QList<QAppointment> QAppointment::readVCalendar ( QIODevice * device )   [static]

Reads a list of vCalendars from the given device and returns the equivalent set of appointments.

See also writeVCalendar().

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

This function is deprecated.

This is an overloaded member function, provided for convenience.

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

See also writeVCalendar().

QList<QAppointment> QAppointment::readVCalendar ( const QByteArray & vcal )   [static]

This function is deprecated.

This is an overloaded member function, provided for convenience.

Reads the given VCalendar data in vcal and returns the list of near equivalent appointments.

See also writeVCalendar().

QList<QAppointment> QAppointment::readVCalendarData ( const char * data, unsigned long len )   [static]

This function is deprecated.

Reads the data of len bytes 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 appointment is set to repeat on the given 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 until in the current system timezone.

See also repeatUntil().

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

Sets the alarm action to precede the start of the appointment by the specified minutes.

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

void QAppointment::setAllDay ( bool enable = true )

Sets the appointment to an all day appointment if enable is true. All day appointments have a no set time-zone.

See also isAllDay() and setTimeZone().

void QAppointment::setAsException ( const QUniqueId & identifier, const QDate & date )

Sets the appointment to be an exception to the recurring appointment with the specified identifier. The appointment is specified to replace the occurrence that occurs on the given date.

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 & identifier )

Sets this appointment to be an exception to an appointment with the specified identifier.

See also exceptionParent().

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

Sets the exceptions for the appointment to the specified 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 frequency )

Sets the repeat frequency of the appointment. If the specified frequency is less than 1 will set the repeat 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 specified day of the week if enable is true. Otherwise sets the appointment not to repeat on the specified 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 appointment to repeat until the specified date. If the 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 nearest )

If nearest is true sets the repeating appointment to occur on the nearest previous date if the day it would would normally occur on does not exist.

As an example, for an appointment repeats on the 31st of each month passing true to this function will cause the appointment to occur on the 30th in June as the 31st of June is not a valid date.

See also showOnNearest().

void QAppointment::setStart ( const QDateTime & time )

Sets the start time of the appointment to time. This will change the end time of 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 days )

Sets the days of the week the appointment occurs on to the specified days.

See also weekFlags().

bool QAppointment::showOnNearest () const

Returns true if the repeating appointment occurs on the nearest previous date in cases where the date it would normally occur on is invalid.

As an example, an appointment that normally repeats on the 31st of each month and returns true for this function will occur on the 30th in June as the 31st of June is not a valid date.

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 always 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 recurring 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.

bool QAppointment::writeVCalendar ( QIODevice * device, const QList<QAppointment> & appointments )   [static]

Writes the given list of appointments to the given device as vCalendars.

Returns true on success.

See also readVCalendar().

bool QAppointment::writeVCalendar ( QIODevice * device, const QAppointment & appointment )   [static]

This is an overloaded member function, provided for convenience.

Writes the given appointment to the given device as vCalendars.

Returns true on success.

See also readVCalendar().

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

This function is deprecated.

This is an overloaded member function, provided for convenience.

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 function is deprecated.

This is an overloaded member function, provided for convenience.

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

See also readVCalendar().

void QAppointment::writeVCalendar ( const QString & filename ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes the appointment as a vCalendar object to the file specified by filename.

Returns true on success, false on fail.

See also readVCalendar().

void QAppointment::writeVCalendar ( QFile & file ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes the appointment as a vCalendar object to the given file, which must be already open for writing.

See also readVCalendar().

void QAppointment::writeVCalendar ( QDataStream * stream ) const

This function is deprecated.

This is an overloaded member function, provided for convenience.

Writes the appointment as a vCalendar object to the given stream, which must be writable.

See also readVCalendar().

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

Returns true if this appointment 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 this appointment is equal to other. Otherwise returns false.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3