libkcal

KCal::IncidenceBase Class Reference

#include <incidencebase.h>

Inheritance diagram for KCal::IncidenceBase:

KCal::CustomProperties KCal::FreeBusy KCal::Incidence KCal::Event KCal::Journal KCal::Todo

List of all members.


Detailed Description

This class provides the base class common to all calendar components.

Definition at line 45 of file incidencebase.h.


Public Types

enum  Field {
  FieldDtStart, FieldDtEnd, FieldLastModified, FieldDescription,
  FieldSummary, FieldLocation, FieldCompleted, FieldPercentComplete,
  FieldDtDue, FieldCategories, FieldRelatedTo, FieldRecurrence,
  FieldAttachment, FieldSecrecy, FieldStatus, FieldTransparency,
  FieldResources, FieldPriority, FieldGeoLatitude, FieldGeoLongitude,
  FieldRecurrenceId, FieldAlarms, FieldSchedulingId, FieldAttendees,
  FieldOrganizer, FieldCreated, FieldRevision, FieldDuration,
  FieldContact, FieldComment, FieldUid, FieldUnknown
}
enum  { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }

Public Member Functions

 IncidenceBase (const IncidenceBase &)
IncidenceBaseoperator= (const IncidenceBase &i)
bool operator== (const IncidenceBase &) const
virtual bool accept (Visitor &)
virtual QCString type () const =0
void setUid (const QString &)
QString uid () const
void setLastModified (const QDateTime &lm)
QDateTime lastModified () const
void setOrganizer (const Person &o)
void setOrganizer (const QString &o)
Person organizer () const
virtual void setReadOnly (bool)
bool isReadOnly () const
virtual void setDtStart (const QDateTime &dtStart)
virtual QDateTime dtStart () const
virtual KDE_DEPRECATED QString dtStartTimeStr () const
virtual KDE_DEPRECATED QString dtStartDateStr (bool shortfmt=true) const
virtual KDE_DEPRECATED QString dtStartStr () const
virtual void setDuration (int seconds)
int duration () const
void setHasDuration (bool)
bool hasDuration () const
bool doesFloat () const
void setFloats (bool f)
void addComment (const QString &comment)
bool removeComment (const QString &comment)
void clearComments ()
QStringList comments () const
void addAttendee (Attendee *attendee, bool doUpdate=true)
void clearAttendees ()
const Attendee::List & attendees () const
int attendeeCount () const
AttendeeattendeeByMail (const QString &) const
AttendeeattendeeByMails (const QStringList &, const QString &email=QString::null) const
AttendeeattendeeByUid (const QString &uid) const
void setSyncStatus (int status)
void setSyncStatusSilent (int status)
int syncStatus () const
void setPilotId (unsigned long id)
unsigned long pilotId () const
void registerObserver (Observer *)
void unRegisterObserver (Observer *)
void updated ()
void updatedSilent ()
QPtrList< Observer > observers () const
QMap< IncidenceBase::Field, bool > dirtyFields () const
void resetDirtyFields ()
void setFieldDirty (IncidenceBase::Field field)

Protected Member Functions

virtual void customPropertyUpdated ()

Protected Attributes

bool mReadOnly

Classes

class  Visitor
 This class provides the interface for a visitor of calendar components. More...

Member Enumeration Documentation

Enumerator:
FieldDtEnd  > Field representing the DTSTART component.
FieldLastModified  > Field representing the DTEND component.
FieldDescription  > Field representing the LAST-MODIFIED component.
FieldSummary  > Field representing the DESCRIPTION component.
FieldLocation  > Field representing the SUMMARY component.
FieldCompleted  > Field representing the LOCATION component.
FieldPercentComplete  > Field representing the COMPLETED component.
FieldDtDue  > Field representing the PERCENT-COMPLETE component.
FieldCategories  > Field representing the DUE component.
FieldRelatedTo  > Field representing the CATEGORIES component.
FieldRecurrence  > Field representing the RELATED-TO component.
FieldAttachment  > Field representing the EXDATE, EXRULE, RDATE, and RRULE components.
FieldSecrecy  > Field representing the ATTACH component.
FieldStatus  > Field representing the CLASS component.
FieldTransparency  > Field representing the STATUS component.
FieldResources  > Field representing the TRANSPARENCY component.
FieldPriority  > Field representing the RESOURCES component.
FieldGeoLatitude  > Field representing the PRIORITY component.
FieldGeoLongitude  > Field representing the latitude part of the GEO component.
FieldRecurrenceId  > Field representing the longitude part of the GEO component.
FieldAlarms  > Field representing the RECURRENCE-ID component.
FieldSchedulingId  > Field representing the VALARM component.
FieldAttendees  > Field representing the X-KDE-LIBKCAL-ID component.
FieldOrganizer  > Field representing the ATTENDEE component.
FieldCreated  > Field representing the ORGANIZER component.
FieldRevision  > Field representing the CREATED component.
FieldDuration  > Field representing the SEQUENCE component.
FieldContact  > Field representing the DURATION component.
FieldComment  > Field representing the CONTACT component.
FieldUid  > Field representing the COMMENT component.
FieldUnknown  > Field representing the UID component.

> Something changed. This is set when you use the assignment operator.

Definition at line 50 of file incidencebase.h.

anonymous enum

Pilot synchronization states.

Definition at line 271 of file incidencebase.h.


Member Function Documentation

virtual bool KCal::IncidenceBase::accept ( Visitor  )  [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); }
      

Reimplemented in KCal::Journal.

Definition at line 144 of file incidencebase.h.

void IncidenceBase::setUid ( const QString &  uid  ) 

Set the unique id for the event.

Definition at line 136 of file incidencebase.cpp.

QString IncidenceBase::uid (  )  const

Return the unique id for the event.

