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 | |
34 | using namespace KCal; |
35 | |
36 | /** |
37 | Private class that helps to provide binary compatibility between releases. |
38 | @internal |
39 | */ |
40 | //@cond PRIVATE |
41 | class KCal::CalendarNull::Private |
42 | { |
43 | }; |
44 | static CalendarNull *mSelf = 0; |
45 | //@endcond |
46 | |
47 | CalendarNull::CalendarNull( const KDateTime::Spec &timeSpec ) |
48 | : Calendar( timeSpec ), |
49 | d( new KCal::CalendarNull::Private ) |
50 | {} |
51 | |
52 | CalendarNull::CalendarNull( const QString &timeZoneId ) |
53 | : Calendar( timeZoneId ), |
54 | d( new KCal::CalendarNull::Private ) |
55 | {} |
56 | |
57 | CalendarNull::~CalendarNull() |
58 | { |
59 | delete d; |
60 | } |
61 | |
62 | CalendarNull *CalendarNull::self() |
63 | { |
64 | if ( !mSelf ) { |
65 | mSelf = new CalendarNull( KDateTime::UTC ); |
66 | } |
67 | |
68 | return mSelf; |
69 | } |
70 | |
71 | void CalendarNull::close() |
72 | { |
73 | } |
74 | |
75 | bool CalendarNull::save() |
76 | { |
77 | return true; |
78 | } |
79 | |
80 | bool CalendarNull::reload() |
81 | { |
82 | return true; |
83 | } |
84 | |
85 | bool CalendarNull::addEvent( Event *event ) |
86 | { |
87 | Q_UNUSED ( event ); |
88 | return false; |
89 | } |
90 | |
91 | bool CalendarNull::deleteEvent( Event *event ) |
92 | { |
93 | Q_UNUSED( event ); |
94 | return false; |
95 | } |
96 | |
97 | void CalendarNull::deleteAllEvents() |
98 | { |
99 | } |
100 | |
101 | Event::List CalendarNull::rawEvents( EventSortField sortField, |
102 | SortDirection sortDirection ) |
103 | { |
104 | Q_UNUSED( sortField ); |
105 | Q_UNUSED( sortDirection ); |
106 | return Event::List(); |
107 | } |
108 | |
109 | Event::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 | |
120 | Event::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 | |
132 | Event::List CalendarNull::rawEventsForDate( const KDateTime &dt ) |
133 | { |
134 | Q_UNUSED( dt ); |
135 | return Event::List(); |
136 | } |
137 | |
138 | Event *CalendarNull::event( const QString &uid ) |
139 | { |
140 | Q_UNUSED( uid ); |
141 | return 0; |
142 | } |
143 | |
144 | bool CalendarNull::addTodo( Todo *todo ) |
145 | { |
146 | Q_UNUSED( todo ); |
147 | return false; |
148 | } |
149 | |
150 | bool CalendarNull::deleteTodo( Todo *todo ) |
151 | { |
152 | Q_UNUSED( todo ); |
153 | return false; |
154 | } |
155 | |
156 | void CalendarNull::deleteAllTodos() |
157 | { |
158 | } |
159 | |
160 | Todo::List CalendarNull::rawTodos( TodoSortField sortField, |
161 | SortDirection sortDirection ) |
162 | { |
163 | Q_UNUSED( sortField ); |
164 | Q_UNUSED( sortDirection ); |
165 | return Todo::List(); |
166 | } |
167 | |
168 | Todo::List CalendarNull::rawTodosForDate( const QDate &date ) |
169 | { |
170 | Q_UNUSED( date ); |
171 | return Todo::List(); |
172 | } |
173 | |
174 | Todo *CalendarNull::todo( const QString &uid ) |
175 | { |
176 | Q_UNUSED( uid ); |
177 | return 0; |
178 | } |
179 | |
180 | bool CalendarNull::addJournal( Journal *journal ) |
181 | { |
182 | Q_UNUSED( journal ); |
183 | return false; |
184 | } |
185 | |
186 | bool CalendarNull::deleteJournal( Journal *journal ) |
187 | { |
188 | Q_UNUSED( journal ); |
189 | return false; |
190 | } |
191 | |
192 | void CalendarNull::deleteAllJournals() |
193 | { |
194 | } |
195 | |
196 | Journal::List CalendarNull::rawJournals( JournalSortField sortField, |
197 | SortDirection sortDirection ) |
198 | { |
199 | Q_UNUSED( sortField ); |
200 | Q_UNUSED( sortDirection ); |
201 | return Journal::List(); |
202 | } |
203 | |
204 | Journal::List CalendarNull::rawJournalsForDate( const QDate &date ) |
205 | { |
206 | Q_UNUSED( date ); |
207 | return Journal::List(); |
208 | } |
209 | |
210 | Journal *CalendarNull::journal( const QString &uid ) |
211 | { |
212 | Q_UNUSED( uid ); |
213 | return 0; |
214 | } |
215 | |
216 | Alarm::List CalendarNull::alarms( const KDateTime &from, const KDateTime &to ) |
217 | { |
218 | Q_UNUSED( from ); |
219 | Q_UNUSED( to ); |
220 | return Alarm::List(); |
221 | } |
222 | |
223 | void CalendarNull::incidenceUpdated( IncidenceBase *incidenceBase ) |
224 | { |
225 | Q_UNUSED( incidenceBase ); |
226 | } |
227 | |