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 <qdatetime.h>
00025 #include <qdom.h>
00026 #include <qmap.h>
00027 #include <kio/job.h>
00028 
00029 #include <libkcal/calendar.h>
00030 #include <libkcal/icalformat.h>
00031 
00032 namespace KPIM {
00033         
00034 class ExchangeProgress;
00035 class ExchangeAccount;
00036 
00037 class ExchangeDownload : public QObject {
00038     Q_OBJECT
00039   public:
00040     ExchangeDownload( ExchangeAccount* account, QWidget* window=0 );
00041    ~ExchangeDownload();
00042 
00043     void download( KCal::Calendar* calendar, 
00044          const QDate& start, const QDate& end, bool showProgress);
00045  
00046   signals:
00047     void startDownload();
00048     void finishDownload();
00049 
00050     void finished( ExchangeDownload*, int result, const QString& moreInfo );
00051 
00052   private slots:
00053     void slotSearchResult( KIO::Job *job );
00054     void slotMasterResult( KIO::Job* job );
00055     void slotPropFindResult( KIO::Job * );
00056 
00057   private:
00058     void handleAppointments( const QDomDocument &, bool recurrence );
00059     void readAppointment( const KURL& url );
00060     void handleRecurrence( QString uid );
00061     void finishUp( int result, const QString& moreInfo=QString::null );
00062     void finishUp( int result, KIO::Job* job );
00063 
00064     void increaseDownloads();
00065     void decreaseDownloads();
00066 
00067     QString dateSelectQuery( const QDate& start, const QDate& end );
00068     
00069     KCal::Calendar *mCalendar;
00070     KCal::ICalFormat *mFormat;
00071     QPtrList<KCal::Event> mEvents;
00072     ExchangeAccount *mAccount;
00073     ExchangeProgress *mProgress;
00074     int mDownloadsBusy;
00075     QDomDocument mResponse;
00076 
00077     QMap<QString,int> m_uids; // This keeps track of uids we already covered. Especially useful for
00078         // recurring events.
00079     QWidget* mWindow;
00080 };
00081 
00082 }
00083 
00084 #endif
00085 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:58 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001