libkcal

vcalformat.h
1 /*
2  This file is part of libkcal.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
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_VCALFORMAT_H
23 #define KCAL_VCALFORMAT_H
24 
25 #include "calformat.h"
26 
27 #include "todo.h"
28 #include "event.h"
29 #include "libkcal_export.h"
30 
31 #define _VCAL_VERSION "1.0"
32 
33 class VObject;
34 
35 namespace KCal {
36 
44 class LIBKCAL_EXPORT VCalFormat : public CalFormat
45 {
46  public:
47  VCalFormat();
48  virtual ~VCalFormat();
49 
57  bool load( Calendar *calendar, const TQString &fileName );
65  bool save(Calendar *calendar, const TQString &fileName);
66 
70  bool fromString( Calendar *, const TQString & );
74  TQString toString( Calendar * );
75 
76  protected:
78  Todo *VTodoToEvent(VObject *vtodo);
80  Event *VEventToEvent(VObject *vevent);
82  VObject *eventToVTodo(const Todo *anEvent);
84  VObject* eventToVEvent(const Event *anEvent);
85 
87  TQString qDateToISO(const TQDate &);
89  TQString qDateTimeToISO(const TQDateTime &, bool zulu=TRUE);
92  TQDateTime ISOToTQDateTime(const TQString & dtStr);
95  TQDate ISOToTQDate(const TQString & dtStr);
98  void populate(VObject *vcal);
99 
102  const char *dayFromNum(int day);
104  int numFromDay(const TQString &day);
105 
106  Attendee::PartStat readStatus(const char *s) const;
107  TQCString writeStatus(Attendee::PartStat status) const;
108 
109  private:
110  Calendar *mCalendar;
111 
112  Event::List mEventsRelate; // events with relations
113  Todo::List mTodosRelate; // todos with relations
114 
115  class Private;
116  Private *d;
117 };
118 
119 }
120 
121 #endif
This is the base class for calendar formats.
Definition: calformat.h:44
This is the main "calendar" object class.
Definition: calendar.h:171
This class provides an Event in the sense of RFC2445.
Definition: event.h:33
This class provides a Todo in the sense of RFC2445.
Definition: todo.h:32
This class implements the vCalendar format.
Definition: vcalformat.h:45
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38