Definition at line 142 of file incidencebase.cpp.

void IncidenceBase::setLastModified ( const QDateTime &  lm  ) 

Sets the time the incidence was last modified.

Definition at line 147 of file incidencebase.cpp.

QDateTime IncidenceBase::lastModified (  )  const

Return the time the incidence was last modified.

Definition at line 161 of file incidencebase.cpp.

void IncidenceBase::setOrganizer ( const Person o  ) 

sets the organizer for the event

Definition at line 166 of file incidencebase.cpp.

void IncidenceBase::setReadOnly ( bool  readOnly  )  [virtual]

Set readonly status.

Reimplemented in KCal::Incidence.

Definition at line 191 of file incidencebase.cpp.

bool KCal::IncidenceBase::isReadOnly (  )  const [inline]

Return if the object is read-only.

Definition at line 166 of file incidencebase.h.

void IncidenceBase::setDtStart ( const QDateTime &  dtStart  )  [virtual]

for setting the event's starting date/time with a QDateTime.

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

Definition at line 196 of file incidencebase.cpp.

QDateTime IncidenceBase::dtStart (  )  const [virtual]

returns an event's starting date/time as a QDateTime.

Definition at line 203 of file incidencebase.cpp.

QString IncidenceBase::dtStartTimeStr (  )  const [virtual]

returns an event's starting time as a string formatted according to the users locale settings.

Deprecated:
use IncidenceFormatter::timeToString()

Definition at line 208 of file incidencebase.cpp.

QString IncidenceBase::dtStartDateStr ( bool  shortfmt = true  )  const [virtual]

returns an event's starting date as a string formatted according to the users locale settings

Deprecated:
use IncidenceFormatter::dateToString()

Definition at line 213 of file incidencebase.cpp.

QString IncidenceBase::dtStartStr (  )  const [virtual]

returns an event's starting date and time as a string formatted according to the users locale settings

Deprecated:
use IncidenceFormatter::dateTimeToString()

Definition at line 218 of file incidencebase.cpp.

bool IncidenceBase::doesFloat (  )  const

Return true or false depending on whether the incidence "floats," i.e.

has a date but no time attached to it.

Definition at line 224 of file incidencebase.cpp.

void IncidenceBase::setFloats ( bool  f  ) 

Set whether the incidence floats, i.e.

has a date but no time attached to it.

Reimplemented in KCal::Incidence.

Definition at line 229 of file incidencebase.cpp.

void IncidenceBase::addComment ( const QString &  comment  ) 

Add a comment to this incidence.

Does not add a linefeed character. Just appends the text as passed in.

Parameters:
comment The comment to add.

Definition at line 237 of file incidencebase.cpp.

bool IncidenceBase::removeComment ( const QString &  comment  ) 

Remove a comment from the event.

Removes first comment whose string is an exact match for the string passed in.

Returns:
true if match found, false otherwise.

Definition at line 243 of file incidencebase.cpp.

void IncidenceBase::clearComments (  ) 

Delete all comments associated with this incidence.

Definition at line 259 of file incidencebase.cpp.

QStringList IncidenceBase::comments (  )  const

Return all comments associated with this incidence.

Definition at line 265 of file incidencebase.cpp.

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 271 of file incidencebase.cpp.

void IncidenceBase::clearAttendees (  ) 

Remove all Attendees.

Definition at line 305 of file incidencebase.cpp.

const Attendee::List& KCal::IncidenceBase::attendees (  )  const [inline]

Return list of attendees.

Definition at line 249 of file incidencebase.h.

int KCal::IncidenceBase::attendeeCount (  )  const [inline]

Return number of attendees.

Definition at line 253 of file incidencebase.h.

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

Return the Attendee with this email address.

Definition at line 312 of file incidencebase.cpp.

Attendee * IncidenceBase::attendeeByMails ( const QStringList &  emails,
const QString &  email = QString::null 
) const

Return first Attendee with one of the given email addresses.

Definition at line 322 of file incidencebase.cpp.

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

Return attendee with given uid.

Definition at line 338 of file incidencebase.cpp.

void IncidenceBase::setSyncStatus ( int  status  ) 

Set synchronisation satus.

Definition at line 371 of file incidencebase.cpp.

int IncidenceBase::syncStatus (  )  const

Return synchronisation status.

Definition at line 384 of file incidencebase.cpp.

void IncidenceBase::setPilotId ( unsigned long  id  ) 

Set Pilot Id.

Definition at line 389 of file incidencebase.cpp.

unsigned long IncidenceBase::pilotId (  )  const

Return Pilot Id.

Definition at line 397 of file incidencebase.cpp.

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

Register observer.

The observer is notified when the observed object changes.

Definition at line 402 of file incidencebase.cpp.

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

Unregister observer.

It isn't notified anymore about changes.

Definition at line 407 of file incidencebase.cpp.

void IncidenceBase::updated (  ) 

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

Definition at line 412 of file incidencebase.cpp.

QMap< IncidenceBase::Field, bool > IncidenceBase::dirtyFields (  )  const

Returns a QMap with all Fields that were changed since the incidence was created or resetDirtyFields() was called.

Only FieldPercentComplete and FieldAttendees are currently set. The rest of this feature will be implemented when it's needed.

See also:
resetDirtyFields()

Definition at line 445 of file incidencebase.cpp.

void IncidenceBase::resetDirtyFields (  ) 

Resets dirty fields.

See also:
dirtyFields()

Definition at line 450 of file incidencebase.cpp.

void IncidenceBase::setFieldDirty ( IncidenceBase::Field  field  ) 

Marks Field field as dirty.

Only FieldPercentComplete and FieldAttendees are currently set. The rest of this feature will be implemented when it's needed.

See also:
dirtyFields()

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


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys