calendarnull.h
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 TDEConfig; 00034 00039 namespace KCal { 00040 00050 class LIBKCAL_EXPORT CalendarNull : public Calendar 00051 { 00052 public: 00056 CalendarNull( const TQString &timeZoneId ); 00057 00061 ~CalendarNull() {} 00062 00067 static CalendarNull *self(); 00068 00072 void close() {} 00073 00077 void closeEvents() {} 00078 00082 void closeTodos() {} 00083 00087 void closeJournals() {} 00088 00092 void save() {} 00093 00094 bool reload( const TQString & ) { return true;} 00095 00096 // Event Specific Methods // 00097 00105 bool addEvent( Event * /*event*/ ) 00106 { return false; } 00107 00115 bool deleteEvent( Event * /*event*/ ) 00116 { return false; } 00117 00126 Event::List rawEvents( EventSortField /*sortField*/, 00127 SortDirection /*sortDirection*/ ) 00128 { return Event::List(); } 00129 00140 Event::List rawEvents( const TQDate & /*start*/, const TQDate & /*end*/, 00141 bool /*inclusive*/ ) 00142 { return Event::List(); } 00143 00152 Event::List rawEventsForDate( const TQDateTime & /*qdt*/ ) 00153 { return Event::List(); } 00154 00166 Event::List rawEventsForDate( 00167 const TQDate & /*date*/, 00168 EventSortField /*sortField=EventSortUnsorted*/, 00169 SortDirection /*sortDirection=SortDirectionAscending*/ ) 00170 { return Event::List(); } 00171 00179 Event *event( const TQString & /*uid*/ ) 00180 { return 0; } 00181 00182 // Todo Specific Methods // 00183 00191 bool addTodo( Todo * /*todo*/ ) 00192 { return false; } 00193 00201 bool deleteTodo( Todo * /*todo*/ ) 00202 { return false; } 00203 00212 Todo::List rawTodos( TodoSortField /*sortField*/, 00213 SortDirection /*sortDirection*/ ) 00214 { return Todo::List(); } 00215 00224 Todo::List rawTodosForDate( const TQDate & /*date*/ ) 00225 { return Todo::List(); } 00226 00234 Todo *todo( const TQString & /*uid*/ ) 00235 { return 0; } 00236 00237 // Journal Specific Methods // 00238 00246 bool addJournal( Journal * /*journal*/ ) 00247 { return false; } 00248 00256 bool deleteJournal( Journal * /*journal*/ ) 00257 { return false; } 00258 00267 Journal::List rawJournals( JournalSortField /*sortField*/, 00268 SortDirection /*sortDirection*/ ) 00269 { return Journal::List(); } 00270 00278 Journal::List rawJournalsForDate( const TQDate & /*date*/ ) 00279 { return Journal::List(); } 00280 00288 Journal *journal( const TQString & /*uid*/ ) 00289 { return 0; } 00290 00291 // Alarm Specific Methods // 00292 00302 Alarm::List alarms( const TQDateTime & /*from*/, const TQDateTime & /*to*/ ) 00303 { return Alarm::List(); } 00304 00305 // Observer Specific Methods // 00306 00311 void incidenceUpdated( IncidenceBase * /*incidenceBase*/ ) {} 00312 00313 void setTimeZoneIdViewOnly( const TQString& ) {}; 00314 00315 private: 00316 static CalendarNull *mSelf; 00317 00318 class Private; 00319 Private *d; 00320 }; 00321 00322 } 00323 00324 #endif