korganizer Library API Documentation

kogroupware.h

00001 /*
00002   This file is part of the Groupware/KOrganizer integration.
00003 
00004   Requires the Qt and KDE widget libraries, available at no cost at
00005   http://www.trolltech.com and http://www.kde.org respectively
00006 
00007   Copyright (c) 2002 Klarälvdalens Datakonsult AB
00008 
00009   This program is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free Software Foundation; either version 2 of the License, or
00012   (at your option) any later version.
00013 
00014   This program is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with this program; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00022   MA  02111-1307, USA.
00023 
00024   As a special exception, permission is given to link this program
00025   with any edition of Qt, and distribute the resulting executable,
00026   without including the source code for Qt in the source distribution.
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     // THIS IS THE ACTUAL KM/KO API
00085     enum EventState { Accepted, ConditionallyAccepted, Declined, Request };
00086 
00087     // Event initiated by somebody else, coming into KO from KM, returning
00088     // resulting state
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     // Answer to invitation
00102     bool incidenceAnswer( const QString& vCal );
00103 
00104     // END OF THE ACTUAL KM/KO API
00105 
00106     // KOrganizer publishes the free/busy list
00107     void publishFreeBusy();
00108 
00109     // Get the free/busy list as a string
00110     QString getFreeBusyString();
00111 
00119   /*KCal::FreeBusy**/ 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
KDE Logo
This file is part of the documentation for korganizer Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:38:29 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003