35 #ifndef KCAL_CALENDAR_H
36 #define KCAL_CALENDAR_H
38 #include <QtCore/QObject>
39 #include <QtCore/QString>
40 #include <QtCore/QList>
41 #include <QtCore/QMultiHash>
43 #include <kdatetime.h>
49 #include "kcalversion.h"
62 SortDirectionAscending,
63 SortDirectionDescending
84 TodoSortPercentComplete,
91 enum JournalSortField {
136 explicit Calendar(
const KDateTime::Spec &timeSpec );
151 explicit Calendar(
const QString &timeZoneId );
165 void setProductId(
const QString &
id );
172 QString productId()
const;
181 void setOwner(
const Person &owner );
200 void setTimeSpec(
const KDateTime::Spec &timeSpec );
208 KDateTime::Spec timeSpec()
const;
223 void setTimeZoneId(
const QString &timeZoneId );
232 QString timeZoneId()
const;
248 void setViewTimeSpec(
const KDateTime::Spec &timeSpec )
const;
268 void setViewTimeZoneId(
const QString &timeZoneId )
const;
276 KDateTime::Spec viewTimeSpec()
const;
284 QString viewTimeZoneId()
const;
302 void shiftTimes(
const KDateTime::Spec &oldSpec,
const KDateTime::Spec &newSpec );
329 void setModified(
bool modified );
338 bool isModified()
const;
343 virtual void close() = 0;
350 virtual bool save() = 0;
358 virtual bool reload() = 0;
365 virtual bool isSaving();
372 QStringList categories();
385 virtual bool addIncidence(
Incidence *incidence );
396 virtual bool deleteIncidence(
Incidence *incidence );
429 Incidence *incidence(
const QString &uid );
439 Incidence *incidenceFromSchedulingID(
const QString &sid );
467 virtual bool beginChange(
Incidence *incidence );
474 virtual bool endChange(
Incidence *incidence );
494 const KDateTime::Spec &spec,
495 bool single =
true );
508 virtual bool addEvent(
Event *event ) = 0;
519 virtual bool deleteEvent(
Event *event ) = 0;
525 virtual void deleteAllEvents() = 0;
537 EventSortField sortField,
538 SortDirection sortDirection );
555 const KDateTime::Spec &timeSpec,
556 EventSortField sortField,
557 SortDirection sortDirection );
568 EventSortField sortField = EventSortUnsorted,
569 SortDirection sortDirection = SortDirectionAscending );
593 Event::List events(
const QDate &start,
const QDate &end,
594 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
595 bool inclusive =
false );
612 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
613 EventSortField sortField = EventSortUnsorted,
614 SortDirection sortDirection = SortDirectionAscending );
625 EventSortField sortField = EventSortUnsorted,
626 SortDirection sortDirection = SortDirectionAscending ) = 0;
637 virtual Event::List rawEventsForDate(
const KDateTime &dt ) = 0;
652 virtual Event::List rawEvents(
const QDate &start,
const QDate &end,
653 const KDateTime::Spec &timeSpec = KDateTime::Spec(),
654 bool inclusive =
false ) = 0;
670 const QDate &date,
const KDateTime::Spec &timeSpec = KDateTime::Spec(),
671 EventSortField sortField = EventSortUnsorted,
672 SortDirection sortDirection = SortDirectionAscending ) = 0;
682 virtual Event *event(
const QString &uid ) = 0;
695 virtual bool addTodo(
Todo *todo ) = 0;
706 virtual bool deleteTodo(
Todo *todo ) = 0;
712 virtual void deleteAllTodos() = 0;
724 TodoSortField sortField,
725 SortDirection sortDirection );
736 TodoSortField sortField = TodoSortUnsorted,
737 SortDirection sortDirection = SortDirectionAscending );
746 virtual Todo::List todos(
const QDate &date );
757 TodoSortField sortField = TodoSortUnsorted,
758 SortDirection sortDirection = SortDirectionAscending ) = 0;
767 virtual Todo::List rawTodosForDate(
const QDate &date ) = 0;
777 virtual Todo *todo(
const QString &uid ) = 0;
790 virtual bool addJournal(
Journal *journal ) = 0;
801 virtual bool deleteJournal(
Journal *journal ) = 0;
807 virtual void deleteAllJournals() = 0;
819 JournalSortField sortField,
820 SortDirection sortDirection );
830 JournalSortField sortField = JournalSortUnsorted,
831 SortDirection sortDirection = SortDirectionAscending );
851 JournalSortField sortField = JournalSortUnsorted,
852 SortDirection sortDirection = SortDirectionAscending ) = 0;
861 virtual Journal::List rawJournalsForDate(
const QDate &date ) = 0;
871 virtual Journal *journal(
const QString &uid ) = 0;
885 void beginBatchAdding();
895 void endBatchAdding();
905 virtual void setupRelations(
Incidence *incidence );
913 virtual void removeRelations(
Incidence *incidence );
957 const KDateTime &to ) = 0;
981 virtual void calendarModified(
bool modified,
Calendar *calendar );
988 virtual void calendarIncidenceAdded(
Incidence *incidence );
995 virtual void calendarIncidenceChanged(
Incidence *incidence );
1002 virtual void calendarIncidenceDeleted(
Incidence *incidence );
1013 void registerObserver( CalendarObserver *observer );
1023 void unregisterObserver( CalendarObserver *observer );
1025 using QObject::event;
1031 void calendarChanged();
1036 void calendarSaved();
1041 void calendarLoaded();
1047 void batchAddingBegins();
1053 void batchAddingEnds();
1069 virtual void doSetTimeSpec(
const KDateTime::Spec &timeSpec );
1076 void notifyIncidenceAdded(
Incidence *incidence );
1083 void notifyIncidenceChanged(
Incidence *incidence );
1090 void notifyIncidenceDeleted(
Incidence *incidence );
1096 virtual void customPropertyUpdated();
1104 void setObserversEnabled(
bool enabled );
1116 const KDateTime &from,
const KDateTime &to );
1128 const KDateTime &from,
const KDateTime &to );
A class to manage custom calendar properties.
This file is part of the API for handling calendar data and defines the CustomProperties class...
Provides a To-do in the sense of RFC2445.
Represents the main calendar class.
An abstract class that provides a common base for all calendar incidence classes. ...
Provides a filter for calendars.
This class provides an Event in the sense of RFC2445.
The IncidenceObserver class.
virtual ~CalendarObserver()
Destructor.
The CalendarObserver class.
Represents a person, by name ane email address.
This file is part of the API for handling calendar data and defines the Todo class.
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
This class provides a template for lists of pointers.
Provides a Journal in the sense of RFC2445.
This file is part of the API for handling calendar data and defines the Journal class.
The ICalTimeZones class represents a time zone database which consists of a collection of individual ...
This file is part of the API for handling calendar data and defines the Event class.