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.
92 lines
2.2 KiB
92 lines
2.2 KiB
15 years ago
|
/*=========================================================================
|
||
|
| 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"
|
||
|
|
||
15 years ago
|
#include <tqstring.h>
|
||
|
#include <tqdatetime.h>
|
||
15 years ago
|
|
||
|
namespace KABC {
|
||
|
|
||
|
/*=========================================================================
|
||
|
| CLASS
|
||
|
========================================================================*/
|
||
|
|
||
|
/**
|
||
|
* Calendar Reader.
|
||
|
*/
|
||
|
class CardDavReader : public CardDavJob {
|
||
|
|
||
|
public:
|
||
|
|
||
|
/**
|
||
|
* @param url URL to load.
|
||
|
*/
|
||
15 years ago
|
CardDavReader(const TQString& url = TQString()) :
|
||
15 years ago
|
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.
|
||
|
*/
|
||
15 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.
|
||
|
*/
|
||
15 years ago
|
TQString data() const {
|
||
15 years ago
|
return mData;
|
||
|
}
|
||
|
|
||
|
protected:
|
||
|
|
||
|
virtual int runJob(runtime_info* caldavRuntime);
|
||
|
|
||
|
virtual void cleanJob();
|
||
|
|
||
|
private:
|
||
|
|
||
15 years ago
|
TQString mData;
|
||
15 years ago
|
bool mGetAll;
|
||
15 years ago
|
TQDateTime mTimeStart;
|
||
|
TQDateTime mTimeEnd;
|
||
15 years ago
|
|
||
|
};
|
||
|
|
||
|
} // namespace KABC
|
||
|
|
||
|
#endif // KABCDAV_LOADER_H
|
||
|
|