libkcal Library API Documentation

resourcecalendar.h

00001 /* 00002 This file is part of libkcal. 00003 00004 Copyright (c) 1998 Preston Brown 00005 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org> 00006 Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public 00010 License as published by the Free Software Foundation; either 00011 version 2 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public License 00019 along with this library; see the file COPYING.LIB. If not, write to 00020 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. 00022 */ 00023 00024 #ifndef KCAL_RESOURCECALENDAR_H 00025 #define KCAL_RESOURCECALENDAR_H 00026 00027 #include <qstring.h> 00028 #include <qdatetime.h> 00029 #include <qptrlist.h> 00030 00031 #include <kconfig.h> 00032 00033 #include "alarm.h" 00034 #include "todo.h" 00035 #include "event.h" 00036 #include "journal.h" 00037 00038 #include <kresources/resource.h> 00039 #include <kresources/manager.h> 00040 #include <kabc/lock.h> 00041 00042 namespace KCal { 00043 00044 class CalFormat; 00045 00053 class ResourceCalendar : public KRES::Resource 00054 { 00055 Q_OBJECT 00056 public: 00057 ResourceCalendar( const KConfig * ); 00058 virtual ~ResourceCalendar(); 00059 00060 virtual void writeConfig( KConfig* config ); 00061 00066 virtual QString infoText() const; 00067 00087 bool load(); 00088 00103 bool save(); 00104 00109 virtual bool isSaving() { return false; } 00110 00114 virtual KABC::Lock *lock() = 0; 00115 00119 virtual bool addIncidence( Incidence * ); 00120 00124 virtual bool addEvent( Event *event ) = 0; 00125 00129 virtual void deleteEvent( Event * ) = 0; 00130 00134 virtual Event *event( const QString &uid ) = 0; 00135 00140 virtual Event::List rawEvents() = 0; 00141 00146 virtual Event::List rawEventsForDate( const QDate &date, 00147 bool sorted = false ) = 0; 00148 00152 virtual Event::List rawEventsForDate( const QDateTime &qdt ) = 0; 00153 00158 virtual Event::List rawEvents( const QDate &start, const QDate &end, 00159 bool inclusive = false ) = 0; 00160 00161 signals: 00168 void resourceChanged( ResourceCalendar * ); 00169 00174 void resourceLoaded( ResourceCalendar * ); 00179 void resourceSaved( ResourceCalendar * ); 00180 00184 void resourceLoadError( ResourceCalendar *, const QString &error ); 00188 void resourceSaveError( ResourceCalendar *, const QString &error ); 00189 00193 void signalSubresourceAdded( ResourceCalendar *, const QString &, 00194 const QString & ); 00195 00199 void signalSubresourceRemoved( ResourceCalendar *, const QString &, 00200 const QString & ); 00201 00202 public: 00206 virtual bool addTodo( Todo *todo ) = 0; 00210 virtual void deleteTodo( Todo * ) = 0; 00216 virtual Todo *todo( const QString &uid ) = 0; 00220 virtual Todo::List rawTodos() = 0; 00224 virtual Todo::List rawTodosForDate( const QDate &date ) = 0; 00225 00226 00230 virtual bool addJournal( Journal * ) = 0; 00231 00235 virtual void deleteJournal( Journal * ) = 0; 00236 00240 virtual Journal *journal( const QDate & ) = 0; 00241 00245 virtual Journal *journal( const QString &uid ) = 0; 00246 00250 virtual Journal::List journals() = 0; 00251 00252 00256 virtual Alarm::List alarms( const QDateTime &from, 00257 const QDateTime &to ) = 0; 00258 00262 virtual Alarm::List alarmsTo( const QDateTime &to ) = 0; 00263 00264 00266 Incidence::List rawIncidences(); 00267 00271 virtual void setTimeZoneId( const QString &tzid ) = 0; 00272 00278 virtual QStringList subresources() const { return QStringList(); } 00279 00283 virtual bool subresourceActive( const QString& ) const { return true; } 00284 00285 public slots: 00289 virtual void setSubresourceActive( const QString &, bool active ); 00290 00291 protected: 00295 virtual bool doLoad() = 0; 00299 virtual bool doSave() = 0; 00300 00304 virtual void addInfoText( QString & ) const {}; 00305 00309 void loadError( const QString &errorMessage = QString::null ); 00313 void saveError( const QString &errorMessage = QString::null ); 00314 00315 private: 00316 bool mReceivedLoadError; 00317 bool mReceivedSaveError; 00318 00319 class Private; 00320 Private *d; 00321 }; 00322 00323 typedef KRES::Manager<ResourceCalendar> CalendarResourceManager; 00324 00325 } 00326 00327 #endif
KDE Logo
This file is part of the documentation for libkcal Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:49:12 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003