libkcal
calendarlocal.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KCAL_CALENDARLOCAL_H
00023 #define KCAL_CALENDARLOCAL_H
00024
00025 #include "calendar.h"
00026 #include <qdict.h>
00027 #include <kdepimmacros.h>
00028
00029 namespace KCal {
00030
00031 class CalFormat;
00032
00036 class LIBKCAL_EXPORT CalendarLocal : public Calendar
00037 {
00038 public:
00042 CalendarLocal( const QString &timeZoneId );
00043 ~CalendarLocal();
00044
00058 bool load( const QString &fileName, CalFormat *format = 0 );
00059
00065 bool reload( const QString &tz );
00066
00074 bool save( const QString &fileName, CalFormat *format = 0 );
00075
00079 void close();
00080
00081 void save() {}
00082
00086 bool addEvent( Event *event );
00090 bool deleteEvent( Event *event );
00094 void deleteAllEvents();
00095
00099 Event *event( const QString &uid );
00103 Event::List rawEvents( EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
00104
00108 bool addTodo( Todo *todo );
00112 bool deleteTodo( Todo * );
00116 void deleteAllTodos();
00121 Todo *todo( const QString &uid );
00125 Todo::List rawTodos( TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
00129 Todo::List rawTodosForDate( const QDate &date );
00130
00134 bool addJournal( Journal * );
00138 bool deleteJournal( Journal * );
00142 void deleteAllJournals();
00146 Journal *journal( const QString &uid );
00150 Journal::List rawJournals( JournalSortField sortField = JournalSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
00154 Journal::List rawJournalsForDate( const QDate &date );
00155
00159 Alarm::List alarms( const QDateTime &from, const QDateTime &to );
00160
00164 Alarm::List alarmsTo( const QDateTime &to );
00165
00170 Event::List rawEventsForDate( const QDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
00174 Event::List rawEventsForDate( const QDateTime &qdt );
00184 Event::List rawEvents( const QDate &start, const QDate &end,
00185 bool inclusive = false );
00186
00192 void setTimeZoneIdViewOnly( const QString& tz );
00193
00194 protected:
00195
00197 void incidenceUpdated( IncidenceBase *i );
00198
00200 void insertEvent( Event *event );
00201
00203 void appendAlarms( Alarm::List &alarms, Incidence *incidence,
00204 const QDateTime &from, const QDateTime &to );
00205
00207 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence,
00208 const QDateTime &from, const QDateTime &to );
00209
00210 private:
00211 void init();
00212
00213 typedef QDict<Event> EventDict;
00214 typedef QDictIterator<Event> EventDictIterator;
00215 EventDict mEvents;
00216 Todo::List mTodoList;
00217 Journal::List mJournalList;
00218
00219 Incidence::List mDeletedIncidences;
00220 QString mFileName;
00221
00222 class Private;
00223 Private *d;
00224 };
00225
00226 }
00227
00228 #endif
|