summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 06a911c..c45d81f 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -1,170 +1,170 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#ifndef CALENDAR_H 22#ifndef CALENDAR_H
23#define CALENDAR_H 23#define CALENDAR_H
24 24
25#include <qobject.h> 25#include <qobject.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qptrlist.h> 28#include <qptrlist.h>
29#include <qdict.h> 29#include <qdict.h>
30 30
31#include "customproperties.h" 31#include "customproperties.h"
32#include "event.h" 32#include "event.h"
33#include "todo.h" 33#include "todo.h"
34#include "journal.h" 34#include "journal.h"
35#include "calfilter.h"
35 36
36#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */ 37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */
37 38
38class KConfig; 39class KConfig;
39 40
40namespace KCal { 41namespace KCal {
41 42
42class CalFilter;
43 43
44/** 44/**
45 This is the main "calendar" object class for KOrganizer. It holds 45 This is the main "calendar" object class for KOrganizer. It holds
46 information like all appointments/events, user information, etc. etc. 46 information like all appointments/events, user information, etc. etc.
47 one calendar is associated with each CalendarView (@see calendarview.h). 47 one calendar is associated with each CalendarView (@see calendarview.h).
48 This is an abstract base class defining the interface to a calendar. It is 48 This is an abstract base class defining the interface to a calendar. It is
49 implemented by subclasses like @see CalendarLocal, which use different 49 implemented by subclasses like @see CalendarLocal, which use different
50 methods to store and access the data. 50 methods to store and access the data.
51 51
52 Ownership of events etc. is handled by the following policy: As soon as an 52 Ownership of events etc. is handled by the following policy: As soon as an
53 event (or any other subclass of IncidenceBase) object is added to the 53 event (or any other subclass of IncidenceBase) object is added to the
54 Calendar by addEvent() it is owned by the Calendar object. The Calendar takes 54 Calendar by addEvent() it is owned by the Calendar object. The Calendar takes
55 care of deleting it. All Events returned by the query functions are returned 55 care of deleting it. All Events returned by the query functions are returned
56 as pointers, that means all changes to the returned events are immediately 56 as pointers, that means all changes to the returned events are immediately
57 visible in the Calendar. You shouldn't delete any Event object you get from 57 visible in the Calendar. You shouldn't delete any Event object you get from
58 Calendar. 58 Calendar.
59*/ 59*/
60class Calendar : public QObject, public CustomProperties, 60class Calendar : public QObject, public CustomProperties,
61 public IncidenceBase::Observer 61 public IncidenceBase::Observer
62{ 62{
63 Q_OBJECT 63 Q_OBJECT
64public: 64public:
65 Calendar(); 65 Calendar();
66 Calendar(const QString &timeZoneId); 66 Calendar(const QString &timeZoneId);
67 virtual ~Calendar(); 67 virtual ~Calendar();
68 void deleteIncidence(Incidence *in); 68 void deleteIncidence(Incidence *in);
69 void resetTempSyncStat(); 69 void resetTempSyncStat();
70 /** 70 /**
71 Clears out the current calendar, freeing all used memory etc. 71 Clears out the current calendar, freeing all used memory etc.
72 */ 72 */
73 virtual void close() = 0; 73 virtual void close() = 0;
74 74
75 /** 75 /**
76 Sync changes in memory to persistant storage. 76 Sync changes in memory to persistant storage.
77 */ 77 */
78 virtual void save() = 0; 78 virtual void save() = 0;
79 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 79 virtual QPtrList<Event> getExternLastSyncEvents() = 0;
80 virtual bool isSaving() { return false; } 80 virtual bool isSaving() { return false; }
81 81
82 /** 82 /**
83 Return the owner of the calendar's full name. 83 Return the owner of the calendar's full name.
84 */ 84 */
85 const QString &getOwner() const; 85 const QString &getOwner() const;
86 /** 86 /**
87 Set the owner of the calendar. Should be owner's full name. 87 Set the owner of the calendar. Should be owner's full name.
88 */ 88 */
89 void setOwner( const QString &os ); 89 void setOwner( const QString &os );
90 /** 90 /**
91 Return the email address of the calendar owner. 91 Return the email address of the calendar owner.
92 */ 92 */
93 const QString &getEmail(); 93 const QString &getEmail();
94 /** 94 /**
95 Set the email address of the calendar owner. 95 Set the email address of the calendar owner.
96 */ 96 */
97 void setEmail( const QString & ); 97 void setEmail( const QString & );
98 98
99 /** 99 /**
100 Set time zone from a timezone string (e.g. -2:00) 100 Set time zone from a timezone string (e.g. -2:00)
101 */ 101 */
102 void setTimeZone( const QString &tz ); 102 void setTimeZone( const QString &tz );
103 /** 103 /**
104 Set time zone from a minutes value (e.g. -60) 104 Set time zone from a minutes value (e.g. -60)
105 */ 105 */
106 void setTimeZone( int tz ); 106 void setTimeZone( int tz );
107 /** 107 /**
108 Return time zone as offest in minutes. 108 Return time zone as offest in minutes.
109 */ 109 */
110 int getTimeZone() const; 110 int getTimeZone() const;
111 /** 111 /**
112 Compute an ISO 8601 format string from the time zone. 112 Compute an ISO 8601 format string from the time zone.
113 */ 113 */
114 QString getTimeZoneStr() const; 114 QString getTimeZoneStr() const;
115 /** 115 /**
116 Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal 116 Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal
117 values). 117 values).
118 */ 118 */
119 void setTimeZoneId( const QString & ); 119 void setTimeZoneId( const QString & );
120 /** 120 /**
121 Return time zone id. 121 Return time zone id.
122 */ 122 */
123 QString timeZoneId() const; 123 QString timeZoneId() const;
124 /** 124 /**
125 Use local time, not UTC or a time zone. 125 Use local time, not UTC or a time zone.
126 */ 126 */
127 void setLocalTime(); 127 void setLocalTime();
128 /** 128 /**
129 Return whether local time is being used. 129 Return whether local time is being used.
130 */ 130 */
131 bool isLocalTime() const; 131 bool isLocalTime() const;
132 132
133 /** 133 /**
134 Add an incidence to calendar. 134 Add an incidence to calendar.
135 135
136 @return true on success, false on error. 136 @return true on success, false on error.
137 */ 137 */
138 virtual bool addIncidence( Incidence * ); 138 virtual bool addIncidence( Incidence * );
139 /** 139 /**
140 Return filtered list of all incidences of this calendar. 140 Return filtered list of all incidences of this calendar.
141 */ 141 */
142 virtual QPtrList<Incidence> incidences(); 142 virtual QPtrList<Incidence> incidences();
143 143
144 /** 144 /**
145 Return unfiltered list of all incidences of this calendar. 145 Return unfiltered list of all incidences of this calendar.
146 */ 146 */
147 virtual QPtrList<Incidence> rawIncidences(); 147 virtual QPtrList<Incidence> rawIncidences();
148 148
149 /** 149 /**
150 Adds a Event to this calendar object. 150 Adds a Event to this calendar object.
151 @param anEvent a pointer to the event to add 151 @param anEvent a pointer to the event to add
152 152
153 @return true on success, false on error. 153 @return true on success, false on error.
154 */ 154 */
155 virtual bool addEventNoDup( Event *event ) = 0; 155 virtual bool addEventNoDup( Event *event ) = 0;
156 virtual bool addAnniversaryNoDup( Event *event ) = 0; 156 virtual bool addAnniversaryNoDup( Event *event ) = 0;
157 virtual bool addEvent( Event *anEvent ) = 0; 157 virtual bool addEvent( Event *anEvent ) = 0;
158 /** 158 /**
159 Delete event from calendar. 159 Delete event from calendar.
160 */ 160 */
161 virtual void deleteEvent( Event * ) = 0; 161 virtual void deleteEvent( Event * ) = 0;
162 /** 162 /**
163 Retrieves an event on the basis of the unique string ID. 163 Retrieves an event on the basis of the unique string ID.
164 */ 164 */
165 virtual Event *event( const QString &UniqueStr ) = 0; 165 virtual Event *event( const QString &UniqueStr ) = 0;
166 virtual Event *event( QString, QString ) = 0; 166 virtual Event *event( QString, QString ) = 0;
167 /** 167 /**
168 Builds and then returns a list of all events that match for the 168 Builds and then returns a list of all events that match for the
169 date specified. useful for dayView, etc. etc. 169 date specified. useful for dayView, etc. etc.
170 The calendar filter is applied. 170 The calendar filter is applied.