exchangeclient.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KDEPIM_EXCHANGE_CLIENT_H
00021 #define KDEPIM_EXCHANGE_CLIENT_H
00022
00023 #include <qstring.h>
00024 #include <qdatetime.h>
00025 #include <qobject.h>
00026
00027 namespace KCal {
00028 class Event;
00029 class Calendar;
00030 }
00031
00032 namespace KIO {
00033 class Job;
00034 }
00035
00036 namespace KPIM {
00037
00038 class ExchangeAccount;
00039 class ExchangeDownload;
00040 class ExchangeUpload;
00041 class ExchangeDelete;
00042
00043 class ExchangeClient : public QObject {
00044 Q_OBJECT
00045 public:
00046 ExchangeClient( ExchangeAccount* account, const QString& mTimeZoneId=QString::null );
00047 ~ExchangeClient();
00048
00052 void setWindow(QWidget *window);
00053
00057 QWidget *window() const;
00058
00062 void setTimeZoneId( const QString& timeZoneId );
00063 QString timeZoneId();
00064
00065
00066 enum {
00067 ResultOK,
00068 UnknownError,
00069 CommunicationError,
00070 ServerResponseError,
00072 IllegalAppointmentError,
00073 NonEventError,
00074 EventWriteError,
00075 DeleteUnknownEventError
00076 };
00077
00078 int downloadSynchronous( KCal::Calendar* calendar, const QDate& start, const QDate& end, bool showProgress=false);
00079 int uploadSynchronous( KCal::Event* event );
00080 int removeSynchronous( KCal::Event* event );
00081
00082 QString detailedErrorString();
00083
00084 public slots:
00085
00086 void download( KCal::Calendar* calendar, const QDate& start, const QDate& end, bool showProgress=false);
00087 void upload( KCal::Event* event );
00088 void remove( KCal::Event* event );
00089 void test();
00090
00091 private slots:
00092 void slotDownloadFinished( ExchangeDownload* worker, int result, const QString& moreInfo );
00093 void slotUploadFinished( ExchangeUpload* worker, int result, const QString& moreInfo );
00094 void slotRemoveFinished( ExchangeDelete* worker, int result, const QString& moreInfo );
00095 void slotSyncFinished( int result, const QString& moreInfo );
00096
00097 signals:
00098
00099
00100 void startDownload();
00101 void finishDownload();
00102
00103 void uploadFinished( int result, const QString& moreInfo );
00104 void downloadFinished( int result, const QString& moreInfo );
00105 void removeFinished( int result, const QString& moreInfo );
00106
00107 private:
00108 void test2();
00109
00110 enum { WaitingForResult, HaveResult };
00111
00112 int mClientState;
00113 int mSyncResult;
00114 QString mDetailedErrorString;
00115 QWidget* mWindow;
00116 ExchangeAccount* mAccount;
00117 QString mTimeZoneId;
00118 };
00119
00120 }
00121
00122 #endif
This file is part of the documentation for kdelibs Version 3.1.5.