From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/caldav/job.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'kresources/caldav/job.h') diff --git a/kresources/caldav/job.h b/kresources/caldav/job.h index bad00c98d..928e38143 100644 --- a/kresources/caldav/job.h +++ b/kresources/caldav/job.h @@ -60,6 +60,13 @@ public: mTasksUrl = s; } + /** + * Sets a new Journals URL to load. + */ + virtual void setJournalsUrl(const TQString& s) { + mJournalsUrl = s; + } + /** * Sets the parent qobject. */ @@ -88,6 +95,13 @@ public: return mTasksUrl; } + /** + * @return Journals URL to load. + */ + virtual TQString journalsUrl() const { + return mJournalsUrl; + } + /** * @return parent object */ @@ -116,6 +130,13 @@ public: return mTasksError; } + /** + * @return true if journals downloading process failed. + */ + virtual bool journalsError() const { + return mJournalsError; + } + /** * @return an event error string. */ @@ -130,6 +151,13 @@ public: return mTasksErrorString; } + /** + * @return a journal error string. + */ + virtual TQString journalsErrorString() const { + return mJournalsErrorString; + } + /** * @return an event error number. */ @@ -144,6 +172,13 @@ public: return mTasksErrorNumber; } + /** + * @return a journal error number. + */ + virtual long journalsErrorNumber() const { + return mJournalsErrorNumber; + } + protected: virtual void run(); @@ -166,6 +201,15 @@ protected: */ virtual int runTasksJob(runtime_info* caldavRuntime) = 0; + /** + * Main run method for journal jobs. Jobs should not override run() method. + * Instead of this they should override this one. + * @param caldavRuntime specific libcaldav runtime information. This pointer should not be saved for the usage + * outside of runJob. + * @return libcaldav response code (see CALDAV_RESPONSE) + */ + virtual int runJournalsJob(runtime_info* caldavRuntime) = 0; + /** * Some cleaning. Jobs may (and usually should) override this method. */ @@ -176,6 +220,9 @@ protected: mTasksError = false; mTasksErrorString = ""; mTasksErrorNumber = 0; + mJournalsError = false; + mJournalsErrorString = ""; + mJournalsErrorNumber = 0; } /** @@ -188,6 +235,11 @@ protected: */ void setTasksErrorString(const TQString& str, const long number); + /** + * Sets a journal error string to @p err. Also sets an error flag. + */ + void setJournalsErrorString(const TQString& str, const long number); + /** * Process an event error. * Subclasses can overwrite this method, if some special error message handling @@ -204,16 +256,28 @@ protected: */ virtual void processTasksError(const caldav_error* err); + /** + * Process a journal error. + * Subclasses can overwrite this method, if some special error message handling + * should be done. Call setErrorString() to set the error after processing is done. + * @param err error structure. + */ + virtual void processJournalsError(const caldav_error* err); + private: TQString mUrl; TQString mTasksUrl; + TQString mJournalsUrl; bool mError; bool mTasksError; + bool mJournalsError; TQString mErrorString; TQString mTasksErrorString; + TQString mJournalsErrorString; long mErrorNumber; long mTasksErrorNumber; + long mJournalsErrorNumber; TQObject *mParent; int mType; -- cgit v1.2.1