summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.h
Unidiff
Diffstat (limited to 'korganizer/calendarview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index fac9a9e..16e671f 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -1,617 +1,617 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000, 2001 3 Copyright (c) 2000, 2001
4 Cornelius Schumacher <schumacher@kde.org> 4 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program 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 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef CALENDARVIEW_H 24#ifndef CALENDARVIEW_H
25#define CALENDARVIEW_H 25#define CALENDARVIEW_H
26 26
27#include <qframe.h> 27#include <qframe.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qwidget.h> 29#include <qwidget.h>
30#include <qptrlist.h> 30#include <qptrlist.h>
31#include <qvbox.h> 31#include <qvbox.h>
32#include <qmap.h> 32#include <qmap.h>
33#ifndef DESKTOP_VERSION 33#ifndef DESKTOP_VERSION
34#include <qtopia/ir.h> 34#include <qtopia/ir.h>
35#else 35#else
36#define Ir char 36#define Ir char
37#endif 37#endif
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/scheduler.h> 39#include <libkcal/scheduler.h>
40#include <libkcal/calendarresources.h> 40#include <libkcal/calendarresources.h>
41#include <libkcal/resourcecalendar.h> 41#include <libkcal/resourcecalendar.h>
42#include <KDGanttMinimizeSplitter.h> 42#include <KDGanttMinimizeSplitter.h>
43 43
44#include <korganizer/calendarviewbase.h> 44#include <korganizer/calendarviewbase.h>
45 45
46#include <ksyncmanager.h> 46#include <ksyncmanager.h>
47 47
48class QWidgetStack; 48class QWidgetStack;
49class QSplitter; 49class QSplitter;
50 50
51class CalPrinter; 51class CalPrinter;
52class KOFilterView; 52class KOFilterView;
53class KOViewManager; 53class KOViewManager;
54class KODialogManager; 54class KODialogManager;
55class KOTodoView; 55class KOTodoView;
56class KDateNavigator; 56class KDateNavigator;
57class DateNavigatorContainer; 57class DateNavigatorContainer;
58class DateNavigator; 58class DateNavigator;
59class KOIncidenceEditor; 59class KOIncidenceEditor;
60class KDatePicker; 60class KDatePicker;
61class ResourceView; 61class ResourceView;
62class KOEventEditor; 62class KOEventEditor;
63class KOTodoEditor ; 63class KOTodoEditor ;
64class KOEventViewerDialog; 64class KOEventViewerDialog;
65class KOBeamPrefs; 65class KOBeamPrefs;
66class KSyncProfile; 66class KSyncProfile;
67class AlarmDialog; 67class AlarmDialog;
68class KCal::Attendee; 68class KCal::Attendee;
69 69
70namespace KCal { class FileStorage; } 70namespace KCal { class FileStorage; }
71 71
72using namespace KCal; 72using namespace KCal;
73 73
74/** 74/**
75 This is the main calendar widget. It provides the different vies on t he 75 This is the main calendar widget. It provides the different vies on t he
76 calendar data as well as the date navigator. It also handles synchronisation 76 calendar data as well as the date navigator. It also handles synchronisation
77 of the different views and controls the different dialogs like preferences, 77 of the different views and controls the different dialogs like preferences,
78 event editor, search dialog etc. 78 event editor, search dialog etc.
79 79
80 @short main calendar view widget 80 @short main calendar view widget
81 @author Cornelius Schumacher 81 @author Cornelius Schumacher
82*/ 82*/
83class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 83class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
84{ 84{
85 Q_OBJECT 85 Q_OBJECT
86 public: 86 public:
87 /** 87 /**
88 Constructs a new calendar view widget. 88 Constructs a new calendar view widget.
89 89
90 @param calendar calendar document 90 @param calendar calendar document
91 @param parent parent window 91 @param parent parent window
92 @param name Qt internal widget object name 92 @param name Qt internal widget object name
93 */ 93 */
94 CalendarView( CalendarResources *calendar, QWidget *parent = 0, 94 CalendarView( CalendarResources *calendar, QWidget *parent = 0,
95 const char *name = 0 ); 95 const char *name = 0 );
96 CalendarView( Calendar *calendar, QWidget *parent = 0, 96 CalendarView( Calendar *calendar, QWidget *parent = 0,
97 const char *name = 0 ); 97 const char *name = 0 );
98 virtual ~CalendarView(); 98 virtual ~CalendarView();
99 99
100 Calendar *calendar() { return mCalendar; } 100 Calendar *calendar() { return mCalendar; }
101 101
102 KOViewManager *viewManager(); 102 KOViewManager *viewManager();
103 KODialogManager *dialogManager(); 103 KODialogManager *dialogManager();
104 104
105 QDate startDate(); 105 QDate startDate();
106 QDate endDate(); 106 QDate endDate();
107 107
108 QWidgetStack *viewStack(); 108 QWidgetStack *viewStack();
109 QWidget *leftFrame(); 109 QWidget *leftFrame();
110 110
111 DateNavigator *dateNavigator(); 111 DateNavigator *dateNavigator();
112 KDateNavigator *dateNavigatorWidget(); 112 KDateNavigator *dateNavigatorWidget();
113 113
114 void addView(KOrg::BaseView *); 114 void addView(KOrg::BaseView *);
115 void showView(KOrg::BaseView *); 115 void showView(KOrg::BaseView *);
116 KOEventViewerDialog* getEventViewerDialog(); 116 KOEventViewerDialog* getEventViewerDialog();
117 Incidence *currentSelection(); 117 Incidence *currentSelection();
118 118
119 signals: 119 signals:
120 void save (); 120 void save ();
121 void saveStopTimer (); 121 void saveStopTimer ();
122 void tempDisableBR(bool); 122 void tempDisableBR(bool);
123 /** This todo has been modified */ 123 /** This todo has been modified */
124 void todoModified(Todo *, int); 124 void todoModified(Todo *, int);
125 125
126 /** when change is made to options dialog, the topwidget will catch this 126 /** when change is made to options dialog, the topwidget will catch this
127 * and emit this signal which notifies all widgets which have registered 127 * and emit this signal which notifies all widgets which have registered
128 * for notification to update their settings. */ 128 * for notification to update their settings. */
129 void configChanged(); 129 void configChanged();
130 /** emitted when the topwidget is closing down, so that any attached 130 /** emitted when the topwidget is closing down, so that any attached
131 child windows can also close. */ 131 child windows can also close. */
132 void closingDown(); 132 void closingDown();
133 /** emitted right before we die */ 133 /** emitted right before we die */
134 void closed(QWidget *); 134 void closed(QWidget *);
135 135
136 /** Emitted when state of modified flag changes */ 136 /** Emitted when state of modified flag changes */
137 void modifiedChanged(bool); 137 void modifiedChanged(bool);
138 void signalmodified(); 138 void signalmodified();
139 139
140 /** Emitted when state of read-only flag changes */ 140 /** Emitted when state of read-only flag changes */
141 void readOnlyChanged(bool); 141 void readOnlyChanged(bool);
142 142
143 /** Emitted when the unit of navigation changes */ 143 /** Emitted when the unit of navigation changes */
144 void changeNavStringPrev(const QString &); 144 void changeNavStringPrev(const QString &);
145 void changeNavStringNext(const QString &); 145 void changeNavStringNext(const QString &);
146 146
147 /** Emitted when state of events selection has changed and user is organizer*/ 147 /** Emitted when state of events selection has changed and user is organizer*/
148 void organizerEventsSelected(bool); 148 void organizerEventsSelected(bool);
149 /** Emitted when state of events selection has changed and user is attendee*/ 149 /** Emitted when state of events selection has changed and user is attendee*/
150 void groupEventsSelected(bool); 150 void groupEventsSelected(bool);
151 /** 151 /**
152 Emitted when an incidence gets selected. If the selection is cleared the 152 Emitted when an incidence gets selected. If the selection is cleared the
153 signal is emitted with 0 as argument. 153 signal is emitted with 0 as argument.
154 */ 154 */
155 void incidenceSelected( Incidence * ); 155 void incidenceSelected( Incidence * );
156 /** Emitted, when a todoitem is selected or deselected. */ 156 /** Emitted, when a todoitem is selected or deselected. */
157 void todoSelected( bool ); 157 void todoSelected( bool );
158 158
159 /** 159 /**
160 Emitted, when clipboard content changes. Parameter indicates if paste 160 Emitted, when clipboard content changes. Parameter indicates if paste
161 is possible or not. 161 is possible or not.
162 */ 162 */
163 void pasteEnabled(bool); 163 void pasteEnabled(bool);
164 164
165 /** Emitted, when the number of incoming messages has changed. */ 165 /** Emitted, when the number of incoming messages has changed. */
166 void numIncomingChanged(int); 166 void numIncomingChanged(int);
167 167
168 /** Emitted, when the number of outgoing messages has changed. */ 168 /** Emitted, when the number of outgoing messages has changed. */
169 void numOutgoingChanged(int); 169 void numOutgoingChanged(int);
170 170
171 /** Send status message, which can e.g. be displayed in the status bar. */ 171 /** Send status message, which can e.g. be displayed in the status bar. */
172 void statusMessage(const QString &); 172 void statusMessage(const QString &);
173 173
174 void calendarViewExpanded( bool ); 174 void calendarViewExpanded( bool );
175 void updateSearchDialog(); 175 void updateSearchDialog();
176 176
177 177
178 public slots: 178 public slots:
179 void showOpenError(); 179 void showOpenError();
180 void watchSavedFile(); 180 void watchSavedFile();
181 void recheckTimerAlarm(); 181 void recheckTimerAlarm();
182 void checkNextTimerAlarm(); 182 void checkNextTimerAlarm();
183 void addAlarm(const QDateTime &qdt, const QString &noti ); 183 void addAlarm(const QDateTime &qdt, const QString &noti );
184 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 184 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
185 void removeAlarm(const QDateTime &qdt, const QString &noti ); 185 void removeAlarm(const QDateTime &qdt, const QString &noti );
186 186
187 /** options dialog made a changed to the configuration. we catch this 187 /** options dialog made a changed to the configuration. we catch this
188 * and notify all widgets which need to update their configuration. */ 188 * and notify all widgets which need to update their configuration. */
189 void updateConfig(); 189 void updateConfig();
190 190
191 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 191 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
192 const QStringList& anniversaryList, const QStringList& realNameList, 192 const QStringList& anniversaryList, const QStringList& realNameList,
193 const QStringList& emailList, const QStringList& assembledNameList, 193 const QStringList& emailList, const QStringList& assembledNameList,
194 const QStringList& uidList); 194 const QStringList& uidList);
195 195
196 /** 196 /**
197 Load calendar from file \a filename. If \a merge is true, load 197 Load calendar from file \a filename. If \a merge is true, load
198 calendar into existing one, if it is false, clear calendar, before 198 calendar into existing one, if it is false, clear calendar, before
199 loading. Return true, if calendar could be successfully loaded. 199 loading. Return true, if calendar could be successfully loaded.
200 */ 200 */
201 bool openCalendar(QString filename, bool merge=false); 201 bool openCalendar(QString filename, bool merge=false);
202 bool syncCalendar(QString filename,int mode = 0 ); 202 bool syncCalendar(QString filename,int mode = 0 );
203 203
204 /** 204 /**
205 Save calendar data to file. Return true if calendar could be 205 Save calendar data to file. Return true if calendar could be
206 successfully saved. 206 successfully saved.
207 */ 207 */
208 bool saveCalendar(QString filename); 208 bool saveCalendar(QString filename);
209 209
210 /** 210 /**
211 Close calendar. Clear calendar data and reset views to display an empty 211 Close calendar. Clear calendar data and reset views to display an empty
212 calendar. 212 calendar.
213 */ 213 */
214 void closeCalendar(); 214 void closeCalendar();
215 215
216 /** Archive old events of calendar */ 216 /** Archive old events of calendar */
217 void archiveCalendar(); 217 void archiveCalendar();
218 218
219 void showIncidence(); 219 void showIncidence();
220 void editIncidence(); 220 void editIncidence();
221 void editIncidenceDescription(); 221 void editIncidenceDescription();
222 void deleteIncidence(); 222 void deleteIncidence();
223 void cloneIncidence(); 223 void cloneIncidence();
224 void moveIncidence(); 224 void moveIncidence();
225 void beamIncidence(); 225 void beamIncidence();
226 void toggleCancelIncidence(); 226 void toggleCancelIncidence();
227 227
228 /** create an editeventwin with supplied date/time, and if bool is true, 228 /** create an editeventwin with supplied date/time, and if bool is true,
229 * make the event take all day. */ 229 * make the event take all day. */
230 void newEvent(QDateTime, QDateTime, bool allDay ); 230 void newEvent(QDateTime, QDateTime, bool allDay );
231 void newEvent(QDateTime, QDateTime); 231 void newEvent(QDateTime, QDateTime);
232 void newEvent(QDateTime fh); 232 void newEvent(QDateTime fh);
233 void newEvent(QDate dt); 233 void newEvent(QDate dt);
234 /** create new event without having a date hint. Takes current date as 234 /** create new event without having a date hint. Takes current date as
235 default hint. */ 235 default hint. */
236 void newEvent(); 236 void newEvent();
237 void newFloatingEvent(); 237 void newFloatingEvent();
238 238
239 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ 239 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/
240 void showIncidence(Incidence *); 240 void showIncidence(Incidence *);
241 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ 241 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/
242 void editIncidence(Incidence *); 242 void editIncidence(Incidence *);
243 /** Delete the supplied incidence. It calls the correct deleteXXX method*/ 243 /** Delete the supplied incidence. It calls the correct deleteXXX method*/
244 void deleteIncidence(Incidence *); 244 void deleteIncidence(Incidence *);
245 void cloneIncidence(Incidence *); 245 void cloneIncidence(Incidence *);
246 void cancelIncidence(Incidence *); 246 void cancelIncidence(Incidence *);
247 /** Create an editor for the supplied event. */ 247 /** Create an editor for the supplied event. */
248 void editEvent(Event *); 248 void editEvent(Event *);
249 /** Delete the supplied event. */ 249 /** Delete the supplied event. */
250 void deleteEvent(Event *); 250 void deleteEvent(Event *);
251 /** Delete the event with the given unique ID. Returns false, if event wasn't 251 /** Delete the event with the given unique ID. Returns false, if event wasn't
252 found. */ 252 found. */
253 bool deleteEvent(const QString &uid); 253 bool deleteEvent(const QString &uid);
254 /** Create a read-only viewer dialog for the supplied event. */ 254 /** Create a read-only viewer dialog for the supplied event. */
255 void showEvent(Event *); 255 void showEvent(Event *);
256 256
257 void editJournal(Journal *); 257 void editJournal(Journal *);
258 void showJournal(Journal *); 258 void showJournal(Journal *);
259 void deleteJournal(Journal *); 259 void deleteJournal(Journal *);
260 /** Create an editor dialog for a todo */ 260 /** Create an editor dialog for a todo */
261 void editTodo(Todo *); 261 void editTodo(Todo *);
262 /** Create a read-only viewer dialog for the supplied todo */ 262 /** Create a read-only viewer dialog for the supplied todo */
263 void showTodo(Todo *); 263 void showTodo(Todo *);
264 /** create new todo */ 264 /** create new todo */
265 void newTodo(); 265 void newTodo();
266 void newTodoDateTime(QDateTime, bool allday); 266 void newTodoDateTime(QDateTime, bool allday);
267 /** create new todo with a parent todo */ 267 /** create new todo with a parent todo */
268 void newSubTodo(); 268 void newSubTodo();
269 /** create new todo with a parent todo */ 269 /** create new todo with a parent todo */
270 void newSubTodo(Todo *); 270 void newSubTodo(Todo *);
271 /** Delete todo */ 271 /** Delete todo */
272 void deleteTodo(Todo *); 272 void deleteTodo(Todo *);
273 273
274 274
275 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is 275 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is
276 * emitted as result. */ 276 * emitted as result. */
277 void checkClipboard(); 277 void checkClipboard();
278 278
279 /** using the KConfig associated with the kapp variable, read in the 279 /** using the KConfig associated with the kapp variable, read in the
280 * settings from the config file. 280 * settings from the config file.
281 */ 281 */
282 void readSettings(); 282 void readSettings();
283 283
284 /** write current state to config file. */ 284 /** write current state to config file. */
285 void writeSettings(); 285 void writeSettings();
286 286
287 /** read settings for calendar filters */ 287 /** read settings for calendar filters */
288 void readFilterSettings(KConfig *config); 288 void readFilterSettings(KConfig *config);
289 289
290 /** write settings for calendar filters */ 290 /** write settings for calendar filters */
291 void writeFilterSettings(KConfig *config); 291 void writeFilterSettings(KConfig *config);
292 292
293 /** passes on the message that an event has changed to the currently 293 /** passes on the message that an event has changed to the currently
294 * activated view so that it can make appropriate display changes. */ 294 * activated view so that it can make appropriate display changes. */
295 void changeEventDisplay(Event *, int); 295 void changeEventDisplay(Event *, int);
296 void changeIncidenceDisplay(Incidence *, int); 296 void changeIncidenceDisplay(Incidence *, int);
297 void changeTodoDisplay(Todo *, int); 297 void changeTodoDisplay(Todo *, int);
298 298
299 void eventAdded(Event *); 299 void eventAdded(Event *);
300 void eventChanged(Event *); 300 void eventChanged(Event *);
301 void eventToBeDeleted(Event *); 301 void eventToBeDeleted(Event *);
302 void eventDeleted(); 302 void eventDeleted();
303 303
304 void todoAdded(Todo *); 304 void todoAdded(Todo *);
305 void todoChanged(Todo *); 305 void todoChanged(Todo *);
306 void todoToBeDeleted(Todo *); 306 void todoToBeDeleted(Todo *);
307 void todoDeleted(); 307 void todoDeleted();
308 308
309 void updateView(const QDate &start, const QDate &end); 309 void updateView(const QDate &start, const QDate &end);
310 void updateView(); 310 void updateView();
311 311
312 /** Full update of visible todo views */ 312 /** Full update of visible todo views */
313 void updateTodoViews(); 313 void updateTodoViews();
314 314
315 void updateUnmanagedViews(); 315 void updateUnmanagedViews();
316 316
317 /** cut the current appointment to the clipboard */ 317 /** cut the current appointment to the clipboard */
318 void edit_cut(); 318 void edit_cut();
319 319
320 /** copy the current appointment(s) to the clipboard */ 320 /** copy the current appointment(s) to the clipboard */
321 void edit_copy(); 321 void edit_copy();
322 322
323 /** paste the current vobject(s) in the clipboard buffer into calendar */ 323 /** paste the current vobject(s) in the clipboard buffer into calendar */
324 void edit_paste(); 324 void edit_paste();
325 325
326 /** edit viewing and configuration options. */ 326 /** edit viewing and configuration options. */
327 void edit_options(); 327 void edit_options();
328 /** 328 /**
329 Functions for printing, previewing a print, and setting up printing 329 Functions for printing, previewing a print, and setting up printing
330 parameters. 330 parameters.
331 */ 331 */
332 void print(); 332 void print();
333 void printSetup(); 333 void printSetup();
334 void printPreview(); 334 void printPreview();
335 335
336 /** Export as iCalendar file */ 336 /** Export as iCalendar file */
337 void exportICalendar(); 337 void exportICalendar();
338 338
339 /** Export as vCalendar file */ 339 /** Export as vCalendar file */
340 bool exportVCalendar( QString fn); 340 bool exportVCalendar( QString fn);
341 341
342 /** pop up a dialog to show an existing appointment. */ 342 /** pop up a dialog to show an existing appointment. */
343 void appointment_show(); 343 void appointment_show();
344 /** 344 /**
345 * pop up an Appointment Dialog to edit an existing appointment.Get 345 * pop up an Appointment Dialog to edit an existing appointment.Get
346 * information on the appointment from the list of unique IDs that is 346 * information on the appointment from the list of unique IDs that is
347 * currently in the View, called currIds. 347 * currently in the View, called currIds.
348 */ 348 */
349 void appointment_edit(); 349 void appointment_edit();
350 /** 350 /**
351 * pop up dialog confirming deletion of currently selected event in the 351 * pop up dialog confirming deletion of currently selected event in the
352 * View. 352 * View.
353 */ 353 */
354 void appointment_delete(); 354 void appointment_delete();
355 355
356 /** mails the currently selected event to a particular user as a vCalendar 356 /** mails the currently selected event to a particular user as a vCalendar
357 attachment. */ 357 attachment. */
358 void action_mail(); 358 void action_mail();
359 359
360 /* frees a subtodo from it's relation */ 360 /* frees a subtodo from it's relation */
361 void todo_unsub( Todo * ); 361 void todo_unsub( Todo * );
362 void todo_resub( Todo * parent, Todo * sub ); 362 void todo_resub( Todo * parent, Todo * sub );
363 363
364 /** Take ownership of selected event. */ 364 /** Take ownership of selected event. */
365 void takeOverEvent(); 365 void takeOverEvent();
366 366
367 /** Take ownership of all events in calendar. */ 367 /** Take ownership of all events in calendar. */
368 void takeOverCalendar(); 368 void takeOverCalendar();
369 369
370 /** query whether or not the calendar is "dirty". */ 370 /** query whether or not the calendar is "dirty". */
371 bool isModified(); 371 bool isModified();
372 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ 372 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */
373 void setModified(bool modified=true); 373 void setModified(bool modified=true);
374 374
375 /** query if the calendar is read-only. */ 375 /** query if the calendar is read-only. */
376 bool isReadOnly(); 376 bool isReadOnly();
377 /** set state of calendar to read-only */ 377 /** set state of calendar to read-only */
378 void setReadOnly(bool readOnly=true); 378 void setReadOnly(bool readOnly=true);
379 379
380 void eventUpdated(Incidence *); 380 void eventUpdated(Incidence *);
381 381
382 /* iTIP scheduling actions */ 382 /* iTIP scheduling actions */
383 void schedule_publish(Incidence *incidence = 0); 383 void schedule_publish(Incidence *incidence = 0);
384 void schedule_request(Incidence *incidence = 0); 384 void schedule_request(Incidence *incidence = 0);
385 void schedule_refresh(Incidence *incidence = 0); 385 void schedule_refresh(Incidence *incidence = 0);
386 void schedule_cancel(Incidence *incidence = 0); 386 void schedule_cancel(Incidence *incidence = 0);
387 void schedule_add(Incidence *incidence = 0); 387 void schedule_add(Incidence *incidence = 0);
388 void schedule_reply(Incidence *incidence = 0); 388 void schedule_reply(Incidence *incidence = 0);
389 void schedule_counter(Incidence *incidence = 0); 389 void schedule_counter(Incidence *incidence = 0);
390 void schedule_declinecounter(Incidence *incidence = 0); 390 void schedule_declinecounter(Incidence *incidence = 0);
391 void schedule_publish_freebusy(int daysToPublish = 30); 391 void schedule_publish_freebusy(int daysToPublish = 30);
392 392
393 void openAddressbook(); 393 void openAddressbook();
394 394
395 void editFilters(); 395 void editFilters();
396 void toggleFilerEnabled(); 396 void toggleFilerEnabled();
397 QPtrList<CalFilter> filters(); 397 QPtrList<CalFilter> filters();
398 void toggleFilter(); 398 void toggleFilter();
399 void showFilter(bool visible); 399 void showFilter(bool visible);
400 void updateFilter(); 400 void updateFilter();
401 void filterEdited(); 401 void filterEdited();
402 void selectFilter( int ); 402 void selectFilter( int );
403 KOFilterView *filterView(); 403 KOFilterView *filterView();
404 404
405 void showIntro(); 405 void showIntro();
406 406
407 /** Move the curdatepient view date to today */ 407 /** Move the curdatepient view date to today */
408 void goToday(); 408 void goToday();
409 409
410 /** Move to the next date(s) in the current view */ 410 /** Move to the next date(s) in the current view */
411 void goNext(); 411 void goNext();
412 412
413 /** Move to the previous date(s) in the current view */ 413 /** Move to the previous date(s) in the current view */
414 void goPrevious(); 414 void goPrevious();
415 /** Move to the next date(s) in the current view */ 415 /** Move to the next date(s) in the current view */
416 void goNextMonth(); 416 void goNextMonth();
417 417
418 /** Move to the previous date(s) in the current view */ 418 /** Move to the previous date(s) in the current view */
419 void goPreviousMonth(); 419 void goPreviousMonth();
420 420
421 void toggleExpand(); 421 void toggleExpand();
422 void toggleDateNavigatorWidget(); 422 void toggleDateNavigatorWidget();
423 void toggleAllDaySize(); 423 void toggleAllDaySize();
424 void dialogClosing(Incidence *); 424 void dialogClosing(Incidence *);
425 425
426 /** Look for new messages in the inbox */ 426 /** Look for new messages in the inbox */
427 void lookForIncomingMessages(); 427 void lookForIncomingMessages();
428 /** Look for new messages in the outbox */ 428 /** Look for new messages in the outbox */
429 void lookForOutgoingMessages(); 429 void lookForOutgoingMessages();
430 430
431 void processMainViewSelection( Incidence * ); 431 void processMainViewSelection( Incidence * );
432 void processTodoListSelection( Incidence * ); 432 void processTodoListSelection( Incidence * );
433 433
434 void processIncidenceSelection( Incidence * ); 434 void processIncidenceSelection( Incidence * );
435 435
436 void purgeCompleted(); 436 void purgeCompleted();
437 bool removeCompletedSubTodos( Todo* ); 437 bool removeCompletedSubTodos( Todo* );
438 void slotCalendarChanged(); 438 void slotCalendarChanged();
439 bool importBday(); 439 bool importBday();
440 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 440 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
441 bool importQtopia( const QString &categoriesFile, 441 bool importQtopia( const QString &categoriesFile,
442 const QString &datebookFile, 442 const QString &datebookFile,
443 const QString &tasklistFile ); 443 const QString &tasklistFile );
444 void syncExternal( int mode ); 444 void syncExternal( int mode );
445 void slotSelectPickerDate( QDate ) ; 445 void slotSelectPickerDate( QDate ) ;
446 void showDatePicker() ; 446 void showDatePicker() ;
447 void showDatePickerPopup() ; 447 void showDatePickerPopup() ;
448 void moveIncidence(Incidence *) ; 448 void moveIncidence(Incidence *) ;
449 void beamIncidence(Incidence *) ; 449 void beamIncidence(Incidence *) ;
450 void beamCalendar() ; 450 void beamCalendar() ;
451 void beamFilteredCalendar() ; 451 void beamFilteredCalendar() ;
452 void beamIncidenceList(QPtrList<Incidence>) ; 452 void beamIncidenceList(QPtrList<Incidence>) ;
453 void manageCategories(); 453 void manageCategories();
454 int addCategories(); 454 int addCategories();
455 void removeCategories(); 455 void removeCategories();
456 void setSyncDevice( QString ); 456 void setSyncDevice( QString );
457 void setSyncName( QString ); 457 void setSyncName( QString );
458 void showDay( QDate ); 458 void showDay( QDate );
459 void undo_delete(); 459 void undo_delete();
460 protected slots: 460 protected slots:
461 void resetFocus(); 461 void resetFocus();
462 void slotViewerClosed(); 462 void slotViewerClosed();
463 void timerAlarm(); 463 void timerAlarm();
464 void suspendAlarm(); 464 void suspendAlarm();
465 void beamDone( Ir *ir ); 465 void beamDone( Ir *ir );
466 /** Select a view or adapt the current view to display the specified dates. */ 466 /** Select a view or adapt the current view to display the specified dates. */
467 void showDates( const KCal::DateList & ); 467 void showDates( const KCal::DateList & );
468 void selectWeekNum ( int ); 468 void selectWeekNum ( int );
469 469
470 public: 470 public:
471 // show a standard warning 471 // show a standard warning
472 // returns KMsgBox::yesNoCancel() 472 // returns KMsgBox::yesNoCancel()
473 int msgCalModified(); 473 int msgCalModified();
474 virtual bool sync(KSyncManager* manager, QString filename, int mode); 474 virtual bool sync(KSyncManager* manager, QString filename, int mode);
475 475
476 virtual bool syncExternal(KSyncManager* manager, QString resource); 476 virtual bool syncExternal(KSyncManager* manager, QString resource);
477 virtual void removeSyncInfo( QString syncProfile); 477 virtual void removeSyncInfo( QString syncProfile);
478 void setSyncManager(KSyncManager* manager); 478 void setSyncManager(KSyncManager* manager);
479 void setLoadedFileVersion(QDateTime); 479 void setLoadedFileVersion(QDateTime);
480 bool checkFileVersion(QString fn); 480 bool checkFileVersion(QString fn);
481 bool checkFileChanged(QString fn); 481 bool checkFileChanged(QString fn);
482 Event* getLastSyncEvent(); 482 Event* getLastSyncEvent();
483 /** Adapt navigation units correpsonding to step size of navigation of the 483 /** Adapt navigation units correpsonding to step size of navigation of the
484 * current view. 484 * current view.
485 */ 485 */
486 void adaptNavigationUnits(); 486 void adaptNavigationUnits();
487 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 487 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
488 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 488 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
489 //Attendee* getYourAttendee(Event *event); 489 //Attendee* getYourAttendee(Event *event);
490 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 490 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
491 protected: 491 protected:
492 void schedule(Scheduler::Method, Incidence *incidence = 0); 492 void schedule(Scheduler::Method, Incidence *incidence = 0);
493 493
494 // returns KMsgBox::OKCandel() 494 // returns KMsgBox::OKCandel()
495 int msgItemDelete(const QString name); 495 int msgItemDelete(const QString name);
496 void showEventEditor(); 496 void showEventEditor();
497 void showTodoEditor(); 497 void showTodoEditor();
498 void writeLocale(); 498 void writeLocale();
499 Todo *selectedTodo(); 499 Todo *selectedTodo();
500 500
501 private: 501 private:
502 bool mViewerCallerIsSearchDialog; 502 bool mViewerCallerIsSearchDialog;
503 bool mBlockShowDates; 503 bool mBlockShowDates;
504 KSyncManager* mSyncManager; 504 KSyncManager* mSyncManager;
505 AlarmDialog * mAlarmDialog; 505 AlarmDialog * mAlarmDialog;
506 QString mAlarmNotification; 506 QString mAlarmNotification;
507 QString mSuspendAlarmNotification; 507 QString mSuspendAlarmNotification;
508 QTimer* mSuspendTimer; 508 QTimer* mSuspendTimer;
509 QTimer* mAlarmTimer; 509 QTimer* mAlarmTimer;
510 QTimer* mRecheckAlarmTimer; 510 QTimer* mRecheckAlarmTimer;
511 void computeAlarm( QString ); 511 void computeAlarm( QString );
512 void startAlarm( QString, QString ); 512 void startAlarm( QString, QString );
513 void setSyncEventsReadOnly(); 513 void setSyncEventsReadOnly();
514 514
515 QDateTime loadedFileVersion; 515 QDateTime loadedFileVersion;
516 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 516 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
517 void checkExternalId( Incidence * inc ); 517 void checkExternalId( Incidence * inc );
518 int mGlobalSyncMode; 518 int mGlobalSyncMode;
519 QString mCurrentSyncDevice; 519 QString mCurrentSyncDevice;
520 QString mCurrentSyncName; 520 QString mCurrentSyncName;
521 KOBeamPrefs* beamDialog; 521 KOBeamPrefs* beamDialog;
522 void init(); 522 void init();
523 int mDatePickerMode; 523 int mDatePickerMode;
524 bool mFlagEditDescription; 524 bool mFlagEditDescription;
525 QDateTime mLastCalendarSync; 525 QDateTime mLastCalendarSync;
526 void createPrinter(); 526 void createPrinter();
527 527
528 void calendarModified( bool, Calendar * ); 528 void calendarModified( bool, Calendar * );
529 529
530 CalPrinter *mCalPrinter; 530 CalPrinter *mCalPrinter;
531 531
532 QSplitter *mPanner; 532 QSplitter *mPanner;
533 QSplitter *mLeftSplitter; 533 QSplitter *mLeftSplitter;
534 KDGanttMinimizeSplitter *mLeftFrame; 534 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame;
535 QWidgetStack *mRightFrame; 535 QWidgetStack *mRightFrame;
536 536
537 KDatePicker* mDatePicker; 537 KDatePicker* mDatePicker;
538 QVBox* mDateFrame; 538 QVBox* mDateFrame;
539 539
540 DateNavigatorContainer *mDateNavigator; // widget showing small month view. 540 DateNavigatorContainer *mDateNavigator; // widget showing small month view.
541 541
542 KOFilterView *mFilterView; 542 KOFilterView *mFilterView;
543 543
544 ResourceView *mResourceView; 544 ResourceView *mResourceView;
545 545
546 // calendar object for this viewing instance 546 // calendar object for this viewing instance
547 Calendar *mCalendar; 547 Calendar *mCalendar;
548 548
549 CalendarResourceManager *mResourceManager; 549 CalendarResourceManager *mResourceManager;
550 550
551 FileStorage *mStorage; 551 FileStorage *mStorage;
552 552
553 DateNavigator *mNavigator; 553 DateNavigator *mNavigator;
554 554
555 KOViewManager *mViewManager; 555 KOViewManager *mViewManager;
556 KODialogManager *mDialogManager; 556 KODialogManager *mDialogManager;
557 557
558 // Calendar filters 558 // Calendar filters
559 QPtrList<CalFilter> mFilters; 559 QPtrList<CalFilter> mFilters;
560 560
561 // various housekeeping variables. 561 // various housekeeping variables.
562 bool mModified; // flag indicating if calendar is modified 562 bool mModified; // flag indicating if calendar is modified
563 bool mReadOnly; // flag indicating if calendar is read-only 563 bool mReadOnly; // flag indicating if calendar is read-only
564 QDate mSaveSingleDate; 564 QDate mSaveSingleDate;
565 565
566 Incidence *mSelectedIncidence; 566 Incidence *mSelectedIncidence;
567 Incidence *mMoveIncidence; 567 Incidence *mMoveIncidence;
568 QDate mMoveIncidenceOldDate; 568 QDate mMoveIncidenceOldDate;
569 KOTodoView *mTodoList; 569 KOTodoView *mTodoList;
570 KOEventEditor * mEventEditor; 570 KOEventEditor * mEventEditor;
571 KOTodoEditor * mTodoEditor; 571 KOTodoEditor * mTodoEditor;
572 KOEventViewerDialog * mEventViewerDialog; 572 KOEventViewerDialog * mEventViewerDialog;
573 void keyPressEvent ( QKeyEvent *e) ; 573 void keyPressEvent ( QKeyEvent *e) ;
574 //QMap<Incidence*,KOIncidenceEditor*> mDialogList; 574 //QMap<Incidence*,KOIncidenceEditor*> mDialogList;
575}; 575};
576 576
577 577
578class CalendarViewVisitor : public Incidence::Visitor 578class CalendarViewVisitor : public Incidence::Visitor
579{ 579{
580 public: 580 public:
581 CalendarViewVisitor() : mView( 0 ) {} 581 CalendarViewVisitor() : mView( 0 ) {}
582 582
583 bool act( Incidence *incidence, CalendarView *view ) 583 bool act( Incidence *incidence, CalendarView *view )
584 { 584 {
585 mView = view; 585 mView = view;
586 return incidence->accept( *this ); 586 return incidence->accept( *this );
587 } 587 }
588 588
589 protected: 589 protected:
590 CalendarView *mView; 590 CalendarView *mView;
591}; 591};
592 592
593class ShowIncidenceVisitor : public CalendarViewVisitor 593class ShowIncidenceVisitor : public CalendarViewVisitor
594{ 594{
595 protected: 595 protected:
596 bool visit( Event *event ) { mView->showEvent( event ); return true; } 596 bool visit( Event *event ) { mView->showEvent( event ); return true; }
597 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } 597 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; }
598 bool visit( Journal * j ) { mView->showJournal( j );return true; } 598 bool visit( Journal * j ) { mView->showJournal( j );return true; }
599}; 599};
600 600
601class EditIncidenceVisitor : public CalendarViewVisitor 601class EditIncidenceVisitor : public CalendarViewVisitor
602{ 602{
603 protected: 603 protected:
604 bool visit( Event *event ) { mView->editEvent( event ); return true; } 604 bool visit( Event *event ) { mView->editEvent( event ); return true; }
605 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } 605 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; }
606 bool visit( Journal *j ) { mView->editJournal( j); return true; } 606 bool visit( Journal *j ) { mView->editJournal( j); return true; }
607}; 607};
608 608
609class DeleteIncidenceVisitor : public CalendarViewVisitor 609class DeleteIncidenceVisitor : public CalendarViewVisitor
610{ 610{
611 protected: 611 protected:
612 bool visit( Event *event ) { mView->deleteEvent( event ); return true; } 612 bool visit( Event *event ) { mView->deleteEvent( event ); return true; }
613 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } 613 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; }
614 bool visit( Journal * j) {mView->deleteJournal( j ); return true; } 614 bool visit( Journal * j) {mView->deleteJournal( j ); return true; }
615}; 615};
616 616
617#endif 617#endif