libkcal

icalformatimpl.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KCAL_ICALFORMATIMPL_H
23 #define KCAL_ICALFORMATIMPL_H
24 
25 #include <tqstring.h>
26 #include <tqdict.h>
27 
28 #include "scheduler.h"
29 #include "freebusy.h"
30 
31 
32 extern "C" {
33  #include <libical/ical.h>
34 }
35 
36 namespace KCal {
37 
38 class Compat;
39 
45 class ICalFormatImpl
46 {
47  public:
49  ICalFormatImpl( ICalFormat *parent );
50  virtual ~ICalFormatImpl();
51 
52  bool populate( Calendar *, icalcomponent *fs);
53 
54  icalcomponent *writeIncidence(IncidenceBase *incidence, Scheduler::Method method = Scheduler::Request );
55  icalcomponent *writeTodo(Todo *todo);
56  icalcomponent *writeEvent(Event *event);
57  icalcomponent *writeFreeBusy(FreeBusy *freebusy,
58  Scheduler::Method method = Scheduler::Publish );
59  icalcomponent *writeJournal(Journal *journal);
60  void writeIncidence(icalcomponent *parent,Incidence *incidence);
61  icalproperty *writeAttendee(Attendee *attendee);
62  icalproperty *writeOrganizer( const Person &organizer );
63  icalproperty *writeAttachment(Attachment *attach);
64  icalproperty *writeRecurrenceRule(Recurrence *);
65  icalrecurrencetype writeRecurrenceRule( RecurrenceRule *recur );
66  icalcomponent *writeAlarm(Alarm *alarm);
67 
68  TQString extractErrorProperty(icalcomponent *);
69  Todo *readTodo(icalcomponent *vtodo);
70  Event *readEvent(icalcomponent *vevent, icalcomponent *vtimezone);
71  FreeBusy *readFreeBusy(icalcomponent *vfreebusy);
72  Journal *readJournal(icalcomponent *vjournal);
73  Attendee *readAttendee(icalproperty *attendee);
74  Person readOrganizer( icalproperty *organizer );
75  Attachment *readAttachment(icalproperty *attach);
76  void readIncidence(icalcomponent *parent, icaltimezone *timezone, Incidence *incidence);
77  void readRecurrenceRule(icalproperty *rrule,Incidence *event );
78  void readExceptionRule( icalproperty *rrule, Incidence *incidence );
79  void readRecurrence( const struct icalrecurrencetype &r, RecurrenceRule* recur );
80  void readAlarm(icalcomponent *alarm,Incidence *incidence);
82  const TQString &loadedProductId() { return mLoadedProductId; }
83 
84  static icaltimetype writeICalDate(const TQDate &);
85  static TQDate readICalDate(icaltimetype);
86  icaltimetype writeICalDateTime(const TQDateTime &);
87  TQDateTime readICalDateTime( icalproperty*, icaltimetype&, icaltimezone* tz = 0 );
88  static icaldurationtype writeICalDuration(int seconds);
89  static int readICalDuration(icaldurationtype);
90  static icaldatetimeperiodtype writeICalDatePeriod( const TQDate &date );
91  icaldatetimeperiodtype writeICalDateTimePeriod( const TQDateTime &date );
92 
93  icalcomponent *createCalendarComponent(Calendar * = 0);
94  icalcomponent *createScheduleComponent(IncidenceBase *,Scheduler::Method);
95 
96  protected:
97  void dumpIcalRecurrence(icalrecurrencetype);
98  private:
99  void writeIncidenceBase(icalcomponent *parent,IncidenceBase *);
100  void readIncidenceBase(icalcomponent *parent, IncidenceBase *);
101  void writeCustomProperties(icalcomponent *parent,CustomProperties *);
102  void readCustomProperties(icalcomponent *parent,CustomProperties *);
103  void readTimezone(icalcomponent *vtimezone);
104 
105  ICalFormat *mParent;
106  Calendar *mCalendar;
107 
108  TQString mLoadedProductId; // PRODID string loaded from calendar file
109 
110  Event::List mEventsRelate; // events with relations
111  Todo::List mTodosRelate; // todos with relations
112 
113  static const int mSecondsPerWeek;
114  static const int mSecondsPerDay;
115  static const int mSecondsPerHour;
116  static const int mSecondsPerMinute;
117 
118  Compat *mCompat;
119 
120  class ToComponentVisitor;
121  class Private;
122  Private *d;
123 };
124 
125 }
126 
127 #endif
Method
iTIP methods.
Definition: scheduler.h:103
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38