summaryrefslogtreecommitdiffabout
path: root/libkcal/calendar.h
Unidiff
Diffstat (limited to 'libkcal/calendar.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 4b8b3ff..0a94914 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -18,128 +18,129 @@
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#include "calfilter.h"
36 36
37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */ 37//#define _TIME_ZONE "-0500" /* hardcoded, overridden in config file. */
38 38
39class KConfig; 39class KConfig;
40 40
41namespace KCal { 41namespace KCal {
42 42
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 Incidence * undoIncidence() { return mUndoIncidence; }; 68 Incidence * undoIncidence() { return mUndoIncidence; };
69 bool undoDeleteIncidence(); 69 bool undoDeleteIncidence();
70 void deleteIncidence(Incidence *in); 70 void deleteIncidence(Incidence *in);
71 void resetTempSyncStat(); 71 void resetTempSyncStat();
72 void resetPilotStat(int id); 72 void resetPilotStat(int id);
73 /** 73 /**
74 Clears out the current calendar, freeing all used memory etc. 74 Clears out the current calendar, freeing all used memory etc.
75 */ 75 */
76 virtual void close() = 0; 76 virtual void close() = 0;
77 virtual void addCalendar( Calendar* ) = 0; 77 virtual void addCalendar( Calendar* ) = 0;
78 virtual bool addCalendarFile( QString name, int id ) = 0; 78 virtual bool addCalendarFile( QString name, int id ) = 0;
79 virtual bool mergeCalendarFile( QString name ) = 0; 79 virtual bool mergeCalendarFile( QString name ) = 0;
80 virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates ) = 0; 80 virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates ) = 0;
81 virtual void setSyncEventsReadOnly() = 0; 81 virtual void setSyncEventsReadOnly() = 0;
82 virtual void setSyncEventsEnabled() = 0;
82 virtual void stopAllTodos() = 0; 83 virtual void stopAllTodos() = 0;
83 virtual void clearUndo( Incidence * newUndo ); 84 virtual void clearUndo( Incidence * newUndo );
84 85
85 /** 86 /**
86 Sync changes in memory to persistant storage. 87 Sync changes in memory to persistant storage.
87 */ 88 */
88 virtual void save() = 0; 89 virtual void save() = 0;
89 virtual QPtrList<Event> getExternLastSyncEvents() = 0; 90 virtual QPtrList<Event> getExternLastSyncEvents() = 0;
90 virtual void removeSyncInfo( QString syncProfile) = 0; 91 virtual void removeSyncInfo( QString syncProfile) = 0;
91 virtual bool isSaving() { return false; } 92 virtual bool isSaving() { return false; }
92 93
93 /** 94 /**
94 Return the owner of the calendar's full name. 95 Return the owner of the calendar's full name.
95 */ 96 */
96 const QString &getOwner() const; 97 const QString &getOwner() const;
97 /** 98 /**
98 Set the owner of the calendar. Should be owner's full name. 99 Set the owner of the calendar. Should be owner's full name.
99 */ 100 */
100 void setOwner( const QString &os ); 101 void setOwner( const QString &os );
101 /** 102 /**
102 Return the email address of the calendar owner. 103 Return the email address of the calendar owner.
103 */ 104 */
104 const QString &getEmail(); 105 const QString &getEmail();
105 /** 106 /**
106 Set the email address of the calendar owner. 107 Set the email address of the calendar owner.
107 */ 108 */
108 void setEmail( const QString & ); 109 void setEmail( const QString & );
109 110
110 /** 111 /**
111 Set time zone from a timezone string (e.g. -2:00) 112 Set time zone from a timezone string (e.g. -2:00)
112 */ 113 */
113 void setTimeZone( const QString &tz ); 114 void setTimeZone( const QString &tz );
114 /** 115 /**
115 Set time zone from a minutes value (e.g. -60) 116 Set time zone from a minutes value (e.g. -60)
116 */ 117 */
117 void setTimeZone( int tz ); 118 void setTimeZone( int tz );
118 /** 119 /**
119 Return time zone as offest in minutes. 120 Return time zone as offest in minutes.
120 */ 121 */
121 int getTimeZone() const; 122 int getTimeZone() const;
122 /** 123 /**
123 Compute an ISO 8601 format string from the time zone. 124 Compute an ISO 8601 format string from the time zone.
124 */ 125 */
125 QString getTimeZoneStr() const; 126 QString getTimeZoneStr() const;
126 /** 127 /**
127 Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal 128 Set time zone id (see /usr/share/zoneinfo/zone.tab for list of legal
128 values). 129 values).
129 */ 130 */
130 void setTimeZoneId( const QString & ); 131 void setTimeZoneId( const QString & );
131 /** 132 /**
132 Return time zone id. 133 Return time zone id.
133 */ 134 */
134 QString timeZoneId() const; 135 QString timeZoneId() const;
135 /** 136 /**
136 Use local time, not UTC or a time zone. 137 Use local time, not UTC or a time zone.
137 */ 138 */
138 void setLocalTime(); 139 void setLocalTime();
139 /** 140 /**
140 Return whether local time is being used. 141 Return whether local time is being used.
141 */ 142 */
142 bool isLocalTime() const; 143 bool isLocalTime() const;
143 144
144 /** 145 /**
145 Add an incidence to calendar. 146 Add an incidence to calendar.