home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcal / resourcelocaldir.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-08-19  |  2.3 KB  |  104 lines

  1. /*
  2.     This file is part of libkcal.
  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. #ifndef KCAL_RESOURCELOCALDIRDIR_H
  22. #define KCAL_RESOURCELOCALDIRDIR_H
  23.  
  24. #include <kurl.h>
  25. #include <kdirwatch.h>
  26. #include <kdepimmacros.h>
  27.  
  28. #include "resourcecached.h"
  29.  
  30. #include "libkcal_export.h"
  31.  
  32. class QString;
  33. class KConfig;
  34.  
  35. namespace KCal {
  36.  
  37. class CalendarLocal;
  38. class Incidence;
  39.  
  40. /**
  41.   \internal
  42.  
  43.   This class provides a calendar stored as a file per incidence in a directory.
  44. */
  45. class LIBKCAL_EXPORT ResourceLocalDir : public ResourceCached
  46. {
  47.     Q_OBJECT
  48.  
  49.     friend class ResourceLocalDirConfig;
  50.  
  51.   public:
  52.     ResourceLocalDir( const KConfig * );
  53.     ResourceLocalDir( const QString& fileName );
  54.     virtual ~ResourceLocalDir();
  55.  
  56.     void readConfig( const KConfig *config );
  57.     void writeConfig( KConfig* config );
  58.  
  59.     KABC::Lock *lock();
  60.  
  61.     /** deletes an event from this calendar. */
  62.     bool deleteEvent(Event *);
  63.  
  64.     /**
  65.       Remove a todo from the todolist.
  66.     */
  67.     bool deleteTodo( Todo * );
  68.  
  69.     /**
  70.       Remove a journal from the journallist.
  71.     */
  72.     bool deleteJournal( Journal * );
  73.  
  74.     void dump() const;
  75.  
  76.   protected slots:
  77.     void reload( const QString & );
  78.  
  79.   protected:
  80.     virtual bool doOpen();
  81.     virtual bool doLoad();
  82.     virtual bool doSave();
  83.     bool doSave( Incidence * );
  84.     virtual bool doFileLoad( CalendarLocal &, const QString &fileName );
  85.  
  86.   private:
  87.     void init();
  88.     bool deleteIncidenceFile(Incidence *incidence);
  89.  
  90.     KURL mURL;
  91. //     ICalFormat mFormat;
  92.  
  93.     KDirWatch mDirWatch;
  94.  
  95.     KABC::Lock *mLock;
  96.  
  97.     class Private;
  98.     Private *d;
  99. };
  100.  
  101. }
  102.  
  103. #endif
  104.