kpilot Library API Documentation

vcal-conduitbase.h

00001 #ifndef _KPILOT_VCAL_CONDUITBASE_H 00002 #define _KPILOT_VCAL_CONDUITBASE_H 00003 /* vcal-conduit.h KPilot 00004 ** 00005 ** Copyright (C) 2002-2003 Reinhold Kainhofer 00006 ** Copyright (C) 2001 by Dan Pilone 00007 ** 00008 ** This file defines the vcal-conduit plugin. 00009 */ 00010 00011 /* 00012 ** This program is free software; you can redistribute it and/or modify 00013 ** it under the terms of the GNU General Public License as published by 00014 ** the Free Software Foundation; either version 2 of the License, or 00015 ** (at your option) any later version. 00016 ** 00017 ** This program is distributed in the hope that it will be useful, 00018 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ** GNU General Public License for more details. 00021 ** 00022 ** You should have received a copy of the GNU General Public License 00023 ** along with this program in a file called COPYING; if not, write to 00024 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00025 ** MA 02111-1307, USA. 00026 */ 00027 00028 /* 00029 ** Bug reports and questions can be sent to kde-pim@kde.org 00030 */ 00031 00032 #include <plugin.h> 00033 #include <options.h> 00034 00035 00036 00037 namespace KCal 00038 { 00039 class Calendar; 00040 class Incidence; 00041 } 00042 00043 class PilotRecord; 00044 class PilotSerialDatabase; 00045 class PilotLocalDatabase; 00046 class PilotAppCategory; 00047 00048 00049 class VCalConduitPrivateBase 00050 { 00051 protected: 00052 bool reading; 00053 KCal::Calendar *fCalendar; 00054 public: 00055 VCalConduitPrivateBase(KCal::Calendar *buddy):fCalendar(buddy) { reading=false;}; 00056 00057 virtual int updateIncidences()=0; 00058 virtual void addIncidence(KCal::Incidence*)=0; 00059 virtual void removeIncidence(KCal::Incidence *)=0; 00060 virtual KCal::Incidence *findIncidence(recordid_t)=0; 00061 virtual KCal::Incidence *findIncidence(PilotAppCategory*tosearch)=0; 00062 virtual KCal::Incidence *getNextIncidence()=0; 00063 virtual KCal::Incidence *getNextModifiedIncidence()=0; 00064 virtual int count()=0; 00065 } ; 00066 00067 00068 00069 class VCalConduitBase : public ConduitAction 00070 { 00071 Q_OBJECT 00072 public: 00073 VCalConduitBase(KPilotDeviceLink *, 00074 const char *name=0L, 00075 const QStringList &args = QStringList()); 00076 virtual ~VCalConduitBase(); 00077 00078 protected: 00079 virtual bool exec(); 00080 00081 protected slots: 00085 void slotPalmRecToPC(); 00089 void slotPCRecToPalm(); 00090 void slotDeletedIncidence(); 00091 void cleanup(); 00092 00093 00094 protected: 00095 00096 virtual int resolveConflict(KCal::Incidence*e, PilotAppCategory*de); 00097 00098 // add, change or delete events from the calendar 00099 virtual KCal::Incidence* addRecord(PilotRecord *); 00100 virtual KCal::Incidence* changeRecord(PilotRecord *,PilotRecord *); 00101 virtual KCal::Incidence* deleteRecord(PilotRecord *,PilotRecord *); 00102 00103 // add, change or delete records from the palm 00104 virtual void addPalmRecord(KCal::Incidence*e); 00105 virtual void changePalmRecord(KCal::Incidence*e, PilotRecord*s); 00106 virtual void deletePalmRecord(KCal::Incidence*e, PilotRecord*s); 00107 00108 virtual void updateIncidenceOnPalm(KCal::Incidence*e, PilotAppCategory*de); 00109 00110 virtual void readConfig(); 00111 virtual bool openCalendar(); 00112 00113 // THESE NEED TO BE IMPLEMENTED BY CHILD CLASSES!!!! 00114 00115 // create events from Palm records or vice versa 00116 virtual PilotRecord*recordFromIncidence(PilotAppCategory*de, const KCal::Incidence*e)=0; 00117 virtual KCal::Incidence *incidenceFromRecord(KCal::Incidence *e, const PilotAppCategory *de)=0; 00118 00119 virtual PilotAppCategory*newPilotEntry(PilotRecord*r)=0; 00120 virtual KCal::Incidence*newIncidence()=0; 00121 00122 00123 // general settings, implemented by child classes for the conduits 00124 virtual const QString configGroup() { return VCalConduitFactoryBase::getGroup(); }; 00125 virtual const QString dbname() = 0; 00126 00127 virtual const QString getTitle(PilotAppCategory*de)=0; 00128 00129 // THESE *CAN* BE IMPLEMTED BY CHILD CLASSES 00130 // execute something at the beginning or end of the sync. 00131 virtual void preSync(){}; 00132 virtual void postSync(); 00133 virtual void preRecord(PilotRecord*){}; 00134 virtual void preIncidence(KCal::Incidence *){}; 00135 00136 protected: 00137 KCal::Calendar *fCalendar; 00138 00139 QString fCalendarFile; 00140 bool archive; 00141 int pilotindex; 00142 enum eCalendarTypeEnum { 00143 eCalendarResource=0, 00144 eCalendarLocal 00145 } fCalendarType; 00146 00147 protected: 00148 VCalConduitPrivateBase *fP; 00149 virtual VCalConduitPrivateBase* newVCalPrivate(KCal::Calendar *fCalendar)=0; 00150 } ; 00151 00152 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:49 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003