libkcal Library API Documentation

icalformatimpl.h

00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2001-2003 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 KCAL_ICALFORMATIMPL_H
00022 #define KCAL_ICALFORMATIMPL_H
00023 
00024 #include <qstring.h>
00025 #include <qdict.h>
00026 
00027 #include "scheduler.h"
00028 #include "freebusy.h"
00029 
00030 extern "C" {
00031   #include <ical.h>
00032   #include <icalss.h>
00033 }
00034 
00035 namespace KCal {
00036 
00037 class Compat;
00038 
00044 class ICalFormatImpl
00045 {
00046   public:
00048     ICalFormatImpl( ICalFormat *parent );
00049     virtual ~ICalFormatImpl();
00050 
00051     bool populate( Calendar *, icalcomponent *fs);
00052 
00053     icalcomponent *writeIncidence(Incidence *incidence);
00054     icalcomponent *writeTodo(Todo *todo);
00055     icalcomponent *writeEvent(Event *event);
00056     icalcomponent *writeFreeBusy(FreeBusy *freebusy,
00057                                  Scheduler::Method method);
00058     icalcomponent *writeJournal(Journal *journal);
00059     void writeIncidence(icalcomponent *parent,Incidence *incidence);
00060     icalproperty *writeAttendee(Attendee *attendee);
00061     icalproperty *writeOrganizer( const Person &organizer );
00062     icalproperty *writeAttachment(Attachment *attach);
00063     icalproperty *writeRecurrenceRule(Recurrence *);
00064     icalproperty *writeAlarm(Alarm *alarm);
00065 
00066     QString extractErrorProperty(icalcomponent *);
00067     Todo *readTodo(icalcomponent *vtodo);
00068     Event *readEvent(icalcomponent *vevent);
00069     FreeBusy *readFreeBusy(icalcomponent *vfreebusy);
00070     Journal *readJournal(icalcomponent *vjournal);
00071     Attendee *readAttendee(icalproperty *attendee);
00072     Person readOrganizer( icalproperty *organizer );
00073     Attachment *readAttachment(icalproperty *attach);
00074     void readIncidence(icalcomponent *parent,Incidence *incidence);
00075     void readRecurrenceRule(icalproperty *rrule,Incidence *event);
00076     void readRecurrence( const struct icalrecurrencetype &r, Recurrence* recur );
00077     void readAlarm(icalcomponent *alarm,Incidence *incidence);
00079     const QString &loadedProductId()  { return mLoadedProductId; }
00080 
00081     icaltimetype writeICalDate(const QDate &);
00082     QDate readICalDate(icaltimetype);
00083     icaltimetype writeICalDateTime(const QDateTime &);
00084     QDateTime readICalDateTime(icaltimetype);
00085     icaldurationtype writeICalDuration(int seconds);
00086     int readICalDuration(icaldurationtype);
00087     icalcomponent *createCalendarComponent(Calendar * = 0);
00088     icalcomponent *createScheduleComponent(IncidenceBase *,Scheduler::Method);
00089 
00090   private:
00091     void writeIncidenceBase(icalcomponent *parent,IncidenceBase *);
00092     void readIncidenceBase(icalcomponent *parent,IncidenceBase *);
00093     void writeCustomProperties(icalcomponent *parent,CustomProperties *);
00094     void readCustomProperties(icalcomponent *parent,CustomProperties *);
00095     void dumpIcalRecurrence(icalrecurrencetype);
00096     void readTimezone(icalcomponent *vtimezone);
00097     void readTzidParameter( icalcomponent *parent, icaltimetype &t );
00098 
00099     ICalFormat *mParent;
00100     Calendar *mCalendar;
00101     QDict<class Timezone> mTimezones;
00102 
00103     QString mLoadedProductId;         // PRODID string loaded from calendar file
00104     int mCalendarVersion;             // determines backward compatibility mode on read
00105 
00106     Event::List mEventsRelate;           // events with relations
00107     Todo::List mTodosRelate;             // todos with relations
00108 
00109     static const int mSecondsPerWeek;
00110     static const int mSecondsPerDay;
00111     static const int mSecondsPerHour;
00112     static const int mSecondsPerMinute;
00113 
00114     Compat *mCompat;
00115 
00116     class Private;
00117     Private *d;
00118 };
00119 
00120 }
00121 
00122 #endif
KDE Logo
This file is part of the documentation for libkcal Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 22:38:36 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003