summaryrefslogtreecommitdiffstats
path: root/kbugbuster/tderesources/kcalresource.h
diff options
context:
space:
mode:
Diffstat (limited to 'kbugbuster/tderesources/kcalresource.h')
-rw-r--r--kbugbuster/tderesources/kcalresource.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/kbugbuster/tderesources/kcalresource.h b/kbugbuster/tderesources/kcalresource.h
new file mode 100644
index 00000000..cfa4e2a6
--- /dev/null
+++ b/kbugbuster/tderesources/kcalresource.h
@@ -0,0 +1,124 @@
+/*
+ This file is part of KBugBuster.
+
+ Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KCALRESOURCE_H
+#define KCALRESOURCE_H
+
+#include <tqptrlist.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+
+#include <kurl.h>
+#include <kconfig.h>
+#include <kdirwatch.h>
+
+#include <incidence.h>
+#include <calendarlocal.h>
+#include <icalformat.h>
+#include <resourcecached.h>
+
+#include <bugsystem.h>
+
+namespace TDEIO {
+class FileCopyJob;
+class Job;
+}
+
+namespace KBB {
+class ResourcePrefs;
+}
+
+/**
+ This class provides a calendar stored as a remote file.
+*/
+class KCalResource : public KCal::ResourceCached
+{
+ Q_OBJECT
+
+
+ friend class KCalResourceConfig;
+
+ public:
+ /**
+ Reload policy.
+
+ @see setReloadPolicy(), reloadPolicy()
+ */
+ enum { ReloadNever, ReloadOnStartup, ReloadOnceADay, ReloadAlways };
+
+ /**
+ Create resource from configuration information stored in TDEConfig object.
+ */
+ KCalResource( const TDEConfig * );
+ ~KCalResource();
+
+ void readConfig( const TDEConfig *config );
+ void writeConfig( TDEConfig *config );
+
+ KBB::ResourcePrefs *prefs();
+
+ /**
+ Return name of file used as cache for remote file.
+ */
+ TQString cacheFile();
+
+ KABC::Lock *lock();
+
+ bool isSaving();
+
+ void dump() const;
+
+ protected slots:
+ void slotBugListAvailable( const Package &, const TQString &,
+ const Bug::List &bugs );
+
+ void slotLoadJobResult( TDEIO::Job * );
+ void slotSaveJobResult( TDEIO::Job * );
+
+ protected:
+ bool doOpen();
+ void doClose();
+ bool doLoad();
+ bool doSave();
+
+ private:
+ void init();
+
+ KBB::ResourcePrefs *mPrefs;
+
+ KURL mDownloadUrl;
+ KURL mUploadUrl;
+
+ int mReloadPolicy;
+
+ KCal::ICalFormat mFormat;
+
+ bool mOpen;
+
+ TDEIO::FileCopyJob *mDownloadJob;
+ TDEIO::FileCopyJob *mUploadJob;
+
+ KABC::Lock *mLock;
+
+ class Private;
+ Private *d;
+};
+
+#endif