libkcal

calendarnull.h
1/*
2 This file is part of libkcal.
3
4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21/*
22 @file calendarnull.h
23 A null calendar class with does nothing.
24
25 @author Cornelius Schumacher
26*/
27#ifndef KCAL_CALENDARNULL_H
28#define KCAL_CALENDARNULL_H
29
30#include "calendar.h"
31#include "libkcal_export.h"
32
33class TDEConfig;
34
39namespace KCal {
40
50class LIBKCAL_EXPORT CalendarNull : public Calendar
51{
52 public:
56 CalendarNull( const TQString &timeZoneId );
57
62
67 static CalendarNull *self();
68
72 void close() {}
73
77 void closeEvents() {}
78
82 void closeTodos() {}
83
87 void closeJournals() {}
88
92 void save() {}
93
94 bool reload( const TQString & ) { return true;}
95
96// Event Specific Methods //
97
105 bool addEvent( Event * /*event*/ )
106 { return false; }
107
115 bool deleteEvent( Event * /*event*/ )
116 { return false; }
117
127 SortDirection /*sortDirection*/ )
128 { return Event::List(); }
129
140 Event::List rawEvents( const TQDate & /*start*/, const TQDate & /*end*/,
141 bool /*inclusive*/ )
142 { return Event::List(); }
143
152 Event::List rawEventsForDate( const TQDateTime & /*qdt*/ )
153 { return Event::List(); }
154
167 const TQDate & /*date*/,
168 EventSortField /*sortField=EventSortUnsorted*/,
169 SortDirection /*sortDirection=SortDirectionAscending*/ )
170 { return Event::List(); }
171
179 Event *event( const TQString & /*uid*/ )
180 { return 0; }
181
182// Todo Specific Methods //
183
191 bool addTodo( Todo * /*todo*/ )
192 { return false; }
193
201 bool deleteTodo( Todo * /*todo*/ )
202 { return false; }
203
213 SortDirection /*sortDirection*/ )
214 { return Todo::List(); }
215
224 Todo::List rawTodosForDate( const TQDate & /*date*/ )
225 { return Todo::List(); }
226
234 Todo *todo( const TQString & /*uid*/ )
235 { return 0; }
236
237// Journal Specific Methods //
238
246 bool addJournal( Journal * /*journal*/ )
247 { return false; }
248
256 bool deleteJournal( Journal * /*journal*/ )
257 { return false; }
258
268 SortDirection /*sortDirection*/ )
269 { return Journal::List(); }
270
278 Journal::List rawJournalsForDate( const TQDate & /*date*/ )
279 { return Journal::List(); }
280
288 Journal *journal( const TQString & /*uid*/ )
289 { return 0; }
290
291// Alarm Specific Methods //
292
302 Alarm::List alarms( const TQDateTime & /*from*/, const TQDateTime & /*to*/ )
303 { return Alarm::List(); }
304
305// Observer Specific Methods //
306
311 void incidenceUpdated( IncidenceBase * /*incidenceBase*/ ) {}
312
313 void setTimeZoneIdViewOnly( const TQString& ) {};
314
315 private:
316 static CalendarNull *mSelf;
317
318 class Private;
319 Private *d;
320};
321
322}
323
324#endif
Provides the main "calendar" object class.
This is a null calendar class which does nothing.
bool deleteTodo(Todo *)
Remove a Todo from the Calendar.
Journal * journal(const TQString &)
Returns the Journal associated with the given unique identifier.
Todo::List rawTodosForDate(const TQDate &)
Return an unfiltered list of all Todos for this Calendar which are due on the specifed date.
bool reload(const TQString &)
Load the calendar contents from storage.
Journal::List rawJournals(JournalSortField, SortDirection)
Return a sorted, filtered list of all Journals for this Calendar.
Journal::List rawJournalsForDate(const TQDate &)
Return an unfiltered list of all Journals for on the specifed date.
Event::List rawEventsForDate(const TQDate &, EventSortField, SortDirection)
Return a sorted, unfiltered list of all Events which occur on the given date.
void setTimeZoneIdViewOnly(const TQString &)
Set the timezone used for viewing the incidences in this calendar.
Event * event(const TQString &)
Returns the Event associated with the given unique identifier.
~CalendarNull()
Destructor.
Todo * todo(const TQString &)
Returns the Todo associated with the given unique identifier.
void save()
Sync changes in memory to persistant storage.
void closeEvents()
Clears out the current Calendar, freeing all used memory etc.
bool addTodo(Todo *)
Insert a Todo into the Calendar.
bool addEvent(Event *)
Insert an Evenet into the Calendar.
Event::List rawEventsForDate(const TQDateTime &)
Return an unfiltered list of all Events which occur on the given timestamp.
bool addJournal(Journal *)
Insert a Journal into the Calendar.
bool deleteEvent(Event *)
Remove an Event from the Calendar.
void incidenceUpdated(IncidenceBase *)
The Observer interface.
void closeJournals()
Clears out the current Calendar, freeing all used memory etc.
Event::List rawEvents(EventSortField, SortDirection)
Return a sorted, unfiltered list of all Events for this Calendar.
bool deleteJournal(Journal *)
Remove a Journal from the Calendar.
void close()
Clears out the current Calendar, freeing all used memory etc.
Todo::List rawTodos(TodoSortField, SortDirection)
Return a sorted, unfiltered list of all Todos for this Calendar.
Event::List rawEvents(const TQDate &, const TQDate &, bool)
Return an unfiltered list of all Events occurring within a date range.
Alarm::List alarms(const TQDateTime &, const TQDateTime &)
Return a list of Alarms within a time range for this Calendar.
void closeTodos()
Clears out the current Calendar, freeing all used memory etc.
This is the main "calendar" object class.
Definition calendar.h:171
This class provides an Event in the sense of RFC2445.
Definition event.h:33
This class provides the base class common to all calendar components.
This class provides a Journal in the sense of RFC2445.
Definition journal.h:34
This class provides a Todo in the sense of RFC2445.
Definition todo.h:32
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition alarm.h:38
TodoSortField
How Todos are to be sorted.
Definition calendar.h:91
JournalSortField
How Journals are to be sorted.
Definition calendar.h:111
EventSortField
How Events are to be sorted.
Definition calendar.h:75
SortDirection
Sort direction.
Definition calendar.h:63