KCal Library
KCal::IncidenceBase Class Reference
#include <incidencebase.h>

Detailed Description
An abstract class that provides a common base for all calendar incidence classes.define: organizer (person) define: uid (same as the attendee uid?)
Several properties are not allowed for VFREEBUSY objects (see rfc:2445), so they are not in IncidenceBase. The hierarchy is:
So IncidenceBase contains all properties that are common to all classes, and Incidence contains all additional properties that are common to Events, Todos and Journals, but are not allowed for FreeBusy entries.
Definition at line 102 of file incidencebase.h.
Public Member Functions | |
virtual bool | accept (Visitor &v) |
void | addAttendee (Attendee *attendee, bool doUpdate=true) |
void | addComment (const QString &comment) |
bool | allDay () const |
Attendee * | attendeeByMail (const QString &email) const |
Attendee * | attendeeByMails (const QStringList &emails, const QString &email=QString()) const |
Attendee * | attendeeByUid (const QString &uid) const |
int | attendeeCount () const |
const Attendee::List & | attendees () const |
void | clearAttendees () |
void | clearComments () |
QStringList | comments () const |
virtual KDateTime | dtStart () const |
virtual QString | dtStartDateStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const |
virtual QString | dtStartStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const |
virtual QString | dtStartTimeStr (bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec()) const |
Duration | duration () const |
void | endUpdates () |
bool | hasDuration () const |
IncidenceBase (const IncidenceBase &ib) | |
IncidenceBase () | |
bool | isReadOnly () const |
KDateTime | lastModified () const |
IncidenceBase & | operator= (const IncidenceBase &other) |
bool | operator== (const IncidenceBase &ib) const |
Person | organizer () const |
void | registerObserver (IncidenceObserver *observer) |
bool | removeComment (const QString &comment) |
void | setAllDay (bool allDay) |
virtual void | setDtStart (const KDateTime &dtStart) |
virtual void | setDuration (const Duration &duration) |
void | setHasDuration (bool hasDuration) |
void | setLastModified (const KDateTime &lm) |
void | setOrganizer (const QString &organizer) |
void | setOrganizer (const Person &organizer) |
virtual void | setReadOnly (bool readOnly) |
void | setUid (const QString &uid) |
virtual void | shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec) |
void | startUpdates () |
virtual QByteArray | type () const =0 |
QString | uid () const |
void | unRegisterObserver (IncidenceObserver *observer) |
void | updated () |
KUrl | uri () const |
virtual | ~IncidenceBase () |
Protected Member Functions | |
virtual void | customPropertyUpdated () |
Protected Attributes | |
bool | mReadOnly |
Classes | |
class | IncidenceObserver |
The IncidenceObserver class. More... | |
class | Visitor |
This class provides the interface for a visitor of calendar components. More... |
Constructor & Destructor Documentation
IncidenceBase::IncidenceBase | ( | ) |
Constructs an empty IncidenceBase.
Private class that helps to provide binary compatibility between releases.
For internal use only.
Definition at line 109 of file incidencebase.cpp.
IncidenceBase::IncidenceBase | ( | const IncidenceBase & | ib | ) |
Constructs an IncidenceBase as a copy of another IncidenceBase object.
- Parameters:
-
ib is the IncidenceBase to copy.
Definition at line 117 of file incidencebase.cpp.
IncidenceBase::~IncidenceBase | ( | ) | [virtual] |
Member Function Documentation
virtual bool KCal::IncidenceBase::accept | ( | Visitor & | v | ) | [inline, virtual] |
Accept IncidenceVisitor.
A class taking part in the visitor mechanism has to provide this implementation:
bool accept(Visitor &v) { return v.visit(this); }
- Parameters:
-
v is a reference to a Visitor object.
Definition at line 213 of file incidencebase.h.
void IncidenceBase::addAttendee | ( | Attendee * | attendee, | |
bool | doUpdate = true | |||
) |
Add Attendee to this incidence.
IncidenceBase takes ownership of the Attendee object.
- Parameters:
-
attendee a pointer to the attendee to add doUpdate If true the Observers are notified, if false they are not.
Definition at line 355 of file incidencebase.cpp.
void IncidenceBase::addComment | ( | const QString & | comment | ) |
Adds a comment to thieincidence.
Does not add a linefeed character; simply appends the text as specified.
- Parameters:
-
comment is the QString containing the comment to add.
- See also:
- removeComment().
Definition at line 325 of file incidencebase.cpp.
bool IncidenceBase::allDay | ( | ) | const |
Returns true or false depending on whether the incidence is all-day.
i.e. has a date but no time attached to it.
- See also:
- setAllDay()
Definition at line 303 of file incidencebase.cpp.
Attendee * IncidenceBase::attendeeByMail | ( | const QString & | ) | const |
Returns the attendee with the specified email address.
- Parameters:
-
email is a QString containing an email address of the form "FirstName LastName <emailaddress>".
- See also:
- attendeeByMails(), attendeesByUid().
Definition at line 390 of file incidencebase.cpp.
Attendee * IncidenceBase::attendeeByMails | ( | const QStringList & | emails, | |
const QString & | email = QString() | |||
) | const |
Returns the first incidence attendee with one of the specified email addresses.
- Parameters:
-
emails is a list of QStrings containing email addresses of the form "FirstName LastName <emailaddress>". email is a QString containing a single email address to search in addition to the list specified in emails
.
- See also:
- attendeeByMail(), attendeesByUid().
Definition at line 402 of file incidencebase.cpp.
Attendee * IncidenceBase::attendeeByUid | ( | const QString & | uid | ) | const |
Returns the incidence attendee with the specified attendee UID.
- Parameters:
-
uid is a QString containing an attendee UID.
- See also:
- attendeeByMail(), attendeeByMails().
Definition at line 422 of file incidencebase.cpp.
int IncidenceBase::attendeeCount | ( | ) | const |
const Attendee::List & IncidenceBase::attendees | ( | ) | const |
void IncidenceBase::clearAttendees | ( | ) |
void IncidenceBase::clearComments | ( | ) |
QStringList IncidenceBase::comments | ( | ) | const |
Returns all incidence comments as a list of strings.
Definition at line 350 of file incidencebase.cpp.
void IncidenceBase::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 494 of file incidencebase.cpp.
KDateTime IncidenceBase::dtStart | ( | ) | const [virtual] |
Returns an incidence's starting date/time as a KDateTime.
- See also:
- setDtStart().
Reimplemented in KCal::Todo.
Definition at line 241 of file incidencebase.cpp.
QString IncidenceBase::dtStartDateStr | ( | bool | shortfmt = true , |
|
const KDateTime::Spec & | spec = KDateTime::Spec() | |||
) | const [virtual] |
Returns an incidence's starting date as a string formatted according to the user's locale settings.
- Parameters:
-
shortfmt If set to true, use short date format, if set to false use long format. spec If set, return the date in the given spec, else use the incidence's current spec.
Reimplemented in KCal::Todo.
Definition at line 262 of file incidencebase.cpp.
QString IncidenceBase::dtStartStr | ( | bool | shortfmt = true , |
|
const KDateTime::Spec & | spec = KDateTime::Spec() | |||
) | const [virtual] |
Returns an incidence's starting date and time as a string formatted according to the user's locale settings.
- Parameters:
-
shortfmt If set to true, use short date format, if set to false use long format. spec If set, return the date and time in the given spec, else use the incidence's current spec.
Reimplemented in KCal::Todo.
Definition at line 280 of file incidencebase.cpp.
QString IncidenceBase::dtStartTimeStr | ( | bool | shortfmt = true , |
|
const KDateTime::Spec & | spec = KDateTime::Spec() | |||
) | const [virtual] |
Returns an incidence's starting time as a string formatted according to the user's locale settings.
- Parameters:
-
shortfmt If set to true, use short date format, if set to false use long format. spec If set, return the time in the given spec, else use the incidence's current spec.
Reimplemented in KCal::Todo.
Definition at line 246 of file incidencebase.cpp.
Duration IncidenceBase::duration | ( | ) | const |
Returns the length of the incidence duration.
- See also:
- setDuration()
Definition at line 441 of file incidencebase.cpp.
void IncidenceBase::endUpdates | ( | ) |
Call this when a group of updates is complete, to notify observers that the instance has changed.
This should be called in conjunction with startUpdates().
Definition at line 484 of file incidencebase.cpp.
bool IncidenceBase::hasDuration | ( | ) | const |
Returns true if the incidence has a duration; false otherwise.
- See also:
- setHasDuration()
Definition at line 451 of file incidencebase.cpp.
bool KCal::IncidenceBase::isReadOnly | ( | ) | const [inline] |
Returns true the object is read-only; false otherwise.
- See also:
- setReadOnly()
Definition at line 298 of file incidencebase.h.
KDateTime IncidenceBase::lastModified | ( | ) | const |
Returns the time the incidence was last modified.
- See also:
- setLastModified()
Definition at line 196 of file incidencebase.cpp.
IncidenceBase & IncidenceBase::operator= | ( | const IncidenceBase & | other | ) |
bool IncidenceBase::operator== | ( | const IncidenceBase & | ib | ) | const |
Compares this with IncidenceBase ib
for equality.
- Parameters:
-
ib is the IncidenceBase to compare.
Definition at line 137 of file incidencebase.cpp.
Person IncidenceBase::organizer | ( | ) | const |
Returns the Person associated with this incidence.
Definition at line 223 of file incidencebase.cpp.
void IncidenceBase::registerObserver | ( | IncidenceBase::IncidenceObserver * | observer | ) |
Register observer.
The observer is notified when the observed object changes.
- Parameters:
-
observer is a pointer to an IncidenceObserver object that will be watching this incidence.
- See also:
- unRegisterObserver()
Definition at line 456 of file incidencebase.cpp.
bool IncidenceBase::removeComment | ( | const QString & | comment | ) |
Removes a comment from the incidence.
Removes the first comment whose string is an exact match for the specified string in comment
.
- Parameters:
-
comment is the QString containing the comment to remove.
- Returns:
- true if match found, false otherwise.
- See also:
- addComment().
Definition at line 330 of file incidencebase.cpp.
void IncidenceBase::setAllDay | ( | bool | allDay | ) |
Sets whether the incidence is all-day, i.e.
has a date but no time attached to it.
- Parameters:
-
allDay sets whether the incidence is all-day.
- See also:
- allDay()
Reimplemented in KCal::Incidence.
Definition at line 308 of file incidencebase.cpp.
void IncidenceBase::setDtStart | ( | const KDateTime & | dtStart | ) | [virtual] |
Sets the incidence's starting date/time with a KDateTime.
The incidence's all-day status is set according to whether dtStart
is a date/time (not all-day) or date-only (all-day).
- Parameters:
-
dtStart is the incidence start date/time.
- See also:
- dtStart().
Reimplemented in KCal::FreeBusy, KCal::Incidence, and KCal::Todo.
Definition at line 233 of file incidencebase.cpp.
void IncidenceBase::setDuration | ( | const Duration & | duration | ) | [virtual] |
Sets the incidence duration.
- Parameters:
-
duration the incidence duration
- See also:
- duration()
Reimplemented in KCal::Event.
Definition at line 434 of file incidencebase.cpp.
void IncidenceBase::setHasDuration | ( | bool | hasDuration | ) |
Sets if the incidence has a duration.
- Parameters:
-
hasDuration true if the incidence has a duration; false otherwise.
- See also:
- hasDuration()
Definition at line 446 of file incidencebase.cpp.
void IncidenceBase::setLastModified | ( | const KDateTime & | lm | ) |
Sets the time the incidence was last modified to lm
.
It is stored as a UTC date/time.
- Parameters:
-
lm is the KDateTime when the incidence was last modified.
- See also:
- lastModified()
Definition at line 182 of file incidencebase.cpp.
void IncidenceBase::setOrganizer | ( | const QString & | organizer | ) |
Sets the incidence organizer to any string organizer
.
- Parameters:
-
organizer is a string to use as the incidence organizer.
- See also:
- organizer(), setOrganizer(const Person &)
Definition at line 211 of file incidencebase.cpp.
void IncidenceBase::setOrganizer | ( | const Person & | organizer | ) |
Sets the organizer for the incidence.
- See also:
- organizer(), setOrganizer(const QString &)
Definition at line 201 of file incidencebase.cpp.
void IncidenceBase::setReadOnly | ( | bool | readOnly | ) | [virtual] |
Sets readonly status.
- Parameters:
-
readOnly if set, the incidence is read-only; else the incidence can be modified.
- See also:
- isReadOnly().
Reimplemented in KCal::Incidence.
Definition at line 228 of file incidencebase.cpp.
void IncidenceBase::setUid | ( | const QString & | uid | ) |
Sets the unique id for the incidence to uid
.
- Parameters:
-
uid is the string containing the incidence uid.
- See also:
- uid()
Definition at line 171 of file incidencebase.cpp.
void IncidenceBase::shiftTimes | ( | const KDateTime::Spec & | oldSpec, | |
const KDateTime::Spec & | newSpec | |||
) | [virtual] |
Shift the times of the incidence so that they appear at the same clock time as before but in a new time zone.
The shift is done from a viewing time zone rather than from the actual incidence time zone.
For example, shifting an incidence whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec
) of Europe/London, to a new time zone (newSpec
) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the incidence start) to 14:00 Paris time.
- Parameters:
-
oldSpec the time specification which provides the clock times newSpec the new time specification
Reimplemented in KCal::Event, KCal::FreeBusy, KCal::Incidence, and KCal::Todo.
Definition at line 317 of file incidencebase.cpp.
void IncidenceBase::startUpdates | ( | ) |
Call this when a group of updates is going to be made.
This suppresses change notifications until endUpdates() is called, at which point updated() will automatically be called.
Definition at line 479 of file incidencebase.cpp.
virtual QByteArray KCal::IncidenceBase::type | ( | ) | const [pure virtual] |
Prints the type of Incidence as a string.
Implemented in KCal::Event, KCal::FreeBusy, KCal::Journal, and KCal::Todo.
QString IncidenceBase::uid | ( | ) | const |
Returns the unique id (uid) for the incidence.
- See also:
- setUid()
Definition at line 177 of file incidencebase.cpp.
void IncidenceBase::unRegisterObserver | ( | IncidenceBase::IncidenceObserver * | observer | ) |
Unregister observer.
It isn't notified anymore about changes.
- Parameters:
-
observer is a pointer to an IncidenceObserver object that will be watching this incidence.
- See also:
- registerObserver().
Definition at line 463 of file incidencebase.cpp.
void IncidenceBase::updated | ( | ) |
Call this to notify the observers after the IncidenceBase object has changed.
Definition at line 468 of file incidencebase.cpp.
KUrl IncidenceBase::uri | ( | ) | const |
Returns the uri for the incidence, of form urn:x-ical:<uid>.
Definition at line 499 of file incidencebase.cpp.
Member Data Documentation
bool KCal::IncidenceBase::mReadOnly [protected] |
The documentation for this class was generated from the following files: