libkcal Library API Documentation

icalformatimpl.h

00001 /*
00002     This file is part of libkcal.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef ICALFORMATIMPL_H
00021 #define ICALFORMATIMPL_H
00022 
00023 #include <qstring.h>
00024 
00025 #include "scheduler.h"
00026 #include "freebusy.h"
00027 
00028 extern "C" {
00029   #include <ical.h>
00030   #include <icalss.h>
00031 }
00032 
00033 namespace KCal {
00034 
00035 class Compat;
00036 
00040 class ICalFormatImpl {
00041   public:
00043     ICalFormatImpl( ICalFormat *parent );
00044     virtual ~ICalFormatImpl();
00045 
00046     bool populate( Calendar *, icalfileset *fs);
00047 
00048     icalcomponent *writeIncidence(Incidence *incidence);
00049     icalcomponent *writeTodo(Todo *todo);
00050     icalcomponent *writeEvent(Event *event);
00051     icalcomponent *writeFreeBusy(FreeBusy *freebusy,
00052                                  Scheduler::Method method);
00053     icalcomponent *writeJournal(Journal *journal);
00054     void writeIncidence(icalcomponent *parent,Incidence *incidence);
00055     icalproperty *writeAttendee(Attendee *attendee);
00056     icalproperty *writeRecurrenceRule(Recurrence *);
00057     icalproperty *writeAlarm(Alarm *alarm);
00058 
00059     QString extractErrorProperty(icalcomponent *);
00060     Todo *readTodo(icalcomponent *vtodo);
00061     Event *readEvent(icalcomponent *vevent);
00062     FreeBusy *readFreeBusy(icalcomponent *vfreebusy);
00063     Journal *readJournal(icalcomponent *vjournal);
00064     Attendee *readAttendee(icalproperty *attendee);
00065     void readIncidence(icalcomponent *parent,Incidence *incidence);
00066     void readRecurrenceRule(icalproperty *rrule,Incidence *event);
00067     void readRecurrence( const struct icalrecurrencetype &r, Recurrence* recur );
00068     void readAlarm(icalcomponent *alarm,Incidence *incidence);
00070     const QString &loadedProductId()  { return mLoadedProductId; }
00071 
00072     icaltimetype writeICalDate(const QDate &);
00073     QDate readICalDate(icaltimetype);
00074     icaltimetype writeICalDateTime(const QDateTime &);
00075     QDateTime readICalDateTime(icaltimetype);
00076     icaldurationtype writeICalDuration(int seconds);
00077     int readICalDuration(icaldurationtype);
00078     icalcomponent *createCalendarComponent();
00079     icalcomponent *createScheduleComponent(IncidenceBase *,Scheduler::Method);
00080 
00081   private:
00082     void dumpIcalRecurrence(icalrecurrencetype);
00083 
00084     ICalFormat *mParent;
00085     Calendar *mCalendar;
00086 
00087     QString mLoadedProductId;         // PRODID string loaded from calendar file
00088     int mCalendarVersion;             // determines backward compatibility mode on read
00089 
00090     QPtrList<Event> mEventsRelate;           // events with relations
00091     QPtrList<Todo> mTodosRelate;             // todos with relations
00092 
00093     static const int mSecondsPerWeek;
00094     static const int mSecondsPerDay;
00095     static const int mSecondsPerHour;
00096     static const int mSecondsPerMinute;
00097 
00098     Compat *mCompat;
00099 };
00100 
00101 }
00102 
00103 #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:03 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001