• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • IncidenceBase
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KCal::IncidenceBase Class Referenceabstract

#include <incidencebase.h>

Inheritance diagram for KCal::IncidenceBase:
KCal::CustomProperties KCal::FreeBusy KCal::Incidence KCal::Event KCal::Journal KCal::Todo

Classes

class  IncidenceObserver
 
class  Visitor
 

Public Member Functions

 IncidenceBase ()
 
 IncidenceBase (const IncidenceBase &ib)
 
virtual ~IncidenceBase ()
 
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
 
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 Person &organizer)
 
void setOrganizer (const QString &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
 
- Public Member Functions inherited from KCal::CustomProperties
 CustomProperties ()
 
 CustomProperties (const CustomProperties &other)
 
virtual ~CustomProperties ()
 
QMap< QByteArray, QString > customProperties () const
 
QString customProperty (const QByteArray &app, const QByteArray &key) const
 
QString nonKDECustomProperty (const QByteArray &name) const
 
CustomProperties & operator= (const CustomProperties &other)
 
bool operator== (const CustomProperties &properties) const
 
void removeCustomProperty (const QByteArray &app, const QByteArray &key)
 
void removeNonKDECustomProperty (const QByteArray &name)
 
void setCustomProperties (const QMap< QByteArray, QString > &properties)
 
void setCustomProperty (const QByteArray &app, const QByteArray &key, const QString &value)
 
void setNonKDECustomProperty (const QByteArray &name, const QString &value)
 

Protected Member Functions

virtual void customPropertyUpdated ()
 

Protected Attributes

bool mReadOnly
 

Additional Inherited Members

- Static Public Member Functions inherited from KCal::CustomProperties
static QByteArray customPropertyName (const QByteArray &app, const QByteArray &key)
 

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:

IncidenceBase

  • FreeBusy
  • Incidence
    • Event
    • Todo
    • Journal

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.

Constructor & Destructor Documentation

IncidenceBase::IncidenceBase ( )

Constructs an empty IncidenceBase.

Private class that helps to provide binary compatibility between releases.

Definition at line 110 of file incidencebase.cpp.

IncidenceBase::IncidenceBase ( const IncidenceBase &  ib)

Constructs an IncidenceBase as a copy of another IncidenceBase object.

Parameters
ibis the IncidenceBase to copy.

Definition at line 118 of file incidencebase.cpp.

IncidenceBase::~IncidenceBase ( )
virtual

Destroys the IncidenceBase.

Definition at line 125 of file incidencebase.cpp.

Member Function Documentation

virtual bool KCal::IncidenceBase::accept ( Visitor &  v)
inlinevirtual

Accept IncidenceVisitor.

A class taking part in the visitor mechanism has to provide this implementation:

  bool accept(Visitor &v) { return v.visit(this); }
Parameters
vis a reference to a Visitor object.

Definition at line 228 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
attendeea pointer to the attendee to add
doUpdateIf true the Observers are notified, if false they are not.

Definition at line 361 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
commentis the QString containing the comment to add.
See Also
removeComment().

Definition at line 331 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 309 of file incidencebase.cpp.

Attendee * IncidenceBase::attendeeByMail ( const QString &  email) const

Returns the attendee with the specified email address.

Parameters
emailis a QString containing an email address of the form "FirstName LastName <emailaddress>".
See Also
attendeeByMails(), attendeesByUid().

Definition at line 396 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
emailsis a list of QStrings containing email addresses of the form "FirstName LastName <emailaddress>".
emailis a QString containing a single email address to search in addition to the list specified in emails.
See Also
attendeeByMail(), attendeesByUid().

Definition at line 408 of file incidencebase.cpp.

Attendee * IncidenceBase::attendeeByUid ( const QString &  uid) const

Returns the incidence attendee with the specified attendee UID.

Parameters
uidis a QString containing an attendee UID.
See Also
attendeeByMail(), attendeeByMails().

Definition at line 428 of file incidencebase.cpp.

int IncidenceBase::attendeeCount ( ) const

Returns the number of incidence attendees.

Definition at line 382 of file incidencebase.cpp.

const Attendee::List & IncidenceBase::attendees ( ) const

Returns a list of incidence attendees.

Definition at line 377 of file incidencebase.cpp.

void IncidenceBase::clearAttendees ( )

Removes all attendees from the incidence.

Definition at line 387 of file incidencebase.cpp.

void IncidenceBase::clearComments ( )

Deletes all incidence comments.

Definition at line 351 of file incidencebase.cpp.

QStringList IncidenceBase::comments ( ) const

Returns all incidence comments as a list of strings.

Definition at line 356 of file incidencebase.cpp.

void IncidenceBase::customPropertyUpdated ( )
protectedvirtual

The default implementation does nothing: override in derived classes to perform change processing.

Reimplemented from KCal::CustomProperties.

Definition at line 502 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 247 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
shortfmtIf set to true, use short date format, if set to false use long format.
specIf set, return the date in the given spec, else use the incidence's current spec.
Deprecated:
use IncidenceFormatter::dateToString()

Reimplemented in KCal::Todo.

Definition at line 268 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
shortfmtIf set to true, use short date format, if set to false use long format.
specIf set, return the date and time in the given spec, else use the incidence's current spec.
Deprecated:
use IncidenceFormatter::dateTimeToString()

Reimplemented in KCal::Todo.

Definition at line 286 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
shortfmtIf set to true, use short date format, if set to false use long format.
specIf set, return the time in the given spec, else use the incidence's current spec.
Deprecated:
use IncidenceFormatter::timeToString()

Reimplemented in KCal::Todo.

Definition at line 252 of file incidencebase.cpp.

Duration IncidenceBase::duration ( ) const

Returns the length of the incidence duration.

See Also
setDuration()

Definition at line 447 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 492 of file incidencebase.cpp.

bool IncidenceBase::hasDuration ( ) const

Returns true if the incidence has a duration; false otherwise.

See Also
setHasDuration()

Definition at line 457 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 318 of file incidencebase.h.

KDateTime IncidenceBase::lastModified ( ) const

Returns the time the incidence was last modified.

See Also
setLastModified()

Definition at line 202 of file incidencebase.cpp.

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

Assignment operator.

Warning
Not polymorphic. Use AssignmentVisitor for correct assignment of an instance of type IncidenceBase to another instance of type IncidenceBase.
Parameters
otheris the IncidenceBase to assign.
See Also
AssignmentVisitor

Definition at line 130 of file incidencebase.cpp.

bool IncidenceBase::operator== ( const IncidenceBase &  ib) const

Compares this with IncidenceBase ib for equality.

Warning
Not polymorphic. Use ComparisonVisitor for correct comparison of two instances of type IncidenceBase.
Parameters
ibis the IncidenceBase to compare.
See Also
ComparisonVisitor

Definition at line 143 of file incidencebase.cpp.

Person IncidenceBase::organizer ( ) const

Returns the Person associated with this incidence.

See Also
setOrganizer(const QString &), setOrganizer(const Person &)

Definition at line 229 of file incidencebase.cpp.

void IncidenceBase::registerObserver ( IncidenceBase::IncidenceObserver *  observer)

Register observer.

The observer is notified when the observed object changes.

Parameters
observeris a pointer to an IncidenceObserver object that will be watching this incidence.
See Also
unRegisterObserver()

Definition at line 462 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
commentis the QString containing the comment to remove.
Returns
true if match found, false otherwise.
See Also
addComment().

Definition at line 336 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
allDaysets whether the incidence is all-day.
See Also
allDay()

Definition at line 314 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
dtStartis the incidence start date/time.
See Also
dtStart().

Reimplemented in KCal::Incidence, KCal::Todo, and KCal::FreeBusy.

Definition at line 239 of file incidencebase.cpp.

void IncidenceBase::setDuration ( const Duration &  duration)
virtual

Sets the incidence duration.

Parameters
durationthe incidence duration
See Also
duration()

Reimplemented in KCal::Event.

Definition at line 440 of file incidencebase.cpp.

void IncidenceBase::setHasDuration ( bool  hasDuration)

Sets if the incidence has a duration.

Parameters
hasDurationtrue if the incidence has a duration; false otherwise.
See Also
hasDuration()

Definition at line 452 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
lmis the KDateTime when the incidence was last modified.
See Also
lastModified()

Definition at line 188 of file incidencebase.cpp.

void IncidenceBase::setOrganizer ( const Person &  organizer)

Sets the organizer for the incidence.

Parameters
organizeris a Person to use as the incidence organizer.
See Also
organizer(), setOrganizer(const QString &)

Definition at line 207 of file incidencebase.cpp.

void IncidenceBase::setOrganizer ( const QString &  organizer)

Sets the incidence organizer to any string organizer.

Parameters
organizeris a string to use as the incidence organizer.
See Also
organizer(), setOrganizer(const Person &)

Definition at line 217 of file incidencebase.cpp.

void IncidenceBase::setReadOnly ( bool  readOnly)
virtual

Sets readonly status.

Parameters
readOnlyif set, the incidence is read-only; else the incidence can be modified.
See Also
isReadOnly().

Reimplemented in KCal::Incidence.

Definition at line 234 of file incidencebase.cpp.

void IncidenceBase::setUid ( const QString &  uid)

Returns the type of Incidence as a translated string.

Sets the unique id for the incidence to uid.

Parameters
uidis the string containing the incidence uid.
See Also
uid()

Definition at line 177 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
oldSpecthe time specification which provides the clock times
newSpecthe new time specification

Reimplemented in KCal::Todo, KCal::Incidence, KCal::Event, and KCal::FreeBusy.

Definition at line 323 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 487 of file incidencebase.cpp.

virtual QByteArray KCal::IncidenceBase::type ( ) const
pure virtual

Prints the type of Incidence as a string.

Implemented in KCal::FreeBusy, KCal::Event, KCal::Todo, and KCal::Journal.

QString IncidenceBase::uid ( ) const

Returns the unique id (uid) for the incidence.

See Also
setUid()

Definition at line 183 of file incidencebase.cpp.

void IncidenceBase::unRegisterObserver ( IncidenceBase::IncidenceObserver *  observer)

Unregister observer.

It isn't notified anymore about changes.

Parameters
observeris a pointer to an IncidenceObserver object that will be watching this incidence.
See Also
registerObserver().

Definition at line 469 of file incidencebase.cpp.

void IncidenceBase::updated ( )

Call this to notify the observers after the IncidenceBase object has changed.

Definition at line 474 of file incidencebase.cpp.

KUrl IncidenceBase::uri ( ) const

Returns the uri for the incidence, of form urn:x-ical:<uid>

Definition at line 507 of file incidencebase.cpp.

Member Data Documentation

bool KCal::IncidenceBase::mReadOnly
protected

Identifies a read-only incidence.

Definition at line 577 of file incidencebase.h.


The documentation for this class was generated from the following files:
  • incidencebase.h
  • incidencebase.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:29:20 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal