summaryrefslogtreecommitdiffstats
path: root/kresources/caldav/reader.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-24 17:21:58 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-24 17:21:58 +0000
commita71c4476a79950040c9007f84af25cef4e28b351 (patch)
tree20d54bfeb827604e6b1c4ca01e9702346ddcc068 /kresources/caldav/reader.h
parent45c9a75f1220817f57304df51e018f8cc66aaea4 (diff)
downloadtdepim-a71c4476a79950040c9007f84af25cef4e28b351.tar.gz
tdepim-a71c4476a79950040c9007f84af25cef4e28b351.zip
Initial CalDAV support
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1130194 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/caldav/reader.h')
-rw-r--r--kresources/caldav/reader.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/kresources/caldav/reader.h b/kresources/caldav/reader.h
new file mode 100644
index 000000000..070239fdd
--- /dev/null
+++ b/kresources/caldav/reader.h
@@ -0,0 +1,92 @@
+/*=========================================================================
+| KCalDAV
+|--------------------------------------------------------------------------
+| (c) 2010 Timothy Pearson
+| (c) 2009 Kumaran Santhanam (initial KDE4 version)
+|
+| This project is released under the GNU General Public License.
+| Please see the file COPYING for more details.
+|--------------------------------------------------------------------------
+| Remote calendar loading class.
+ ========================================================================*/
+
+/*=========================================================================
+| INCLUDES
+ ========================================================================*/
+
+#ifndef KCALDAV_LOADER_H
+#define KCALDAV_LOADER_H
+
+#include "job.h"
+
+#include <qstring.h>
+#include <qdatetime.h>
+
+namespace KCal {
+
+/*=========================================================================
+| CLASS
+ ========================================================================*/
+
+/**
+ * Calendar Reader.
+ */
+class CalDavReader : public CalDavJob {
+
+public:
+
+ /**
+ * @param url URL to load.
+ */
+ CalDavReader(const QString& url = QString()) :
+ CalDavJob(url)
+ , mGetAll(true)
+ {
+ }
+
+ /**
+ * Sets a time range. Only event between @p start and @p end will be loaded.
+ * This method call disables the effect of setGetAll() call.
+ * setGetAll() call disables the effect of this method.
+ */
+ void setRange(const QDateTime& start, const QDateTime& end) {
+ mGetAll = false;
+ mTimeStart = start;
+ mTimeEnd = end;
+ }
+
+ /**
+ * Sets the flag to load all events from the remote calendar.
+ * This method call disables the effect of setRange() call.
+ * setGetAll() call disables the effect of this method.
+ */
+ void setGetAll() {
+ mGetAll = true;
+ }
+
+ /**
+ * @return downloaded calendar data in iCal format.
+ */
+ QString data() const {
+ return mData;
+ }
+
+protected:
+
+ virtual int runJob(runtime_info* caldavRuntime);
+
+ virtual void cleanJob();
+
+private:
+
+ QString mData;
+ bool mGetAll;
+ QDateTime mTimeStart;
+ QDateTime mTimeEnd;
+
+};
+
+} // namespace KCal
+
+#endif // KCALDAV_LOADER_H
+