1/*
2 This file is part of the kcal library.
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
23 This file is part of the API for handling calendar data and
24 defines the CalendarNull class.
25
26 @brief
27 Represents a null calendar class; that is, a calendar which contains
28 no information and provides no capabilities.
29
30 @author Cornelius Schumacher \<schumacher@kde.org\>
31*/
32#include "calendarnull.h"
33
34using namespace KCal;
35
36/**
37 Private class that helps to provide binary compatibility between releases.
38 @internal
39*/
40//@cond PRIVATE
41class KCal::CalendarNull::Private
42{
43};
44static CalendarNull *mSelf = 0;
45//@endcond
46
47CalendarNull::CalendarNull( const KDateTime::Spec &timeSpec )
48 : Calendar( timeSpec ),
49 d( new KCal::CalendarNull::Private )
50{}
51
52CalendarNull::CalendarNull( const QString &timeZoneId )
53 : Calendar( timeZoneId ),
54 d( new KCal::CalendarNull::Private )
55{}
56
57CalendarNull::~CalendarNull()
58{
59 delete d;
60}
61
62CalendarNull *CalendarNull::self()
63{
64 if ( !mSelf ) {
65 mSelf = new CalendarNull( KDateTime::UTC );
66 }
67
68 return mSelf;
69}
70
71void CalendarNull::close()
72{
73}
74
75bool CalendarNull::save()
76{
77 return true;
78}
79
80bool CalendarNull::reload()
81{
82 return true;
83}
84
85bool CalendarNull::addEvent( Event *event )
86{
87 Q_UNUSED ( event );
88 return false;
89}
90
91bool CalendarNull::deleteEvent( Event *event )
92{
93 Q_UNUSED( event );
94 return false;
95}
96
97void CalendarNull::deleteAllEvents()
98{
99}
100
101Event::List CalendarNull::rawEvents( EventSortField sortField,
102 SortDirection sortDirection )
103{
104 Q_UNUSED( sortField );
105 Q_UNUSED( sortDirection );
106 return Event::List();
107}
108
109Event::List CalendarNull::rawEvents( const QDate &start, const QDate &end,
110 const KDateTime::Spec &timeSpec,
111 bool inclusive )
112{
113 Q_UNUSED( start );
114 Q_UNUSED( end );
115 Q_UNUSED( timeSpec );
116 Q_UNUSED( inclusive );
117 return Event::List();
118}
119
120Event::List CalendarNull::rawEventsForDate( const QDate &date,
121 const KDateTime::Spec &timeSpec,
122 EventSortField sortField,
123 SortDirection sortDirection )
124{
125 Q_UNUSED( date );
126 Q_UNUSED( timeSpec );
127 Q_UNUSED( sortField );
128 Q_UNUSED( sortDirection );
129 return Event::List();
130}
131
132Event::List CalendarNull::rawEventsForDate( const KDateTime &dt )
133{
134 Q_UNUSED( dt );
135 return Event::List();
136}
137
138Event *CalendarNull::event( const QString &uid )
139{
140 Q_UNUSED( uid );
141 return 0;
142}
143
144bool CalendarNull::addTodo( Todo *todo )
145{
146 Q_UNUSED( todo );
147 return false;
148}
149
150bool CalendarNull::deleteTodo( Todo *todo )
151{
152 Q_UNUSED( todo );
153 return false;
154}
155
156void CalendarNull::deleteAllTodos()
157{
158}
159
160Todo::List CalendarNull::rawTodos( TodoSortField sortField,
161 SortDirection sortDirection )
162{
163 Q_UNUSED( sortField );
164 Q_UNUSED( sortDirection );
165 return Todo::List();
166}
167
168Todo::List CalendarNull::rawTodosForDate( const QDate &date )
169{
170 Q_UNUSED( date );
171 return Todo::List();
172}
173
174Todo *CalendarNull::todo( const QString &uid )
175{
176 Q_UNUSED( uid );
177 return 0;
178}
179
180bool CalendarNull::addJournal( Journal *journal )
181{
182 Q_UNUSED( journal );
183 return false;
184}
185
186bool CalendarNull::deleteJournal( Journal *journal )
187{
188 Q_UNUSED( journal );
189 return false;
190}
191
192void CalendarNull::deleteAllJournals()
193{
194}
195
196Journal::List CalendarNull::rawJournals( JournalSortField sortField,
197 SortDirection sortDirection )
198{
199 Q_UNUSED( sortField );
200 Q_UNUSED( sortDirection );
201 return Journal::List();
202}
203
204Journal::List CalendarNull::rawJournalsForDate( const QDate &date )
205{
206 Q_UNUSED( date );
207 return Journal::List();
208}
209
210Journal *CalendarNull::journal( const QString &uid )
211{
212 Q_UNUSED( uid );
213 return 0;
214}
215
216Alarm::List CalendarNull::alarms( const KDateTime &from, const KDateTime &to )
217{
218 Q_UNUSED( from );
219 Q_UNUSED( to );
220 return Alarm::List();
221}
222
223void CalendarNull::incidenceUpdated( IncidenceBase *incidenceBase )
224{
225 Q_UNUSED( incidenceBase );
226}
227