libkpimexchange Library API Documentation

exchangedownload.h

00001 /*
00002     This file is part of libkpimexchange
00003     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef KDEPIM_EXCHANGE_DOWNLOAD_H
00021 #define KDEPIM_EXCHANGE_DOWNLOAD_H
00022 
00023 #include <qstring.h>
00024 #include <qptrlist.h>
00025 #include <qdatetime.h>
00026 #include <qdom.h>
00027 #include <qmap.h>
00028 #include <kio/job.h>
00029 
00030 #include <libkcal/calendar.h>
00031 #include <libkcal/icalformat.h>
00032 
00033 namespace KPIM {
00034     
00035 class ExchangeProgress;
00036 class ExchangeAccount;
00037 
00038 class ExchangeDownload : public QObject {
00039     Q_OBJECT
00040   public:
00041     ExchangeDownload( ExchangeAccount* account, QWidget* window=0 );
00042    ~ExchangeDownload();
00043 
00044     void download( KCal::Calendar* calendar, 
00045          const QDate& start, const QDate& end, bool showProgress );
00046     void download( const QDate& start, const QDate& end, bool showProgress );
00047  
00048   signals:
00049     void startDownload();
00050     void finishDownload();
00051 
00052     void gotEvent( KCal::Event* event, const KURL& url );
00053     void finished( ExchangeDownload*, int result, const QString& moreInfo );
00054     void finished( ExchangeDownload*, int result, const QString& moreInfo, QPtrList<KCal::Event>& events );
00055 
00056   private slots:
00057     void slotSearchResult( KIO::Job *job );
00058     void slotMasterResult( KIO::Job* job );
00059     void slotPropFindResult( KIO::Job * );
00060 
00061   private:
00062     void handleAppointments( const QDomDocument &, bool recurrence );
00063     void readAppointment( const KURL& url );
00064     void handleRecurrence( QString uid );
00065     void finishUp( int result, const QString& moreInfo=QString::null );
00066     void finishUp( int result, KIO::Job* job );
00067 
00068     void increaseDownloads();
00069     void decreaseDownloads();
00070 
00071     QString dateSelectQuery( const QDate& start, const QDate& end );
00072     
00073     KCal::Calendar *mCalendar;
00074     KCal::ICalFormat *mFormat;
00075     QPtrList<KCal::Event> *mEvents;
00076     ExchangeAccount *mAccount;
00077     ExchangeProgress *mProgress;
00078     int mDownloadsBusy;
00079     QDomDocument mResponse;
00080 
00081     QMap<QString,int> m_uids; // This keeps track of uids we already covered. Especially useful for
00082         // recurring events.
00083     QWidget* mWindow;
00084 };
00085 
00086 }
00087 
00088 #endif
00089 
KDE Logo
This file is part of the documentation for libkpimexchange Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:09 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003