kpilot Library API Documentation

todo-conduit.h

00001 #ifndef _KPILOT_TODO_CONDUIT_H
00002 #define _KPILOT_TODO_CONDUIT_H
00003 /* todo-conduit.h                       KPilot
00004 **
00005 ** Copyright (C) 2002 Reinhold Kainhofer
00006 ** Copyright (C) 1998-2001 Dan Pilone
00007 ** Copyright (C) 1998-2000 Preston Brown
00008 ** Copyright (C) 1998 Herwin-Jan Steehouwer
00009 **
00010 ** This file is part of the todo conduit, a conduit for KPilot that
00011 ** synchronises the Pilot's todo application with the outside world,
00012 ** which currently means KOrganizer.
00013 */
00014 
00015 /*
00016 ** This program is free software; you can redistribute it and/or modify
00017 ** it under the terms of the GNU General Public License as published by
00018 ** the Free Software Foundation; either version 2 of the License, or
00019 ** (at your option) any later version.
00020 **
00021 ** This program is distributed in the hope that it will be useful,
00022 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00024 ** GNU General Public License for more details.
00025 **
00026 ** You should have received a copy of the GNU General Public License
00027 ** along with this program in a file called COPYING; if not, write to
00028 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00029 ** MA 02111-1307, USA.
00030 */
00031 
00032 /*
00033 ** Bug reports and questions can be sent to kde-pim@kde.org
00034 */
00035 
00036 #include <plugin.h>
00037 #include <kconfig.h>
00038 
00039 // libkcal includes
00040 #include "libkcal/todo.h"
00041 #include "libkcal/calendarlocal.h"
00042 
00043 // kpilot includes
00044 #include "pilotTodoEntry.h"
00045 
00046 #include "todo-factory.h"
00047 #include "vcal-conduitbase.h"
00048 
00049 class PilotRecord;
00050 class PilotSerialDatabase;
00051 class PilotLocalDatabase;
00052 //class PilotAppCategory;
00053 //class PilotDateEntry: public PilotAppCategory;
00054 //class VCalConduitFactory;
00055 
00056 //class VCalConduitBase;
00057 
00058 class TodoConduitPrivate : public VCalConduitPrivateBase
00059 {
00060 public:
00061         TodoConduitPrivate(KCal::CalendarLocal *buddy);
00062         virtual ~TodoConduitPrivate() {};
00063 
00064 #ifdef KDE2
00065         QList<KCal::Todo> fAllTodos;
00066 #else
00067         QPtrList<KCal::Todo> fAllTodos;
00068 #endif
00069 
00070         virtual int updateIncidences();
00071         virtual void addIncidence(KCal::Incidence*);
00072         virtual void removeIncidence(KCal::Incidence *);
00073         virtual KCal::Incidence *findIncidence(recordid_t);
00074         virtual KCal::Incidence *findIncidence(PilotAppCategory*tosearch);
00075         virtual KCal::Incidence *getNextIncidence();
00076         virtual KCal::Incidence *getNextModifiedIncidence();
00077         virtual int count() {return fAllTodos.count();};
00078 } ;
00079 
00080 
00081 
00082 class TodoConduit : public VCalConduitBase
00083 {
00084 Q_OBJECT
00085 //protected:
00086 //      class VCalPrivate;
00087 public:
00088         TodoConduit(KPilotDeviceLink *,
00089                 const char *name=0L,
00090                 const QStringList &args = QStringList());
00091         virtual ~TodoConduit();
00092    
00093 protected:
00094         virtual const QString getTitle(PilotAppCategory*de);
00095         
00096         virtual const QString configGroup() { return QString::fromLatin1(ToDoConduitFactory::group); };
00097         virtual const QString dbname() { return CSL1("ToDoDB"); };
00098         virtual void preSync() {_setAppInfo(); };
00099         virtual VCalConduitPrivateBase* newVCalPrivate(KCal::CalendarLocal *fCalendar) { return new TodoConduitPrivate(fCalendar);};
00100 
00101         virtual void readConfig();
00102         void _setAppInfo();
00103         virtual void postSync();
00104         int _getCat(int cat, const QStringList cats) const;
00105 
00106         virtual PilotAppCategory*newPilotEntry(PilotRecord*r) {FUNCTIONSETUP; if (r) return new PilotTodoEntry(fTodoAppInfo, r); else return new PilotTodoEntry(fTodoAppInfo);};
00107         virtual KCal::Incidence*newIncidence() { return new KCal::Todo; };
00108 
00109         virtual void preRecord(PilotRecord*r);
00110 
00111 protected:
00112 
00113         PilotRecord *recordFromIncidence(PilotAppCategory*de, const KCal::Incidence*e);
00114         PilotRecord *recordFromIncidence(PilotTodoEntry*de, const KCal::Todo*e);
00115         KCal::Incidence *incidenceFromRecord(KCal::Incidence *, const PilotAppCategory *);
00116         KCal::Todo *incidenceFromRecord(KCal::Todo *, const PilotTodoEntry *);
00117 
00118         void setCategory(PilotTodoEntry*de, const KCal::Todo*todo);
00119         void setCategory(KCal::Todo*todo, const PilotTodoEntry*de);
00120         
00121         struct ToDoAppInfo fTodoAppInfo;
00122         bool categoriesSynced;
00123 } ;
00124 
00125 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:15 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001