libkcal

resourcelocal.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KCAL_RESOURCELOCAL_H
23 #define KCAL_RESOURCELOCAL_H
24 
25 #include <tqstring.h>
26 #include <tqdatetime.h>
27 
28 #include <kurl.h>
29 #include <kdirwatch.h>
30 #include <tdemacros.h>
31 class TDEConfig;
32 
33 #include "calendarlocal.h"
34 #include "libkcal_export.h"
35 
36 #include "resourcecached.h"
37 
38 namespace KCal {
39 
40 class CalFormat;
41 
45 class LIBKCAL_EXPORT ResourceLocal : public ResourceCached
46 {
47  TQ_OBJECT
48 
49 
50  friend class ResourceLocalConfig;
51 
52  public:
56  ResourceLocal( const TDEConfig * );
60  ResourceLocal( const TQString& fileName );
61  virtual ~ResourceLocal();
62 
63  virtual void writeConfig( TDEConfig* config );
64 
65  TDEABC::Lock *lock();
66 
67  TQString fileName() const;
68  bool setFileName( const TQString &fileName );
69  bool setValue( const TQString &key, const TQString &value );
70 
71 
72  void dump() const;
73 
74  protected slots:
75  void reload();
76 
77  protected:
78  virtual bool doLoad();
79  virtual bool doSave();
85  virtual bool doReload();
86 
87  TQDateTime readLastModified();
88 
89  private:
90  void init();
91 
92  KURL mURL;
93  CalFormat *mFormat;
94 
95  KDirWatch mDirWatch;
96 
97  TDEABC::Lock *mLock;
98 
99  class Private;
100  Private *d;
101 };
102 
103 }
104 
105 #endif
This is the base class for calendar formats.
Definition: calformat.h:44
This class provides a calendar resource using a local CalendarLocal object to cache the calendar data...
Configuration widget for local file resource.
This class provides a calendar resource stored as a local file.
Definition: resourcelocal.h:46
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38