summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.h
Unidiff
Diffstat (limited to 'korganizer/calendarview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index cd54685..a713c91 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -22,384 +22,388 @@
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 42
43#include <korganizer/calendarviewbase.h> 43#include <korganizer/calendarviewbase.h>
44 44
45class QWidgetStack; 45class QWidgetStack;
46class QSplitter; 46class QSplitter;
47 47
48class CalPrinter; 48class CalPrinter;
49class KOFilterView; 49class KOFilterView;
50class KOViewManager; 50class KOViewManager;
51class KODialogManager; 51class KODialogManager;
52class KOTodoView; 52class KOTodoView;
53class KDateNavigator; 53class KDateNavigator;
54class DateNavigator; 54class DateNavigator;
55class KOIncidenceEditor; 55class KOIncidenceEditor;
56class KDatePicker; 56class KDatePicker;
57class ResourceView; 57class ResourceView;
58class NavigatorBar; 58class NavigatorBar;
59class KOEventEditor; 59class KOEventEditor;
60class KOTodoEditor ; 60class KOTodoEditor ;
61class KOEventViewerDialog; 61class KOEventViewerDialog;
62class KOBeamPrefs; 62class KOBeamPrefs;
63class KSyncProfile; 63class KSyncProfile;
64class AlarmDialog; 64class AlarmDialog;
65class KCal::Attendee; 65class KCal::Attendee;
66 66
67namespace KCal { class FileStorage; } 67namespace KCal { class FileStorage; }
68 68
69using namespace KCal; 69using namespace KCal;
70 70
71/** 71/**
72 This is the main calendar widget. It provides the different vies on t he 72 This is the main calendar widget. It provides the different vies on t he
73 calendar data as well as the date navigator. It also handles synchronisation 73 calendar data as well as the date navigator. It also handles synchronisation
74 of the different views and controls the different dialogs like preferences, 74 of the different views and controls the different dialogs like preferences,
75 event editor, search dialog etc. 75 event editor, search dialog etc.
76 76
77 @short main calendar view widget 77 @short main calendar view widget
78 @author Cornelius Schumacher 78 @author Cornelius Schumacher
79*/ 79*/
80class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer 80class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer
81{ 81{
82 Q_OBJECT 82 Q_OBJECT
83 public: 83 public:
84 /** 84 /**
85 Constructs a new calendar view widget. 85 Constructs a new calendar view widget.
86 86
87 @param calendar calendar document 87 @param calendar calendar document
88 @param parent parent window 88 @param parent parent window
89 @param name Qt internal widget object name 89 @param name Qt internal widget object name
90 */ 90 */
91 CalendarView( CalendarResources *calendar, QWidget *parent = 0, 91 CalendarView( CalendarResources *calendar, QWidget *parent = 0,
92 const char *name = 0 ); 92 const char *name = 0 );
93 CalendarView( Calendar *calendar, QWidget *parent = 0, 93 CalendarView( Calendar *calendar, QWidget *parent = 0,
94 const char *name = 0 ); 94 const char *name = 0 );
95 virtual ~CalendarView(); 95 virtual ~CalendarView();
96 96
97 Calendar *calendar() { return mCalendar; } 97 Calendar *calendar() { return mCalendar; }
98 98
99 KOViewManager *viewManager(); 99 KOViewManager *viewManager();
100 KODialogManager *dialogManager(); 100 KODialogManager *dialogManager();
101 101
102 QDate startDate(); 102 QDate startDate();
103 QDate endDate(); 103 QDate endDate();
104 104
105 QWidgetStack *viewStack(); 105 QWidgetStack *viewStack();
106 QWidget *leftFrame(); 106 QWidget *leftFrame();
107 NavigatorBar *navigatorBar(); 107 NavigatorBar *navigatorBar();
108 108
109 DateNavigator *dateNavigator(); 109 DateNavigator *dateNavigator();
110 KDateNavigator *dateNavigatorWidget(); 110 KDateNavigator *dateNavigatorWidget();
111 111
112 void addView(KOrg::BaseView *); 112 void addView(KOrg::BaseView *);
113 void showView(KOrg::BaseView *); 113 void showView(KOrg::BaseView *);
114 KOEventViewerDialog* getEventViewerDialog(); 114 KOEventViewerDialog* getEventViewerDialog();
115 Incidence *currentSelection(); 115 Incidence *currentSelection();
116 void setupExternSyncProfiles(); 116 void setupExternSyncProfiles();
117 117
118 signals: 118 signals:
119 /** This todo has been modified */ 119 /** This todo has been modified */
120 void todoModified(Todo *, int); 120 void todoModified(Todo *, int);
121 121
122 /** when change is made to options dialog, the topwidget will catch this 122 /** when change is made to options dialog, the topwidget will catch this
123 * and emit this signal which notifies all widgets which have registered 123 * and emit this signal which notifies all widgets which have registered
124 * for notification to update their settings. */ 124 * for notification to update their settings. */
125 void configChanged(); 125 void configChanged();
126 /** emitted when the topwidget is closing down, so that any attached 126 /** emitted when the topwidget is closing down, so that any attached
127 child windows can also close. */ 127 child windows can also close. */
128 void closingDown(); 128 void closingDown();
129 /** emitted right before we die */ 129 /** emitted right before we die */
130 void closed(QWidget *); 130 void closed(QWidget *);
131 131
132 /** Emitted when state of modified flag changes */ 132 /** Emitted when state of modified flag changes */
133 void modifiedChanged(bool); 133 void modifiedChanged(bool);
134 void signalmodified(); 134 void signalmodified();
135 135
136 /** Emitted when state of read-only flag changes */ 136 /** Emitted when state of read-only flag changes */
137 void readOnlyChanged(bool); 137 void readOnlyChanged(bool);
138 138
139 /** Emitted when the unit of navigation changes */ 139 /** Emitted when the unit of navigation changes */
140 void changeNavStringPrev(const QString &); 140 void changeNavStringPrev(const QString &);
141 void changeNavStringNext(const QString &); 141 void changeNavStringNext(const QString &);
142 142
143 /** Emitted when state of events selection has changed and user is organizer*/ 143 /** Emitted when state of events selection has changed and user is organizer*/
144 void organizerEventsSelected(bool); 144 void organizerEventsSelected(bool);
145 /** Emitted when state of events selection has changed and user is attendee*/ 145 /** Emitted when state of events selection has changed and user is attendee*/
146 void groupEventsSelected(bool); 146 void groupEventsSelected(bool);
147 /** 147 /**
148 Emitted when an incidence gets selected. If the selection is cleared the 148 Emitted when an incidence gets selected. If the selection is cleared the
149 signal is emitted with 0 as argument. 149 signal is emitted with 0 as argument.
150 */ 150 */
151 void incidenceSelected( Incidence * ); 151 void incidenceSelected( Incidence * );
152 /** Emitted, when a todoitem is selected or deselected. */ 152 /** Emitted, when a todoitem is selected or deselected. */
153 void todoSelected( bool ); 153 void todoSelected( bool );
154 154
155 /** 155 /**
156 Emitted, when clipboard content changes. Parameter indicates if paste 156 Emitted, when clipboard content changes. Parameter indicates if paste
157 is possible or not. 157 is possible or not.
158 */ 158 */
159 void pasteEnabled(bool); 159 void pasteEnabled(bool);
160 160
161 /** Emitted, when the number of incoming messages has changed. */ 161 /** Emitted, when the number of incoming messages has changed. */
162 void numIncomingChanged(int); 162 void numIncomingChanged(int);
163 163
164 /** Emitted, when the number of outgoing messages has changed. */ 164 /** Emitted, when the number of outgoing messages has changed. */
165 void numOutgoingChanged(int); 165 void numOutgoingChanged(int);
166 166
167 /** Send status message, which can e.g. be displayed in the status bar. */ 167 /** Send status message, which can e.g. be displayed in the status bar. */
168 void statusMessage(const QString &); 168 void statusMessage(const QString &);
169 169
170 void calendarViewExpanded( bool ); 170 void calendarViewExpanded( bool );
171 void updateSearchDialog(); 171 void updateSearchDialog();
172 172
173 173
174 public slots: 174 public slots:
175 void showOpenError(); 175 void showOpenError();
176 void watchSavedFile(); 176 void watchSavedFile();
177 void recheckTimerAlarm(); 177 void recheckTimerAlarm();
178 void checkNextTimerAlarm(); 178 void checkNextTimerAlarm();
179 void addAlarm(const QDateTime &qdt, const QString &noti ); 179 void addAlarm(const QDateTime &qdt, const QString &noti );
180 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 180 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
181 void removeAlarm(const QDateTime &qdt, const QString &noti ); 181 void removeAlarm(const QDateTime &qdt, const QString &noti );
182 182
183 /** options dialog made a changed to the configuration. we catch this 183 /** options dialog made a changed to the configuration. we catch this
184 * and notify all widgets which need to update their configuration. */ 184 * and notify all widgets which need to update their configuration. */
185 void updateConfig(); 185 void updateConfig();
186 186
187 /** 187 /**
188 Load calendar from file \a filename. If \a merge is true, load 188 Load calendar from file \a filename. If \a merge is true, load
189 calendar into existing one, if it is false, clear calendar, before 189 calendar into existing one, if it is false, clear calendar, before
190 loading. Return true, if calendar could be successfully loaded. 190 loading. Return true, if calendar could be successfully loaded.
191 */ 191 */
192 bool openCalendar(QString filename, bool merge=false); 192 bool openCalendar(QString filename, bool merge=false);
193 bool syncCalendar(QString filename,int mode = 0 ); 193 bool syncCalendar(QString filename,int mode = 0 );
194 194
195 /** 195 /**
196 Save calendar data to file. Return true if calendar could be 196 Save calendar data to file. Return true if calendar could be
197 successfully saved. 197 successfully saved.
198 */ 198 */
199 bool saveCalendar(QString filename); 199 bool saveCalendar(QString filename);
200 200
201 /** 201 /**
202 Close calendar. Clear calendar data and reset views to display an empty 202 Close calendar. Clear calendar data and reset views to display an empty
203 calendar. 203 calendar.
204 */ 204 */
205 void closeCalendar(); 205 void closeCalendar();
206 206
207 /** Archive old events of calendar */ 207 /** Archive old events of calendar */
208 void archiveCalendar(); 208 void archiveCalendar();
209 209
210 void showIncidence(); 210 void showIncidence();
211 void editIncidence(); 211 void editIncidence();
212 void editIncidenceDescription(); 212 void editIncidenceDescription();
213 void deleteIncidence(); 213 void deleteIncidence();
214 void cloneIncidence();
215 void moveIncidence();
216 void beamIncidence();
217 void toggleCancelIncidence();
214 218
215 /** create an editeventwin with supplied date/time, and if bool is true, 219 /** create an editeventwin with supplied date/time, and if bool is true,
216 * make the event take all day. */ 220 * make the event take all day. */
217 void newEvent(QDateTime, QDateTime, bool allDay = false); 221 void newEvent(QDateTime, QDateTime, bool allDay = false);
218 void newEvent(QDateTime fh); 222 void newEvent(QDateTime fh);
219 void newEvent(QDate dt); 223 void newEvent(QDate dt);
220 /** create new event without having a date hint. Takes current date as 224 /** create new event without having a date hint. Takes current date as
221 default hint. */ 225 default hint. */
222 void newEvent(); 226 void newEvent();
223 void newFloatingEvent(); 227 void newFloatingEvent();
224 228
225 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ 229 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/
226 void showIncidence(Incidence *); 230 void showIncidence(Incidence *);
227 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ 231 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/
228 void editIncidence(Incidence *); 232 void editIncidence(Incidence *);
229 /** Delete the supplied incidence. It calls the correct deleteXXX method*/ 233 /** Delete the supplied incidence. It calls the correct deleteXXX method*/
230 void deleteIncidence(Incidence *); 234 void deleteIncidence(Incidence *);
231 void cloneIncidence(Incidence *); 235 void cloneIncidence(Incidence *);
232 void cancelIncidence(Incidence *); 236 void cancelIncidence(Incidence *);
233 /** Create an editor for the supplied event. */ 237 /** Create an editor for the supplied event. */
234 void editEvent(Event *); 238 void editEvent(Event *);
235 /** Delete the supplied event. */ 239 /** Delete the supplied event. */
236 void deleteEvent(Event *); 240 void deleteEvent(Event *);
237 /** Delete the event with the given unique ID. Returns false, if event wasn't 241 /** Delete the event with the given unique ID. Returns false, if event wasn't
238 found. */ 242 found. */
239 bool deleteEvent(const QString &uid); 243 bool deleteEvent(const QString &uid);
240 /** Create a read-only viewer dialog for the supplied event. */ 244 /** Create a read-only viewer dialog for the supplied event. */
241 void showEvent(Event *); 245 void showEvent(Event *);
242 246
243 void editJournal(Journal *); 247 void editJournal(Journal *);
244 void showJournal(Journal *); 248 void showJournal(Journal *);
245 void deleteJournal(Journal *); 249 void deleteJournal(Journal *);
246 /** Create an editor dialog for a todo */ 250 /** Create an editor dialog for a todo */
247 void editTodo(Todo *); 251 void editTodo(Todo *);
248 /** Create a read-only viewer dialog for the supplied todo */ 252 /** Create a read-only viewer dialog for the supplied todo */
249 void showTodo(Todo *); 253 void showTodo(Todo *);
250 /** create new todo */ 254 /** create new todo */
251 void newTodo(); 255 void newTodo();
252 /** create new todo with a parent todo */ 256 /** create new todo with a parent todo */
253 void newSubTodo(); 257 void newSubTodo();
254 /** create new todo with a parent todo */ 258 /** create new todo with a parent todo */
255 void newSubTodo(Todo *); 259 void newSubTodo(Todo *);
256 /** Delete todo */ 260 /** Delete todo */
257 void deleteTodo(Todo *); 261 void deleteTodo(Todo *);
258 262
259 263
260 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is 264 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is
261 * emitted as result. */ 265 * emitted as result. */
262 void checkClipboard(); 266 void checkClipboard();
263 267
264 /** using the KConfig associated with the kapp variable, read in the 268 /** using the KConfig associated with the kapp variable, read in the
265 * settings from the config file. 269 * settings from the config file.
266 */ 270 */
267 void readSettings(); 271 void readSettings();
268 272
269 /** write current state to config file. */ 273 /** write current state to config file. */
270 void writeSettings(); 274 void writeSettings();
271 275
272 /** read settings for calendar filters */ 276 /** read settings for calendar filters */
273 void readFilterSettings(KConfig *config); 277 void readFilterSettings(KConfig *config);
274 278
275 /** write settings for calendar filters */ 279 /** write settings for calendar filters */
276 void writeFilterSettings(KConfig *config); 280 void writeFilterSettings(KConfig *config);
277 281
278 /** passes on the message that an event has changed to the currently 282 /** passes on the message that an event has changed to the currently
279 * activated view so that it can make appropriate display changes. */ 283 * activated view so that it can make appropriate display changes. */
280 void changeEventDisplay(Event *, int); 284 void changeEventDisplay(Event *, int);
281 void changeIncidenceDisplay(Incidence *, int); 285 void changeIncidenceDisplay(Incidence *, int);
282 void changeTodoDisplay(Todo *, int); 286 void changeTodoDisplay(Todo *, int);
283 287
284 void eventAdded(Event *); 288 void eventAdded(Event *);
285 void eventChanged(Event *); 289 void eventChanged(Event *);
286 void eventToBeDeleted(Event *); 290 void eventToBeDeleted(Event *);
287 void eventDeleted(); 291 void eventDeleted();
288 292
289 void todoAdded(Todo *); 293 void todoAdded(Todo *);
290 void todoChanged(Todo *); 294 void todoChanged(Todo *);
291 void todoToBeDeleted(Todo *); 295 void todoToBeDeleted(Todo *);
292 void todoDeleted(); 296 void todoDeleted();
293 297
294 void updateView(const QDate &start, const QDate &end); 298 void updateView(const QDate &start, const QDate &end);
295 void updateView(); 299 void updateView();
296 300
297 /** Full update of visible todo views */ 301 /** Full update of visible todo views */
298 void updateTodoViews(); 302 void updateTodoViews();
299 303
300 void updateUnmanagedViews(); 304 void updateUnmanagedViews();
301 305
302 /** cut the current appointment to the clipboard */ 306 /** cut the current appointment to the clipboard */
303 void edit_cut(); 307 void edit_cut();
304 308
305 /** copy the current appointment(s) to the clipboard */ 309 /** copy the current appointment(s) to the clipboard */
306 void edit_copy(); 310 void edit_copy();
307 311
308 /** paste the current vobject(s) in the clipboard buffer into calendar */ 312 /** paste the current vobject(s) in the clipboard buffer into calendar */
309 void edit_paste(); 313 void edit_paste();
310 314
311 /** edit viewing and configuration options. */ 315 /** edit viewing and configuration options. */
312 void edit_options(); 316 void edit_options();
313 void edit_sync_options(); 317 void edit_sync_options();
314 /** 318 /**
315 Functions for printing, previewing a print, and setting up printing 319 Functions for printing, previewing a print, and setting up printing
316 parameters. 320 parameters.
317 */ 321 */
318 void print(); 322 void print();
319 void printSetup(); 323 void printSetup();
320 void printPreview(); 324 void printPreview();
321 325
322 /** Export as iCalendar file */ 326 /** Export as iCalendar file */
323 void exportICalendar(); 327 void exportICalendar();
324 328
325 /** Export as vCalendar file */ 329 /** Export as vCalendar file */
326 bool exportVCalendar( QString fn); 330 bool exportVCalendar( QString fn);
327 331
328 /** pop up a dialog to show an existing appointment. */ 332 /** pop up a dialog to show an existing appointment. */
329 void appointment_show(); 333 void appointment_show();
330 /** 334 /**
331 * pop up an Appointment Dialog to edit an existing appointment.Get 335 * pop up an Appointment Dialog to edit an existing appointment.Get
332 * information on the appointment from the list of unique IDs that is 336 * information on the appointment from the list of unique IDs that is
333 * currently in the View, called currIds. 337 * currently in the View, called currIds.
334 */ 338 */
335 void appointment_edit(); 339 void appointment_edit();
336 /** 340 /**
337 * pop up dialog confirming deletion of currently selected event in the 341 * pop up dialog confirming deletion of currently selected event in the
338 * View. 342 * View.
339 */ 343 */
340 void appointment_delete(); 344 void appointment_delete();
341 345
342 /** mails the currently selected event to a particular user as a vCalendar 346 /** mails the currently selected event to a particular user as a vCalendar
343 attachment. */ 347 attachment. */
344 void action_mail(); 348 void action_mail();
345 349
346 /* frees a subtodo from it's relation */ 350 /* frees a subtodo from it's relation */
347 void todo_unsub( Todo * ); 351 void todo_unsub( Todo * );
348 352
349 /** Take ownership of selected event. */ 353 /** Take ownership of selected event. */
350 void takeOverEvent(); 354 void takeOverEvent();
351 355
352 /** Take ownership of all events in calendar. */ 356 /** Take ownership of all events in calendar. */
353 void takeOverCalendar(); 357 void takeOverCalendar();
354 358
355 /** query whether or not the calendar is "dirty". */ 359 /** query whether or not the calendar is "dirty". */
356 bool isModified(); 360 bool isModified();
357 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ 361 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */
358 void setModified(bool modified=true); 362 void setModified(bool modified=true);
359 363
360 /** query if the calendar is read-only. */ 364 /** query if the calendar is read-only. */
361 bool isReadOnly(); 365 bool isReadOnly();
362 /** set state of calendar to read-only */ 366 /** set state of calendar to read-only */
363 void setReadOnly(bool readOnly=true); 367 void setReadOnly(bool readOnly=true);
364 368
365 void eventUpdated(Incidence *); 369 void eventUpdated(Incidence *);
366 370
367 /* iTIP scheduling actions */ 371 /* iTIP scheduling actions */
368 void schedule_publish(Incidence *incidence = 0); 372 void schedule_publish(Incidence *incidence = 0);
369 void schedule_request(Incidence *incidence = 0); 373 void schedule_request(Incidence *incidence = 0);
370 void schedule_refresh(Incidence *incidence = 0); 374 void schedule_refresh(Incidence *incidence = 0);
371 void schedule_cancel(Incidence *incidence = 0); 375 void schedule_cancel(Incidence *incidence = 0);
372 void schedule_add(Incidence *incidence = 0); 376 void schedule_add(Incidence *incidence = 0);
373 void schedule_reply(Incidence *incidence = 0); 377 void schedule_reply(Incidence *incidence = 0);
374 void schedule_counter(Incidence *incidence = 0); 378 void schedule_counter(Incidence *incidence = 0);
375 void schedule_declinecounter(Incidence *incidence = 0); 379 void schedule_declinecounter(Incidence *incidence = 0);
376 void schedule_publish_freebusy(int daysToPublish = 30); 380 void schedule_publish_freebusy(int daysToPublish = 30);
377 381
378 void openAddressbook(); 382 void openAddressbook();
379 383
380 void editFilters(); 384 void editFilters();
381 void toggleFilerEnabled(); 385 void toggleFilerEnabled();
382 QPtrList<CalFilter> filters(); 386 QPtrList<CalFilter> filters();
383 void toggleFilter(); 387 void toggleFilter();
384 void showFilter(bool visible); 388 void showFilter(bool visible);
385 void updateFilter(); 389 void updateFilter();
386 void filterEdited(); 390 void filterEdited();
387 void selectFilter( int ); 391 void selectFilter( int );
388 KOFilterView *filterView(); 392 KOFilterView *filterView();
389 393
390 void showIntro(); 394 void showIntro();
391 395
392 /** Move the curdatepient view date to today */ 396 /** Move the curdatepient view date to today */
393 void goToday(); 397 void goToday();
394 398
395 /** Move to the next date(s) in the current view */ 399 /** Move to the next date(s) in the current view */
396 void goNext(); 400 void goNext();
397 401
398 /** Move to the previous date(s) in the current view */ 402 /** Move to the previous date(s) in the current view */
399 void goPrevious(); 403 void goPrevious();
400 /** Move to the next date(s) in the current view */ 404 /** Move to the next date(s) in the current view */
401 void goNextMonth(); 405 void goNextMonth();
402 406
403 /** Move to the previous date(s) in the current view */ 407 /** Move to the previous date(s) in the current view */
404 void goPreviousMonth(); 408 void goPreviousMonth();
405 409