kmail Library API Documentation

kmailicalIface.h

00001 /*
00002     This file is part of KMail.
00003     Copyright (c) 2003 Steffen Hansen <steffen@klaralvdalens-datakonsult.se>
00004     Copyright (c) 2003 - 2004 Bo Thorsen <bo@sonofthor.dk>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 #ifndef KMAILICALIFACE_H
00033 #define KMAILICALIFACE_H
00034 
00035 #include <dcopobject.h>
00036 #include <qstringlist.h>
00037 #include <kurl.h>
00038 
00039 // yes, this is this very header - but it tells dcopidl to include it
00040 // in _stub.cpp and _skel.cpp files, to get the definition of the structs.
00041 // ### dcopidlng bug: "" is copied verbatim...
00042 // The kmail/ is so that it can be found by the resources easily
00043 #include <kmail/kmailicalIface.h>
00044 
00045 class KMailICalIface : virtual public DCOPObject
00046 {
00047   K_DCOP
00048 
00049 public:
00050 k_dcop:
00051   struct SubResource {
00052     //dcopidl barfs on those constructors, but dcopidlng works
00053     SubResource() {} // for QValueList
00054     SubResource( const QString& loc, const QString& lab, bool rw, bool ar )
00055       : location( loc ), label( lab ), writable( rw ), alarmRelevant( ar ) {}
00056     QString location; // unique
00057     QString label;    // shown to the user
00058     bool writable;
00059     bool alarmRelevant;
00060   };
00061 
00062   virtual bool addIncidence( const QString& type, const QString& folder,
00063                              const QString& uid, const QString& ical ) = 0;
00064   virtual bool deleteIncidence( const QString& type, const QString& folder,
00065                                 const QString& uid ) = 0;
00066   virtual QStringList incidences( const QString& type,
00067                                   const QString& folder ) = 0;
00072   virtual QStringList subresources( const QString& type ) = 0;
00073   virtual bool isWritableFolder( const QString& type,
00074                                  const QString& resource ) = 0;
00075 
00076   virtual KURL getAttachment( const QString& resource,
00077                               Q_UINT32 sernum,
00078                               const QString& filename ) = 0;
00079 
00080   // This saves the iCals/vCards in the entries in the folder.
00081   // The format in the string list is uid, entry, uid, entry...
00082   virtual bool update( const QString& type, const QString& folder,
00083                        const QStringList& entries ) = 0;
00084 
00085   // Update a single entry in the storage layer
00086   virtual bool update( const QString& type, const QString& folder,
00087                        const QString& uid, const QString& entry ) = 0;
00088 
00091   virtual Q_UINT32 update( const QString& resource,
00092                            Q_UINT32 sernum,
00093                            const QString& subject,
00094                            const QString& plainTextBody,
00095                            const QMap<QCString, QString>& customHeaders,
00096                            const QStringList& attachmentURLs,
00097                            const QStringList& attachmentMimetypes,
00098                            const QStringList& attachmentNames,
00099                            const QStringList& deletedAttachments ) = 0;
00100 
00101   virtual bool deleteIncidenceKolab( const QString& resource,
00102                                      Q_UINT32 sernum ) = 0;
00103 
00106   virtual int incidencesKolabCount( const QString& mimetype,
00107                                     const QString& resource ) = 0;
00108 
00109   virtual QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
00110                                                    const QString& resource,
00111                                                    int startIndex,
00112                                                    int nbMessages ) = 0;
00117   virtual QValueList<KMailICalIface::SubResource> subresourcesKolab( const QString& contentsType ) = 0;
00118 
00124   virtual bool addSubresource( const QString& resource,
00125                                const QString& parent,
00126                                const QString& contentsType ) = 0;
00131   virtual bool removeSubresource( const QString& resource ) = 0;
00132 
00140   enum StorageFormat { StorageIcalVcard, StorageXML };
00141 
00143   enum FolderChanges { NoChange = 0, Contents = 1, ACL = 2, IncidencesForAnnotation = 3 };
00144 
00145 k_dcop_signals:
00146   // For vcard/ical type storage (imap resource)
00147   void incidenceAdded( const QString& type, const QString& folder,
00148                        const QString& entry );
00149   void asyncLoadResult( const QStringList& list, const QString& type,
00150                         const QString& folder );
00151 
00152   // For xml kolab style storage
00153   void incidenceAdded( const QString& type, const QString& folder,
00154                        Q_UINT32 sernum, int format, const QString& entry );
00155   void asyncLoadResult( const QMap<Q_UINT32, QString>, const QString& type,
00156                         const QString& folder );
00157   //common
00158   void incidenceDeleted( const QString& type, const QString& folder,
00159                          const QString& uid );
00160   void signalRefresh( const QString& type, const QString& folder );
00161   void subresourceAdded( const QString& type, const QString& resource );
00162   void subresourceAdded( const QString& type, const QString& resource,
00163                          const QString& label, bool writable,
00164                          bool alarmRelevant );
00165   void subresourceDeleted( const QString& type, const QString& resource );
00166 };
00167 
00168 inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::SubResource& subResource )
00169 {
00170   str << subResource.location << subResource.label << subResource.writable << subResource.alarmRelevant;
00171   return str;
00172 }
00173 inline QDataStream& operator>>( QDataStream& str, KMailICalIface::SubResource& subResource )
00174 {
00175   str >> subResource.location >> subResource.label >> subResource.writable >> subResource.alarmRelevant;
00176   return str;
00177 }
00178 
00179 #endif
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 17 09:55:23 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003