summaryrefslogtreecommitdiffstats
path: root/kresources/carddav/reader.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-31 07:49:08 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-31 07:49:08 +0000
commit7ef3b0e2a5e5bc9bf928e989e4f66932be096824 (patch)
treed1b924b843f78b9d9de26becb36bb8e12f7fef44 /kresources/carddav/reader.h
parentf4a40d0495ff26b8767cf321fa8039e5ac633c12 (diff)
downloadtdepim-7ef3b0e2a5e5bc9bf928e989e4f66932be096824.tar.gz
tdepim-7ef3b0e2a5e5bc9bf928e989e4f66932be096824.zip
Added new carddav resource for kaddressbook
Lots of bugfixes for korganizer caldav resource git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1132701 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/carddav/reader.h')
-rw-r--r--kresources/carddav/reader.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/kresources/carddav/reader.h b/kresources/carddav/reader.h
new file mode 100644
index 000000000..f4c1eb84d
--- /dev/null
+++ b/kresources/carddav/reader.h
@@ -0,0 +1,91 @@
+/*=========================================================================
+| KABCDAV
+|--------------------------------------------------------------------------
+| (c) 2010 Timothy Pearson
+|
+| This project is released under the GNU General Public License.
+| Please see the file COPYING for more details.
+|--------------------------------------------------------------------------
+| Remote address book loading class.
+ ========================================================================*/
+
+/*=========================================================================
+| INCLUDES
+ ========================================================================*/
+
+#ifndef KABCDAV_LOADER_H
+#define KABCDAV_LOADER_H
+
+#include "job.h"
+
+#include <qstring.h>
+#include <qdatetime.h>
+
+namespace KABC {
+
+/*=========================================================================
+| CLASS
+ ========================================================================*/
+
+/**
+ * Calendar Reader.
+ */
+class CardDavReader : public CardDavJob {
+
+public:
+
+ /**
+ * @param url URL to load.
+ */
+ CardDavReader(const QString& url = QString()) :
+ CardDavJob(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 KABC
+
+#endif // KABCDAV_LOADER_H
+