You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.7 KiB
113 lines
2.7 KiB
15 years ago
|
/*=========================================================================
|
||
|
| 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"
|
||
|
|
||
14 years ago
|
#include <tqstring.h>
|
||
|
#include <tqdatetime.h>
|
||
15 years ago
|
|
||
|
namespace KCal {
|
||
|
|
||
|
/*=========================================================================
|
||
|
| CLASS
|
||
|
========================================================================*/
|
||
|
|
||
|
/**
|
||
|
* Calendar Reader.
|
||
|
*/
|
||
|
class CalDavReader : public CalDavJob {
|
||
|
|
||
|
public:
|
||
|
|
||
|
/**
|
||
|
* @param url URL to load.
|
||
|
*/
|
||
14 years ago
|
CalDavReader(const TQString& url = TQString()) :
|
||
15 years ago
|
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.
|
||
|
*/
|
||
14 years ago
|
void setRange(const TQDateTime& start, const TQDateTime& end) {
|
||
15 years ago
|
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.
|
||
|
*/
|
||
14 years ago
|
TQString data() const {
|
||
15 years ago
|
return mData;
|
||
|
}
|
||
|
|
||
14 years ago
|
/**
|
||
|
* @return downloaded task data in iCal format.
|
||
|
*/
|
||
|
TQString tasksData() const {
|
||
|
return mTasksData;
|
||
|
}
|
||
|
|
||
14 years ago
|
/**
|
||
|
* @return downloaded journal data in iCal format.
|
||
|
*/
|
||
|
TQString journalsData() const {
|
||
|
return mJournalsData;
|
||
|
}
|
||
|
|
||
15 years ago
|
protected:
|
||
|
|
||
|
virtual int runJob(runtime_info* caldavRuntime);
|
||
14 years ago
|
virtual int runTasksJob(runtime_info* caldavRuntime);
|
||
14 years ago
|
virtual int runJournalsJob(runtime_info* caldavRuntime);
|
||
15 years ago
|
|
||
|
virtual void cleanJob();
|
||
14 years ago
|
virtual void cleanTasksJob();
|
||
14 years ago
|
virtual void cleanJournalsJob();
|
||
15 years ago
|
|
||
|
private:
|
||
|
|
||
14 years ago
|
TQString mData;
|
||
14 years ago
|
TQString mTasksData;
|
||
14 years ago
|
TQString mJournalsData;
|
||
15 years ago
|
bool mGetAll;
|
||
14 years ago
|
TQDateTime mTimeStart;
|
||
|
TQDateTime mTimeEnd;
|
||
15 years ago
|
|
||
|
};
|
||
|
|
||
|
} // namespace KCal
|
||
|
|
||
|
#endif // KCALDAV_LOADER_H
|
||
|
|