libkcal

resourcelocaldir.h
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 <tdemacros.h>
27 
28 #include "resourcecached.h"
29 
30 #include "libkcal_export.h"
31 
32 class TQString;
33 class TDEConfig;
34 
35 namespace KCal {
36 
37 class CalendarLocal;
38 class Incidence;
39 
45 class LIBKCAL_EXPORT ResourceLocalDir : public ResourceCached
46 {
47  TQ_OBJECT
48 
49 
50  friend class ResourceLocalDirConfig;
51 
52  public:
53  ResourceLocalDir( const TDEConfig * );
54  ResourceLocalDir( const TQString& fileName );
55  virtual ~ResourceLocalDir();
56 
57  void readConfig( const TDEConfig *config );
58  void writeConfig( TDEConfig* config );
59 
60  TDEABC::Lock *lock();
61 
63  bool deleteEvent(Event *);
64 
68  bool deleteTodo( Todo * );
69 
73  bool deleteJournal( Journal * );
74 
75  void dump() const;
76 
77  protected slots:
78  void reload( const TQString & );
79 
80  protected:
81  virtual bool doOpen();
82  virtual bool doLoad();
83  virtual bool doSave();
84  bool doSave( Incidence * );
85  virtual bool doFileLoad( CalendarLocal &, const TQString &fileName );
86 
87  private:
88  void init();
89  bool deleteIncidenceFile(Incidence *incidence);
90 
91  KURL mURL;
92 // ICalFormat mFormat;
93 
94  KDirWatch mDirWatch;
95 
96  TDEABC::Lock *mLock;
97 
98  TQPtrList<Incidence>mDeletedIncidences;
99  class Private;
100  Private *d;
101 };
102 
103 }
104 
105 #endif
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38