libkcal
calendarnull.h
Go to the documentation of this file.00001 /* 00002 This file is part of libkcal. 00003 00004 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 /* 00022 @file calendarnull.h 00023 A null calendar class with does nothing. 00024 00025 @author Cornelius Schumacher 00026 */ 00027 #ifndef KCAL_CALENDARNULL_H 00028 #define KCAL_CALENDARNULL_H 00029 00030 #include "calendar.h" 00031 #include "libkcal_export.h" 00032 00033 class KConfig; 00034 00039 namespace KCal { 00040 00050 class LIBKCAL_EXPORT CalendarNull : public Calendar 00051 { 00052 public: 00056 CalendarNull( const QString &timeZoneId ); 00057 00061 ~CalendarNull() {} 00062 00067 static CalendarNull *self(); 00068 00072 void close() {} 00073 00077 void save() {} 00078 00079 bool reload( const QString & ) { return true;} 00080 00081 // Event Specific Methods // 00082 00090 bool addEvent( Event * /*event*/ ) 00091 { return false; } 00092 00100 bool deleteEvent( Event * /*event*/ ) 00101 { return false; } 00102 00111 Event::List rawEvents( EventSortField /*sortField*/, 00112 SortDirection /*sortDirection*/ ) 00113 { return Event::List(); } 00114 00125 Event::List rawEvents( const QDate & /*start*/, const QDate & /*end*/, 00126 bool /*inclusive*/ ) 00127 { return Event::List(); } 00128 00137 Event::List rawEventsForDate( const QDateTime & /*qdt*/ ) 00138 { return Event::List(); } 00139 00151 Event::List rawEventsForDate( 00152 const QDate & /*date*/, 00153 EventSortField /*sortField=EventSortUnsorted*/, 00154 SortDirection /*sortDirection=SortDirectionAscending*/ ) 00155 { return Event::List(); } 00156 00164 Event *event( const QString & /*uid*/ ) 00165 { return 0; } 00166 00167 // Todo Specific Methods // 00168 00176 bool addTodo( Todo * /*todo*/ ) 00177 { return false; } 00178 00186 bool deleteTodo( Todo * /*todo*/ ) 00187 { return false; } 00188 00197 Todo::List rawTodos( TodoSortField /*sortField*/, 00198 SortDirection /*sortDirection*/ ) 00199 { return Todo::List(); } 00200 00209 Todo::List rawTodosForDate( const QDate & /*date*/ ) 00210 { return Todo::List(); } 00211 00219 Todo *todo( const QString & /*uid*/ ) 00220 { return 0; } 00221 00222 // Journal Specific Methods // 00223 00231 bool addJournal( Journal * /*journal*/ ) 00232 { return false; } 00233 00241 bool deleteJournal( Journal * /*journal*/ ) 00242 { return false; } 00243 00252 Journal::List rawJournals( JournalSortField /*sortField*/, 00253 SortDirection /*sortDirection*/ ) 00254 { return Journal::List(); } 00255 00263 Journal::List rawJournalsForDate( const QDate & /*date*/ ) 00264 { return Journal::List(); } 00265 00273 Journal *journal( const QString & /*uid*/ ) 00274 { return 0; } 00275 00276 // Alarm Specific Methods // 00277 00287 Alarm::List alarms( const QDateTime & /*from*/, const QDateTime & /*to*/ ) 00288 { return Alarm::List(); } 00289 00290 // Observer Specific Methods // 00291 00296 void incidenceUpdated( IncidenceBase * /*incidenceBase*/ ) {} 00297 00298 void setTimeZoneIdViewOnly( const QString& ) {}; 00299 00300 private: 00301 static CalendarNull *mSelf; 00302 00303 class Private; 00304 Private *d; 00305 }; 00306 00307 } 00308 00309 #endif