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-2003 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 #include <libkcal/todo.h>
00040 #include <libkcal/calendarlocal.h>
00041 #include <pilotTodoEntry.h>
00042 #include "todo-factory.h"
00043 #include "vcal-conduitbase.h"
00044 
00045 class PilotRecord;
00046 class PilotSerialDatabase;
00047 class PilotLocalDatabase;
00048 
00049 class TodoConduitPrivate : public VCalConduitPrivateBase
00050 {
00051 public:
00052     TodoConduitPrivate(KCal::Calendar *buddy);
00053     virtual ~TodoConduitPrivate() {};
00054 
00055     KCal::Todo::List fAllTodos;
00056     KCal::Todo::List::ConstIterator fAllTodosIterator;
00057 
00058     virtual int updateIncidences();
00059     virtual void addIncidence(KCal::Incidence*);
00060     virtual void removeIncidence(KCal::Incidence *);
00061     virtual KCal::Incidence *findIncidence(recordid_t);
00062     virtual KCal::Incidence *findIncidence(PilotAppCategory*tosearch);
00063     virtual KCal::Incidence *getNextIncidence();
00064     virtual KCal::Incidence *getNextModifiedIncidence();
00065     virtual int count() {return fAllTodos.count();};
00066 } ;
00067 
00068 
00069 
00070 class TodoConduit : public VCalConduitBase
00071 {
00072 Q_OBJECT
00073 public:
00074     TodoConduit(KPilotDeviceLink *,
00075         const char *name=0L,
00076         const QStringList &args = QStringList());
00077     virtual ~TodoConduit();
00078    
00079 protected:
00080     virtual const QString getTitle(PilotAppCategory*de);
00081     
00082     virtual const QString dbname() { return CSL1("ToDoDB"); };
00083     virtual void preSync() {_getAppInfo(); };
00084     virtual VCalConduitPrivateBase* newVCalPrivate(KCal::Calendar *fCalendar) { 
00085         return new TodoConduitPrivate(fCalendar);
00086     };
00087 
00088     virtual void readConfig();
00089     void _getAppInfo();
00090     void _setAppInfo();
00091     virtual void postSync();
00092     QString _getCat(const QStringList cats, const QString curr) const;
00093 
00094     virtual PilotAppCategory*newPilotEntry(PilotRecord*r) {
00095         FUNCTIONSETUP; 
00096         if (r) return new PilotTodoEntry(fTodoAppInfo, r); 
00097         else return new PilotTodoEntry(fTodoAppInfo);
00098     };
00099     virtual KCal::Incidence*newIncidence() { return new KCal::Todo; };
00100 
00101     virtual void preRecord(PilotRecord*r);
00102 
00103 protected:
00104 
00105     PilotRecord *recordFromIncidence(PilotAppCategory*de, const KCal::Incidence*e);
00106     PilotRecord *recordFromTodo(PilotTodoEntry*de, const KCal::Todo*e);
00107     KCal::Incidence *incidenceFromRecord(KCal::Incidence *, const PilotAppCategory *);
00108     KCal::Todo *incidenceFromRecord(KCal::Todo *, const PilotTodoEntry *);
00109 
00110     void setCategory(PilotTodoEntry*de, const KCal::Todo*todo);
00111     void setCategory(KCal::Todo*todo, const PilotTodoEntry*de);
00112     
00113     struct ToDoAppInfo fTodoAppInfo;
00114     bool categoriesSynced;
00115 } ;
00116 
00117 #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 Sat May 1 11:36:50 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003