kitchensync Library API Documentation

calendarsyncee.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
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 #ifndef CALENDARSYNCEE_H
00022 #define CALENDARSYNCEE_H
00023 
00024 #include <libkcal/calendar.h>
00025 
00026 #include "syncee.h"
00027 
00028 namespace KSync {
00029 
00030 class CalendarSyncEntry : public SyncEntry
00031 {
00032   public:
00033     CalendarSyncEntry( KCal::Incidence *, Syncee *parent );
00034   
00035     QString type() const { return "CalendarSyncEntry"; }
00036     QString name();
00037     QString id();
00038     QString timestamp();
00039     
00040     bool equals( SyncEntry *entry );
00041 
00042     CalendarSyncEntry *clone();
00043 
00044     KCal::Incidence *incidence() { return mIncidence; }
00045 
00046     KPIM::DiffAlgo* diffAlgo( SyncEntry*, SyncEntry* );
00047 
00048   private:
00049     KCal::Incidence *mIncidence;
00050 };
00051 
00056 class CalendarSyncee : public Syncee
00057 {
00058   public:
00059     CalendarSyncee( KCal::Calendar* );
00060     ~CalendarSyncee();
00061 
00062     QString type() const { return "CalendarSyncee"; }
00063 
00064     void reset();
00065     
00066     CalendarSyncEntry *firstEntry();
00067     CalendarSyncEntry *nextEntry();
00068     
00069 //    CalendarSyncEntry *findEntry( const QString &id );
00070 
00071     void addEntry( SyncEntry * );
00072     void removeEntry( SyncEntry * );
00073 
00074     SyncEntry::PtrList added() { return SyncEntry::PtrList(); }
00075     SyncEntry::PtrList modified() { return SyncEntry::PtrList(); }
00076     SyncEntry::PtrList removed() { return SyncEntry::PtrList(); }
00077     Syncee *clone() { return 0; }
00078 
00079     KCal::Calendar *calendar() const { return mCalendar; }
00080 
00081     bool writeBackup( const QString & );
00082     bool restoreBackup( const QString & );
00083 
00084   private:
00085     CalendarSyncEntry *createEntry( KCal::Incidence * );
00086 
00087     void clearEntries();
00088   
00089     KCal::Calendar *mCalendar;
00090     KCal::Event::List mEvents;
00091     KCal::Event::List::ConstIterator mCurrentEvent;
00092     KCal::Todo::List mTodos;
00093     KCal::Todo::List::ConstIterator mCurrentTodo;
00094     bool mIteratingEvents;
00095     
00096     QMap<KCal::Incidence *,CalendarSyncEntry *> mEntries;
00097 };
00098 
00099 }
00100 
00101 #endif
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:53:45 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003