00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
#ifndef KOGROUPWARE_H
00030
#define KOGROUPWARE_H
00031
00032
#include <libkcal/icalformat.h>
00033
#include <libkcal/freebusy.h>
00034
#include <qstring.h>
00035
#include <qobject.h>
00036
00037
#include <kio/job.h>
00038
00039
using namespace KCal;
00040
00041
namespace KCal {
00042
class Calendar;
00043
class Event;
00044 }
00045
class CalendarView;
00046
class KOGroupware;
00047
00051 class FBDownloadJob :
public QObject {
00052 Q_OBJECT
00053
public:
00054
FBDownloadJob(
const QString& email,
const KURL& url, KOGroupware* kogroupware,
const char* name = 0 );
00055
00056
virtual ~
FBDownloadJob();
00057
protected slots:
00058
void slotResult( KIO::Job* );
00059
void slotData( KIO::Job*,
const QByteArray &data );
00060 signals:
00061
void fbDownloaded(
const QString&, FreeBusy*);
00062
00063
private:
00064 KOGroupware* mKogroupware;
00065 QString mEmail;
00066
00067 QCString mFBData;
00068 };
00069
00070
class KOGroupware :
public QObject
00071 {
00072 Q_OBJECT
00073
public:
00074
static KOGroupware* create(
CalendarView*, KCal::Calendar* );
00075
static KOGroupware* instance();
00076
00081
bool sendICalMessage( QWidget* parent, KCal::Scheduler::Method method,
00082 Incidence* incidence,
bool isDeleting =
false );
00083
00084
00085
enum EventState { Accepted, ConditionallyAccepted, Declined, Request };
00086
00087
00088
00089
bool incomingEventRequest(
const QString& request,
00090
const QCString& receiver,
00091
const QString& vCalIn );
00092
void incomingResourceRequest(
const QValueList<QPair<QDateTime, QDateTime> >& busy,
00093
const QCString& resource,
00094
const QString& vCalIn,
00095
bool& vCalInOK,
00096 QString& vCalOut,
00097
bool& vCalOutOK,
00098
bool& isFree,
00099 QDateTime& start, QDateTime& end );
00100
00101
00102
bool incidenceAnswer(
const QString& vCal );
00103
00104
00105
00106
00107
void publishFreeBusy();
00108
00109
00110 QString getFreeBusyString();
00111
00119
bool downloadFreeBusyData(
const QString& email, QObject* receiver,
const char* member );
00120 KCal::FreeBusy* parseFreeBusy(
const QCString& data );
00121
00122
protected:
00123 KOGroupware(
CalendarView*, KCal::Calendar* );
00124
00125
private:
00126
static KOGroupware* mInstance;
00127 KCal::ICalFormat mFormat;
00128
CalendarView* mView;
00129 KCal::Calendar* mCalendar;
00130 };
00131
00132
#endif