libkcal Library API Documentation

resourcecached.cpp

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., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #include <qdatetime.h>
00023 #include <qstring.h>
00024 #include <qptrlist.h>
00025 
00026 #include <kdebug.h>
00027 #include <klocale.h>
00028 #include <kurl.h>
00029 
00030 #include "exceptions.h"
00031 #include "incidence.h"
00032 #include "event.h"
00033 #include "todo.h"
00034 #include "journal.h"
00035 
00036 #include "resourcecached.h"
00037 
00038 using namespace KCal;
00039 
00040 ResourceCached::ResourceCached( const KConfig* config )
00041   : ResourceCalendar( config )
00042 {
00043 }
00044 
00045 ResourceCached::~ResourceCached()
00046 {
00047 }
00048 
00049 bool ResourceCached::addEvent(Event *event)
00050 {
00051   return mCalendar.addEvent( event );
00052 }
00053 
00054 // probably not really efficient, but...it works for now.
00055 void ResourceCached::deleteEvent( Event *event )
00056 {
00057   kdDebug(5800) << "ResourceCached::deleteEvent" << endl;
00058 
00059   mCalendar.deleteEvent( event );
00060 }
00061 
00062 
00063 Event *ResourceCached::event( const QString &uid )
00064 {
00065   return mCalendar.event( uid );
00066 }
00067 
00068 Event::List ResourceCached::rawEventsForDate( const QDate &qd, bool sorted )
00069 {
00070   Event::List list = mCalendar.rawEventsForDate( qd, sorted );
00071 
00072   return list;
00073 }
00074 
00075 
00076 Event::List ResourceCached::rawEvents( const QDate &start, const QDate &end,
00077                                        bool inclusive )
00078 {
00079   return mCalendar.rawEvents( start, end, inclusive );
00080 }
00081 
00082 Event::List ResourceCached::rawEventsForDate( const QDateTime &qdt )
00083 {
00084   return mCalendar.rawEventsForDate( qdt.date() );
00085 }
00086 
00087 Event::List ResourceCached::rawEvents()
00088 {
00089   return mCalendar.rawEvents();
00090 }
00091 
00092 bool ResourceCached::addTodo( Todo *todo )
00093 {
00094   return mCalendar.addTodo( todo );
00095 }
00096 
00097 void ResourceCached::deleteTodo( Todo *todo )
00098 {
00099   mCalendar.deleteTodo( todo );
00100 }
00101 
00102 void ResourceCached::deleteJournal( Journal *journal )
00103 {
00104   mCalendar.deleteJournal( journal );
00105 }
00106 
00107 
00108 Todo::List ResourceCached::rawTodos()
00109 {
00110   return mCalendar.rawTodos();
00111 }
00112 
00113 Todo *ResourceCached::todo( const QString &uid )
00114 {
00115   return mCalendar.todo( uid );
00116 }
00117 
00118 Todo::List ResourceCached::todos( const QDate &date )
00119 {
00120   return mCalendar.todos( date );
00121 }
00122 
00123 
00124 bool ResourceCached::addJournal( Journal *journal )
00125 {
00126   kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl;
00127 
00128   return mCalendar.addJournal( journal );
00129 }
00130 
00131 Journal *ResourceCached::journal( const QDate &date )
00132 {
00133 //  kdDebug(5800) << "ResourceCached::journal() " << date.toString() << endl;
00134 
00135   return mCalendar.journal( date );
00136 }
00137 
00138 Journal *ResourceCached::journal( const QString &uid )
00139 {
00140   return mCalendar.journal( uid );
00141 }
00142 
00143 Journal::List ResourceCached::journals()
00144 {
00145   return mCalendar.journals();
00146 }
00147 
00148 
00149 Alarm::List ResourceCached::alarmsTo( const QDateTime &to )
00150 {
00151   return mCalendar.alarmsTo( to );
00152 }
00153 
00154 Alarm::List ResourceCached::alarms( const QDateTime &from, const QDateTime &to )
00155 {
00156 //  kdDebug(5800) << "ResourceCached::alarms(" << from.toString() << " - " << to.toString() << ")\n";
00157 
00158   return mCalendar.alarms( from, to );
00159 }
00160 
00161 
00162 void ResourceCached::setTimeZoneId( const QString& tzid )
00163 {
00164   mCalendar.setTimeZoneId( tzid );
00165 }
KDE Logo
This file is part of the documentation for libkcal Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:22 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003