summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformat.h
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /libkcal/icalformat.h
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'libkcal/icalformat.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformat.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
new file mode 100644
index 0000000..236efbf
--- a/dev/null
+++ b/libkcal/icalformat.h
@@ -0,0 +1,116 @@
1/*
2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20#ifndef ICALFORMAT_H
21#define ICALFORMAT_H
22
23#include <qstring.h>
24
25#include "scheduler.h"
26
27#include "calformat.h"
28
29namespace KCal {
30
31class ICalFormatImpl;
32
33/**
34 This class implements the iCalendar format. It provides methods for
35 loading/saving/converting iCalendar format data into the internal KOrganizer
36 representation as Calendar and Events.
37
38 @short iCalendar format implementation
39*/
40class ICalFormat : public CalFormat {
41 public:
42 /** Create new iCalendar format. */
43 ICalFormat( bool quick = false );
44 virtual ~ICalFormat();
45
46 /**
47 Loads a calendar on disk in iCalendar format into calendar.
48 Returns true if successful, else returns false. Provides more error
49 information by exception().
50 @param calendar Calendar object to be filled.
51 @param fileName The name of the calendar file on disk.
52 */
53 bool load( Calendar *, const QString &fileName );
54 /**
55 Writes out the calendar to disk in iCalendar format. Returns true if
56 successful and false on error.
57
58 @param calendar The Calendar object to be written.
59 @param fileName The name of the calendar file on disk.
60 */
61 bool save( Calendar *, const QString &fileName );
62
63 /**
64 Parse string and populate calendar with that information.
65 */
66 bool fromString( Calendar *, const QString & );
67 /**
68 Parse string and return first ical component.
69 */
70 Incidence *fromString( const QString & );
71 /**
72 Return calendar information as string.
73 */
74 QString toString( Calendar * );
75 /**
76 Return incidence as full iCalendar formatted text.
77 */
78 QString toICalString( Incidence * );
79 /**
80 Return incidence as iCalendar formatted text.
81 */
82 QString toString( Incidence * );
83 /**
84 Return recurrence as iCalendar formatted text.
85 */
86 QString toString( Recurrence * );
87 /**
88 Parse string and fill recurrence object with
89 that information
90 */
91 //bool fromString ( Recurrence *, const QString& );
92
93 /** Create a scheduling message for event \a e using method \m */
94 QString createScheduleMessage(IncidenceBase *e,Scheduler::Method m);
95 /** Parse scheduling message provided as string \s */
96 ScheduleMessage *parseScheduleMessage( Calendar *, const QString &s);
97
98 /** Set id of used time zone and whether this time zone is UTC or not. */
99 void setTimeZone( const QString &id, bool utc );
100 QString timeZoneId() const;
101 int timeOffset();
102 const char * tzString();
103 bool utc() const;
104
105 private:
106 ICalFormatImpl *mImpl;
107 bool mQuicksave;
108 QString mTimeZoneId;
109 QCString mTzString;
110 int tzOffsetMin;
111 bool mUtc;
112};
113
114}
115
116#endif