-rw-r--r-- | korganizer/calendarview.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 60b1276..b4eada7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -1,226 +1,228 @@ | |||
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 <q3frame.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #include <qptrlist.h> | 30 | #include <q3ptrlist.h> |
31 | #include <qvbox.h> | 31 | #include <q3vbox.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #include <qscrollbar.h> | 33 | #include <qscrollbar.h> |
34 | //Added by qt3to4: | ||
35 | #include <QKeyEvent> | ||
34 | #ifndef DESKTOP_VERSION | 36 | #ifndef DESKTOP_VERSION |
35 | #include <qtopia/ir.h> | 37 | #include <qtopia/ir.h> |
36 | #else | 38 | #else |
37 | #define Ir char | 39 | #define Ir char |
38 | #endif | 40 | #endif |
39 | #include <libkcal/calendar.h> | 41 | #include <libkcal/calendar.h> |
40 | #include <libkcal/scheduler.h> | 42 | #include <libkcal/scheduler.h> |
41 | #include <libkcal/calendarresources.h> | 43 | #include <libkcal/calendarresources.h> |
42 | #include <libkcal/resourcecalendar.h> | 44 | #include <libkcal/resourcecalendar.h> |
43 | #include <KDGanttMinimizeSplitter.h> | 45 | #include <KDGanttMinimizeSplitter.h> |
44 | 46 | ||
45 | #include <korganizer/calendarviewbase.h> | 47 | #include <korganizer/calendarviewbase.h> |
46 | 48 | ||
47 | #include <ksyncmanager.h> | 49 | #include <ksyncmanager.h> |
48 | //#include <koprefs.h> | 50 | //#include <koprefs.h> |
49 | 51 | ||
50 | class QWidgetStack; | 52 | class Q3WidgetStack; |
51 | class QSplitter; | 53 | class QSplitter; |
52 | class KopiCalendarFile; | 54 | class KopiCalendarFile; |
53 | class CalPrinter; | 55 | class CalPrinter; |
54 | class KOFilterView; | 56 | class KOFilterView; |
55 | class KOCalEditView; | 57 | class KOCalEditView; |
56 | class KOViewManager; | 58 | class KOViewManager; |
57 | class KODialogManager; | 59 | class KODialogManager; |
58 | class KOTodoView; | 60 | class KOTodoView; |
59 | class KDateNavigator; | 61 | class KDateNavigator; |
60 | class DateNavigatorContainer; | 62 | class DateNavigatorContainer; |
61 | class DateNavigator; | 63 | class DateNavigator; |
62 | class KOIncidenceEditor; | 64 | class KOIncidenceEditor; |
63 | class KDatePicker; | 65 | class KDatePicker; |
64 | class ResourceView; | 66 | class ResourceView; |
65 | class KOEventEditor; | 67 | class KOEventEditor; |
66 | class KOTodoEditor ; | 68 | class KOTodoEditor ; |
67 | class KOEventViewerDialog; | 69 | class KOEventViewerDialog; |
68 | class KOBeamPrefs; | 70 | class KOBeamPrefs; |
69 | class KSyncProfile; | 71 | class KSyncProfile; |
70 | class AlarmDialog; | 72 | class AlarmDialog; |
71 | class KCal::Attendee; | 73 | class KCal::Attendee; |
72 | 74 | ||
73 | namespace KCal { class FileStorage; } | 75 | namespace KCal { class FileStorage; } |
74 | 76 | ||
75 | using namespace KCal; | 77 | using namespace KCal; |
76 | 78 | ||
77 | /** | 79 | /** |
78 | This is the main calendar widget. It provides the different vies on t he | 80 | This is the main calendar widget. It provides the different vies on t he |
79 | calendar data as well as the date navigator. It also handles synchronisation | 81 | calendar data as well as the date navigator. It also handles synchronisation |
80 | of the different views and controls the different dialogs like preferences, | 82 | of the different views and controls the different dialogs like preferences, |
81 | event editor, search dialog etc. | 83 | event editor, search dialog etc. |
82 | 84 | ||
83 | @short main calendar view widget | 85 | @short main calendar view widget |
84 | @author Cornelius Schumacher | 86 | @author Cornelius Schumacher |
85 | */ | 87 | */ |
86 | 88 | ||
87 | #include <qtextbrowser.h> | 89 | #include <q3textbrowser.h> |
88 | #include <qtextcodec.h> | 90 | #include <qtextcodec.h> |
89 | 91 | ||
90 | class MissedAlarmTextBrowser : public QTextBrowser { | 92 | class MissedAlarmTextBrowser : public Q3TextBrowser { |
91 | Q_OBJECT | 93 | Q_OBJECT |
92 | public: | 94 | public: |
93 | MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); | 95 | MissedAlarmTextBrowser(QWidget *parent, Q3PtrList<Incidence> alarms ,QDateTime start); |
94 | ~MissedAlarmTextBrowser(); | 96 | ~MissedAlarmTextBrowser(); |
95 | void setSource(const QString & n); | 97 | void setSource(const QString & n); |
96 | 98 | ||
97 | private: | 99 | private: |
98 | Incidence * getNextInc(QDateTime start ); | 100 | Incidence * getNextInc(QDateTime start ); |
99 | QPtrList<Incidence> mAlarms; | 101 | Q3PtrList<Incidence> mAlarms; |
100 | signals: | 102 | signals: |
101 | void showIncidence( QString uid); | 103 | void showIncidence( QString uid); |
102 | }; | 104 | }; |
103 | 105 | ||
104 | 106 | ||
105 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 107 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
106 | { | 108 | { |
107 | Q_OBJECT | 109 | Q_OBJECT |
108 | public: | 110 | public: |
109 | /** | 111 | /** |
110 | Constructs a new calendar view widget. | 112 | Constructs a new calendar view widget. |
111 | 113 | ||
112 | @param calendar calendar document | 114 | @param calendar calendar document |
113 | @param parent parent window | 115 | @param parent parent window |
114 | @param name Qt internal widget object name | 116 | @param name Qt internal widget object name |
115 | */ | 117 | */ |
116 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 118 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
117 | const char *name = 0 ); | 119 | const char *name = 0 ); |
118 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 120 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
119 | const char *name = 0 ); | 121 | const char *name = 0 ); |
120 | virtual ~CalendarView(); | 122 | virtual ~CalendarView(); |
121 | 123 | ||
122 | Calendar *calendar() { return mCalendar; } | 124 | Calendar *calendar() { return mCalendar; } |
123 | 125 | ||
124 | KOViewManager *viewManager(); | 126 | KOViewManager *viewManager(); |
125 | KODialogManager *dialogManager(); | 127 | KODialogManager *dialogManager(); |
126 | 128 | ||
127 | QDate startDate(); | 129 | QDate startDate(); |
128 | QDate endDate(); | 130 | QDate endDate(); |
129 | 131 | ||
130 | QWidgetStack *viewStack(); | 132 | Q3WidgetStack *viewStack(); |
131 | QWidget *leftFrame(); | 133 | QWidget *leftFrame(); |
132 | 134 | ||
133 | DateNavigator *dateNavigator(); | 135 | DateNavigator *dateNavigator(); |
134 | KDateNavigator *dateNavigatorWidget(); | 136 | KDateNavigator *dateNavigatorWidget(); |
135 | 137 | ||
136 | void addView(KOrg::BaseView *); | 138 | void addView(KOrg::BaseView *); |
137 | void showView(KOrg::BaseView *); | 139 | void showView(KOrg::BaseView *); |
138 | KOEventViewerDialog* getEventViewerDialog(); | 140 | KOEventViewerDialog* getEventViewerDialog(); |
139 | Incidence *currentSelection(); | 141 | Incidence *currentSelection(); |
140 | void checkSuspendAlarm(); | 142 | void checkSuspendAlarm(); |
141 | void mergeFile( QString fn ); | 143 | void mergeFile( QString fn ); |
142 | void mergeFileResource( QString fn ,QString res); | 144 | void mergeFileResource( QString fn ,QString res); |
143 | 145 | ||
144 | signals: | 146 | signals: |
145 | void save (); | 147 | void save (); |
146 | void saveStopTimer (); | 148 | void saveStopTimer (); |
147 | void tempDisableBR(bool); | 149 | void tempDisableBR(bool); |
148 | /** This todo has been modified */ | 150 | /** This todo has been modified */ |
149 | void todoModified(Todo *, int); | 151 | void todoModified(Todo *, int); |
150 | 152 | ||
151 | /** when change is made to options dialog, the topwidget will catch this | 153 | /** when change is made to options dialog, the topwidget will catch this |
152 | * and emit this signal which notifies all widgets which have registered | 154 | * and emit this signal which notifies all widgets which have registered |
153 | * for notification to update their settings. */ | 155 | * for notification to update their settings. */ |
154 | void configChanged(); | 156 | void configChanged(); |
155 | /** emitted when the topwidget is closing down, so that any attached | 157 | /** emitted when the topwidget is closing down, so that any attached |
156 | child windows can also close. */ | 158 | child windows can also close. */ |
157 | void closingDown(); | 159 | void closingDown(); |
158 | /** emitted right before we die */ | 160 | /** emitted right before we die */ |
159 | void closed(QWidget *); | 161 | void closed(QWidget *); |
160 | 162 | ||
161 | /** Emitted when state of modified flag changes */ | 163 | /** Emitted when state of modified flag changes */ |
162 | void modifiedChanged(bool); | 164 | void modifiedChanged(bool); |
163 | void signalmodified(); | 165 | void signalmodified(); |
164 | 166 | ||
165 | /** Emitted when state of read-only flag changes */ | 167 | /** Emitted when state of read-only flag changes */ |
166 | void readOnlyChanged(bool); | 168 | void readOnlyChanged(bool); |
167 | 169 | ||
168 | /** Emitted when the unit of navigation changes */ | 170 | /** Emitted when the unit of navigation changes */ |
169 | void changeNavStringPrev(const QString &); | 171 | void changeNavStringPrev(const QString &); |
170 | void changeNavStringNext(const QString &); | 172 | void changeNavStringNext(const QString &); |
171 | 173 | ||
172 | /** Emitted when state of events selection has changed and user is organizer*/ | 174 | /** Emitted when state of events selection has changed and user is organizer*/ |
173 | void organizerEventsSelected(bool); | 175 | void organizerEventsSelected(bool); |
174 | /** Emitted when state of events selection has changed and user is attendee*/ | 176 | /** Emitted when state of events selection has changed and user is attendee*/ |
175 | void groupEventsSelected(bool); | 177 | void groupEventsSelected(bool); |
176 | /** | 178 | /** |
177 | Emitted when an incidence gets selected. If the selection is cleared the | 179 | Emitted when an incidence gets selected. If the selection is cleared the |
178 | signal is emitted with 0 as argument. | 180 | signal is emitted with 0 as argument. |
179 | */ | 181 | */ |
180 | void incidenceSelected( Incidence * ); | 182 | void incidenceSelected( Incidence * ); |
181 | /** Emitted, when a todoitem is selected or deselected. */ | 183 | /** Emitted, when a todoitem is selected or deselected. */ |
182 | void todoSelected( bool ); | 184 | void todoSelected( bool ); |
183 | 185 | ||
184 | /** | 186 | /** |
185 | Emitted, when clipboard content changes. Parameter indicates if paste | 187 | Emitted, when clipboard content changes. Parameter indicates if paste |
186 | is possible or not. | 188 | is possible or not. |
187 | */ | 189 | */ |
188 | void pasteEnabled(bool); | 190 | void pasteEnabled(bool); |
189 | 191 | ||
190 | /** Emitted, when the number of incoming messages has changed. */ | 192 | /** Emitted, when the number of incoming messages has changed. */ |
191 | void numIncomingChanged(int); | 193 | void numIncomingChanged(int); |
192 | 194 | ||
193 | /** Emitted, when the number of outgoing messages has changed. */ | 195 | /** Emitted, when the number of outgoing messages has changed. */ |
194 | void numOutgoingChanged(int); | 196 | void numOutgoingChanged(int); |
195 | 197 | ||
196 | /** Send status message, which can e.g. be displayed in the status bar. */ | 198 | /** Send status message, which can e.g. be displayed in the status bar. */ |
197 | void statusMessage(const QString &); | 199 | void statusMessage(const QString &); |
198 | 200 | ||
199 | void calendarViewExpanded( bool ); | 201 | void calendarViewExpanded( bool ); |
200 | void updateSearchDialog(); | 202 | void updateSearchDialog(); |
201 | void filtersUpdated(); | 203 | void filtersUpdated(); |
202 | 204 | ||
203 | 205 | ||
204 | public slots: | 206 | public slots: |
205 | void multiResourceSyncStart( bool ); | 207 | void multiResourceSyncStart( bool ); |
206 | void displayCalendarInfo( int id ); | 208 | void displayCalendarInfo( int id ); |
207 | void nextConflict( bool all, bool allday ); | 209 | void nextConflict( bool all, bool allday ); |
208 | void conflictAll(); | 210 | void conflictAll(); |
209 | void conflictAllday(); | 211 | void conflictAllday(); |
210 | void conflictNotAll(); | 212 | void conflictNotAll(); |
211 | void setCalReadOnly( int id, bool readO ); | 213 | void setCalReadOnly( int id, bool readO ); |
212 | void checkAlarms(); | 214 | void checkAlarms(); |
213 | void checkFiles(); | 215 | void checkFiles(); |
214 | void slotprintSelInc(); | 216 | void slotprintSelInc(); |
215 | void showNextAlarms(); | 217 | void showNextAlarms(); |
216 | void showOpenError(); | 218 | void showOpenError(); |
217 | void watchSavedFile(); | 219 | void watchSavedFile(); |
218 | void recheckTimerAlarm(); | 220 | void recheckTimerAlarm(); |
219 | void checkNextTimerAlarm(); | 221 | void checkNextTimerAlarm(); |
220 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 222 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
221 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 223 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
222 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 224 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
223 | 225 | ||
224 | /** options dialog made a changed to the configuration. we catch this | 226 | /** options dialog made a changed to the configuration. we catch this |
225 | * and notify all widgets which need to update their configuration. */ | 227 | * and notify all widgets which need to update their configuration. */ |
226 | void updateConfig(); | 228 | void updateConfig(); |
@@ -348,332 +350,332 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
348 | void todoAdded(Todo *); | 350 | void todoAdded(Todo *); |
349 | void todoChanged(Todo *); | 351 | void todoChanged(Todo *); |
350 | void todoToBeDeleted(Todo *); | 352 | void todoToBeDeleted(Todo *); |
351 | void todoDeleted(); | 353 | void todoDeleted(); |
352 | 354 | ||
353 | void updateView(const QDate &start, const QDate &end); | 355 | void updateView(const QDate &start, const QDate &end); |
354 | void updateView(); | 356 | void updateView(); |
355 | void clearAllViews(); | 357 | void clearAllViews(); |
356 | 358 | ||
357 | /** Full update of visible todo views */ | 359 | /** Full update of visible todo views */ |
358 | void updateTodoViews(); | 360 | void updateTodoViews(); |
359 | 361 | ||
360 | void updateUnmanagedViews(); | 362 | void updateUnmanagedViews(); |
361 | 363 | ||
362 | /** cut the current appointment to the clipboard */ | 364 | /** cut the current appointment to the clipboard */ |
363 | void edit_cut(); | 365 | void edit_cut(); |
364 | 366 | ||
365 | /** copy the current appointment(s) to the clipboard */ | 367 | /** copy the current appointment(s) to the clipboard */ |
366 | void edit_copy(); | 368 | void edit_copy(); |
367 | 369 | ||
368 | /** paste the current vobject(s) in the clipboard buffer into calendar */ | 370 | /** paste the current vobject(s) in the clipboard buffer into calendar */ |
369 | void edit_paste(); | 371 | void edit_paste(); |
370 | 372 | ||
371 | /** edit viewing and configuration options. */ | 373 | /** edit viewing and configuration options. */ |
372 | void edit_options(); | 374 | void edit_options(); |
373 | void edit_global_options(); | 375 | void edit_global_options(); |
374 | /** | 376 | /** |
375 | Functions for printing, previewing a print, and setting up printing | 377 | Functions for printing, previewing a print, and setting up printing |
376 | parameters. | 378 | parameters. |
377 | */ | 379 | */ |
378 | void print(); | 380 | void print(); |
379 | void printSetup(); | 381 | void printSetup(); |
380 | void printPreview(); | 382 | void printPreview(); |
381 | 383 | ||
382 | /** Export as iCalendar file */ | 384 | /** Export as iCalendar file */ |
383 | bool exportICalendar(); | 385 | bool exportICalendar(); |
384 | bool exportICalendar( QString fn ); | 386 | bool exportICalendar( QString fn ); |
385 | 387 | ||
386 | /** Export as vCalendar file */ | 388 | /** Export as vCalendar file */ |
387 | bool exportVCalendar( QString fn); | 389 | bool exportVCalendar( QString fn); |
388 | 390 | ||
389 | /** pop up a dialog to show an existing appointment. */ | 391 | /** pop up a dialog to show an existing appointment. */ |
390 | void appointment_show(); | 392 | void appointment_show(); |
391 | /** | 393 | /** |
392 | * pop up an Appointment Dialog to edit an existing appointment.Get | 394 | * pop up an Appointment Dialog to edit an existing appointment.Get |
393 | * information on the appointment from the list of unique IDs that is | 395 | * information on the appointment from the list of unique IDs that is |
394 | * currently in the View, called currIds. | 396 | * currently in the View, called currIds. |
395 | */ | 397 | */ |
396 | void appointment_edit(); | 398 | void appointment_edit(); |
397 | /** | 399 | /** |
398 | * pop up dialog confirming deletion of currently selected event in the | 400 | * pop up dialog confirming deletion of currently selected event in the |
399 | * View. | 401 | * View. |
400 | */ | 402 | */ |
401 | void appointment_delete(); | 403 | void appointment_delete(); |
402 | 404 | ||
403 | /** mails the currently selected event to a particular user as a vCalendar | 405 | /** mails the currently selected event to a particular user as a vCalendar |
404 | attachment. */ | 406 | attachment. */ |
405 | void action_mail(); | 407 | void action_mail(); |
406 | 408 | ||
407 | /* frees a subtodo from it's relation */ | 409 | /* frees a subtodo from it's relation */ |
408 | void todo_unsub( Todo * ); | 410 | void todo_unsub( Todo * ); |
409 | void todo_resub( Todo * parent, Todo * sub ); | 411 | void todo_resub( Todo * parent, Todo * sub ); |
410 | 412 | ||
411 | /** Take ownership of selected event. */ | 413 | /** Take ownership of selected event. */ |
412 | void takeOverEvent(); | 414 | void takeOverEvent(); |
413 | 415 | ||
414 | /** Take ownership of all events in calendar. */ | 416 | /** Take ownership of all events in calendar. */ |
415 | void takeOverCalendar(); | 417 | void takeOverCalendar(); |
416 | 418 | ||
417 | /** query whether or not the calendar is "dirty". */ | 419 | /** query whether or not the calendar is "dirty". */ |
418 | bool isModified(); | 420 | bool isModified(); |
419 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ | 421 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ |
420 | void setModified(bool modified=true); | 422 | void setModified(bool modified=true); |
421 | 423 | ||
422 | /** query if the calendar is read-only. */ | 424 | /** query if the calendar is read-only. */ |
423 | bool isReadOnly(); | 425 | bool isReadOnly(); |
424 | /** set state of calendar to read-only */ | 426 | /** set state of calendar to read-only */ |
425 | void setReadOnly(bool readOnly=true); | 427 | void setReadOnly(bool readOnly=true); |
426 | 428 | ||
427 | void eventUpdated(Incidence *); | 429 | void eventUpdated(Incidence *); |
428 | 430 | ||
429 | /* iTIP scheduling actions */ | 431 | /* iTIP scheduling actions */ |
430 | void schedule_publish(Incidence *incidence = 0); | 432 | void schedule_publish(Incidence *incidence = 0); |
431 | void schedule_request(Incidence *incidence = 0); | 433 | void schedule_request(Incidence *incidence = 0); |
432 | void schedule_refresh(Incidence *incidence = 0); | 434 | void schedule_refresh(Incidence *incidence = 0); |
433 | void schedule_cancel(Incidence *incidence = 0); | 435 | void schedule_cancel(Incidence *incidence = 0); |
434 | void schedule_add(Incidence *incidence = 0); | 436 | void schedule_add(Incidence *incidence = 0); |
435 | void schedule_reply(Incidence *incidence = 0); | 437 | void schedule_reply(Incidence *incidence = 0); |
436 | void schedule_counter(Incidence *incidence = 0); | 438 | void schedule_counter(Incidence *incidence = 0); |
437 | void schedule_declinecounter(Incidence *incidence = 0); | 439 | void schedule_declinecounter(Incidence *incidence = 0); |
438 | void schedule_publish_freebusy(int daysToPublish = 30); | 440 | void schedule_publish_freebusy(int daysToPublish = 30); |
439 | 441 | ||
440 | void openAddressbook(); | 442 | void openAddressbook(); |
441 | 443 | ||
442 | void editFilters(); | 444 | void editFilters(); |
443 | void toggleFilerEnabled(); | 445 | void toggleFilerEnabled(); |
444 | QPtrList<CalFilter> filters(); | 446 | Q3PtrList<CalFilter> filters(); |
445 | void toggleFilter(); | 447 | void toggleFilter(); |
446 | void showFilter(bool visible); | 448 | void showFilter(bool visible); |
447 | void updateFilter(); | 449 | void updateFilter(); |
448 | void filterEdited(); | 450 | void filterEdited(); |
449 | void selectFilter( int ); | 451 | void selectFilter( int ); |
450 | KOFilterView *filterView(); | 452 | KOFilterView *filterView(); |
451 | 453 | ||
452 | void showIntro(); | 454 | void showIntro(); |
453 | 455 | ||
454 | /** Move the curdatepient view date to today */ | 456 | /** Move the curdatepient view date to today */ |
455 | void goToday(); | 457 | void goToday(); |
456 | 458 | ||
457 | /** Move to the next date(s) in the current view */ | 459 | /** Move to the next date(s) in the current view */ |
458 | void goNext(); | 460 | void goNext(); |
459 | 461 | ||
460 | /** Move to the previous date(s) in the current view */ | 462 | /** Move to the previous date(s) in the current view */ |
461 | void goPrevious(); | 463 | void goPrevious(); |
462 | /** Move to the next date(s) in the current view */ | 464 | /** Move to the next date(s) in the current view */ |
463 | void goNextMonth(); | 465 | void goNextMonth(); |
464 | 466 | ||
465 | /** Move to the previous date(s) in the current view */ | 467 | /** Move to the previous date(s) in the current view */ |
466 | void goPreviousMonth(); | 468 | void goPreviousMonth(); |
467 | 469 | ||
468 | void toggleExpand(); | 470 | void toggleExpand(); |
469 | void toggleDateNavigatorWidget(); | 471 | void toggleDateNavigatorWidget(); |
470 | void toggleAllDaySize(); | 472 | void toggleAllDaySize(); |
471 | 473 | ||
472 | /** Look for new messages in the inbox */ | 474 | /** Look for new messages in the inbox */ |
473 | void lookForIncomingMessages(); | 475 | void lookForIncomingMessages(); |
474 | /** Look for new messages in the outbox */ | 476 | /** Look for new messages in the outbox */ |
475 | void lookForOutgoingMessages(); | 477 | void lookForOutgoingMessages(); |
476 | 478 | ||
477 | void processMainViewSelection( Incidence * ); | 479 | void processMainViewSelection( Incidence * ); |
478 | void processTodoListSelection( Incidence * ); | 480 | void processTodoListSelection( Incidence * ); |
479 | 481 | ||
480 | void processIncidenceSelection( Incidence * ); | 482 | void processIncidenceSelection( Incidence * ); |
481 | 483 | ||
482 | void purgeCompleted(); | 484 | void purgeCompleted(); |
483 | bool removeCompletedSubTodos( Todo* ); | 485 | bool removeCompletedSubTodos( Todo* ); |
484 | void slotCalendarChanged(); | 486 | void slotCalendarChanged(); |
485 | bool importBday(); | 487 | bool importBday(); |
486 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); | 488 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); |
487 | bool importQtopia( const QString &categoriesFile, | 489 | bool importQtopia( const QString &categoriesFile, |
488 | const QString &datebookFile, | 490 | const QString &datebookFile, |
489 | const QString &tasklistFile ); | 491 | const QString &tasklistFile ); |
490 | void syncExternal( int mode ); | 492 | void syncExternal( int mode ); |
491 | void slotSelectPickerDate( QDate ) ; | 493 | void slotSelectPickerDate( QDate ) ; |
492 | void showDatePicker() ; | 494 | void showDatePicker() ; |
493 | void showDatePickerPopup() ; | 495 | void showDatePickerPopup() ; |
494 | void moveIncidence(Incidence *) ; | 496 | void moveIncidence(Incidence *) ; |
495 | void beamIncidence(Incidence *) ; | 497 | void beamIncidence(Incidence *) ; |
496 | void beamCalendar() ; | 498 | void beamCalendar() ; |
497 | void beamFilteredCalendar() ; | 499 | void beamFilteredCalendar() ; |
498 | void beamIncidenceList(QPtrList<Incidence>) ; | 500 | void beamIncidenceList(Q3PtrList<Incidence>) ; |
499 | void manageCategories(); | 501 | void manageCategories(); |
500 | void editCategories(); | 502 | void editCategories(); |
501 | int addCategories(); | 503 | int addCategories(); |
502 | void removeCategories(); | 504 | void removeCategories(); |
503 | void setSyncDevice( QString ); | 505 | void setSyncDevice( QString ); |
504 | void setSyncName( QString ); | 506 | void setSyncName( QString ); |
505 | void showDay( QDate ); | 507 | void showDay( QDate ); |
506 | void undo_delete(); | 508 | void undo_delete(); |
507 | protected slots: | 509 | protected slots: |
508 | void resetFocus(); | 510 | void resetFocus(); |
509 | void scrollBarValue(int); | 511 | void scrollBarValue(int); |
510 | void slotViewerClosed(); | 512 | void slotViewerClosed(); |
511 | void timerAlarm(); | 513 | void timerAlarm(); |
512 | void suspendAlarm(); | 514 | void suspendAlarm(); |
513 | void beamDone( Ir *ir ); | 515 | void beamDone( Ir *ir ); |
514 | /** Select a view or adapt the current view to display the specified dates. */ | 516 | /** Select a view or adapt the current view to display the specified dates. */ |
515 | void showDates( const KCal::DateList & ); | 517 | void showDates( const KCal::DateList & ); |
516 | void selectWeekNum ( int ); | 518 | void selectWeekNum ( int ); |
517 | void checkConflictForEvent(); | 519 | void checkConflictForEvent(); |
518 | 520 | ||
519 | public: | 521 | public: |
520 | void createRunningDate4Todo( Todo * runT, QDateTime start , QDateTime end, int secLenRunning, int secLenPausing,int dayInterval ); | 522 | void createRunningDate4Todo( Todo * runT, QDateTime start , QDateTime end, int secLenRunning, int secLenPausing,int dayInterval ); |
521 | // show a standard warning | 523 | // show a standard warning |
522 | // returns KMsgBox::yesNoCancel() | 524 | // returns KMsgBox::yesNoCancel() |
523 | int msgCalModified(); | 525 | int msgCalModified(); |
524 | virtual bool sync(KSyncManager* manager, QString filename, int mode, QString resource); | 526 | virtual bool sync(KSyncManager* manager, QString filename, int mode, QString resource); |
525 | 527 | ||
526 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 528 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
527 | virtual void removeSyncInfo( QString syncProfile); | 529 | virtual void removeSyncInfo( QString syncProfile); |
528 | void setSyncManager(KSyncManager* manager); | 530 | void setSyncManager(KSyncManager* manager); |
529 | void setLoadedFileVersion(QDateTime); | 531 | void setLoadedFileVersion(QDateTime); |
530 | bool checkFileVersion(QString fn); | 532 | bool checkFileVersion(QString fn); |
531 | bool checkAllFileVersions(); | 533 | bool checkAllFileVersions(); |
532 | bool checkFileChanged(QString fn); | 534 | bool checkFileChanged(QString fn); |
533 | Event* getLastSyncEvent(); | 535 | Event* getLastSyncEvent(); |
534 | /** Adapt navigation units correpsonding to step size of navigation of the | 536 | /** Adapt navigation units correpsonding to step size of navigation of the |
535 | * current view. | 537 | * current view. |
536 | */ | 538 | */ |
537 | void adaptNavigationUnits(); | 539 | void adaptNavigationUnits(); |
538 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 540 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
539 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 541 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
540 | //Attendee* getYourAttendee(Event *event); | 542 | //Attendee* getYourAttendee(Event *event); |
541 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} | 543 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} |
542 | void setScrollBarStep(int val ); | 544 | void setScrollBarStep(int val ); |
543 | 545 | ||
544 | protected: | 546 | protected: |
545 | bool mMultiResourceSync; | 547 | bool mMultiResourceSync; |
546 | Event *mConflictingEvent; | 548 | Event *mConflictingEvent; |
547 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 549 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
548 | 550 | ||
549 | // returns KMsgBox::OKCandel() | 551 | // returns KMsgBox::OKCandel() |
550 | int msgItemDelete(const QString name); | 552 | int msgItemDelete(const QString name); |
551 | void showEventEditor(); | 553 | void showEventEditor(); |
552 | void showTodoEditor(); | 554 | void showTodoEditor(); |
553 | Todo *selectedTodo(); | 555 | Todo *selectedTodo(); |
554 | private: | 556 | private: |
555 | #ifdef DESKTOP_VERSION | 557 | #ifdef DESKTOP_VERSION |
556 | QScrollBar * mDateScrollBar; | 558 | QScrollBar * mDateScrollBar; |
557 | #endif | 559 | #endif |
558 | bool flag_blockConflict; | 560 | bool flag_blockConflict; |
559 | bool flag_blockScrollBar; | 561 | bool flag_blockScrollBar; |
560 | bool flag_checkFileFirsttime; | 562 | bool flag_checkFileFirsttime; |
561 | bool flag_clearallviewsEventDisplay; | 563 | bool flag_clearallviewsEventDisplay; |
562 | bool flag_clearallviewsupdateView; | 564 | bool flag_clearallviewsupdateView; |
563 | QDateTime mNextAlarmDateTime; | 565 | QDateTime mNextAlarmDateTime; |
564 | bool mViewerCallerIsSearchDialog; | 566 | bool mViewerCallerIsSearchDialog; |
565 | bool mBlockShowDates; | 567 | bool mBlockShowDates; |
566 | KSyncManager* mSyncManager; | 568 | KSyncManager* mSyncManager; |
567 | AlarmDialog * mAlarmDialog; | 569 | AlarmDialog * mAlarmDialog; |
568 | QString mAlarmNotification; | 570 | QString mAlarmNotification; |
569 | QString mSuspendAlarmNotification; | 571 | QString mSuspendAlarmNotification; |
570 | QTimer* mSuspendTimer; | 572 | QTimer* mSuspendTimer; |
571 | QTimer* mAlarmTimer; | 573 | QTimer* mAlarmTimer; |
572 | QTimer* mRecheckAlarmTimer; | 574 | QTimer* mRecheckAlarmTimer; |
573 | void computeAlarm( QString ); | 575 | void computeAlarm( QString ); |
574 | void startAlarm( QString, QString ); | 576 | void startAlarm( QString, QString ); |
575 | void setSyncEventsReadOnly(); | 577 | void setSyncEventsReadOnly(); |
576 | 578 | ||
577 | QDateTime loadedFileVersion; | 579 | QDateTime loadedFileVersion; |
578 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 580 | void checkExternSyncEvent( Q3PtrList<Event> lastSync , Incidence* toDelete ); |
579 | void checkExternalId( Incidence * inc ); | 581 | void checkExternalId( Incidence * inc ); |
580 | int mGlobalSyncMode; | 582 | int mGlobalSyncMode; |
581 | QString mCurrentSyncDevice; | 583 | QString mCurrentSyncDevice; |
582 | QString mCurrentSyncName; | 584 | QString mCurrentSyncName; |
583 | void init(); | 585 | void init(); |
584 | int mDatePickerMode; | 586 | int mDatePickerMode; |
585 | bool mFlagEditDescription; | 587 | bool mFlagEditDescription; |
586 | QDateTime mLastCalendarSync; | 588 | QDateTime mLastCalendarSync; |
587 | void createPrinter(); | 589 | void createPrinter(); |
588 | 590 | ||
589 | void calendarModified( bool, Calendar * ); | 591 | void calendarModified( bool, Calendar * ); |
590 | 592 | ||
591 | CalPrinter *mCalPrinter; | 593 | CalPrinter *mCalPrinter; |
592 | 594 | ||
593 | QSplitter *mPanner; | 595 | QSplitter *mPanner; |
594 | QSplitter *mLeftSplitter; | 596 | QSplitter *mLeftSplitter; |
595 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; | 597 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; |
596 | QWidgetStack *mRightFrame; | 598 | Q3WidgetStack *mRightFrame; |
597 | 599 | ||
598 | KDatePicker* mDatePicker; | 600 | KDatePicker* mDatePicker; |
599 | QVBox* mDateFrame; | 601 | Q3VBox* mDateFrame; |
600 | 602 | ||
601 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. | 603 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. |
602 | 604 | ||
603 | KOFilterView *mFilterView; | 605 | KOFilterView *mFilterView; |
604 | KOCalEditView *mCalEditView; | 606 | KOCalEditView *mCalEditView; |
605 | 607 | ||
606 | ResourceView *mResourceView; | 608 | ResourceView *mResourceView; |
607 | 609 | ||
608 | // calendar object for this viewing instance | 610 | // calendar object for this viewing instance |
609 | Calendar *mCalendar; | 611 | Calendar *mCalendar; |
610 | 612 | ||
611 | CalendarResourceManager *mResourceManager; | 613 | CalendarResourceManager *mResourceManager; |
612 | 614 | ||
613 | FileStorage *mStorage; | 615 | FileStorage *mStorage; |
614 | 616 | ||
615 | DateNavigator *mNavigator; | 617 | DateNavigator *mNavigator; |
616 | 618 | ||
617 | KOViewManager *mViewManager; | 619 | KOViewManager *mViewManager; |
618 | KODialogManager *mDialogManager; | 620 | KODialogManager *mDialogManager; |
619 | 621 | ||
620 | // Calendar filters | 622 | // Calendar filters |
621 | QPtrList<CalFilter> mFilters; | 623 | Q3PtrList<CalFilter> mFilters; |
622 | 624 | ||
623 | // various housekeeping variables. | 625 | // various housekeeping variables. |
624 | bool mModified; // flag indicating if calendar is modified | 626 | bool mModified; // flag indicating if calendar is modified |
625 | bool mReadOnly; // flag indicating if calendar is read-only | 627 | bool mReadOnly; // flag indicating if calendar is read-only |
626 | QDate mSaveSingleDate; | 628 | QDate mSaveSingleDate; |
627 | 629 | ||
628 | Incidence *mSelectedIncidence; | 630 | Incidence *mSelectedIncidence; |
629 | Incidence *mMoveIncidence; | 631 | Incidence *mMoveIncidence; |
630 | QDate mMoveIncidenceOldDate; | 632 | QDate mMoveIncidenceOldDate; |
631 | KOTodoView *mTodoList; | 633 | KOTodoView *mTodoList; |
632 | KOEventEditor * mEventEditor; | 634 | KOEventEditor * mEventEditor; |
633 | KOTodoEditor * mTodoEditor; | 635 | KOTodoEditor * mTodoEditor; |
634 | KOEventViewerDialog * mEventViewerDialog; | 636 | KOEventViewerDialog * mEventViewerDialog; |
635 | void keyPressEvent ( QKeyEvent *e) ; | 637 | void keyPressEvent ( QKeyEvent *e) ; |
636 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 638 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
637 | }; | 639 | }; |
638 | 640 | ||
639 | 641 | ||
640 | class CalendarViewVisitor : public Incidence::Visitor | 642 | class CalendarViewVisitor : public Incidence::Visitor |
641 | { | 643 | { |
642 | public: | 644 | public: |
643 | CalendarViewVisitor() : mView( 0 ) {} | 645 | CalendarViewVisitor() : mView( 0 ) {} |
644 | 646 | ||
645 | bool act( Incidence *incidence, CalendarView *view ) | 647 | bool act( Incidence *incidence, CalendarView *view ) |
646 | { | 648 | { |
647 | mView = view; | 649 | mView = view; |
648 | return incidence->accept( *this ); | 650 | return incidence->accept( *this ); |
649 | } | 651 | } |
650 | 652 | ||
651 | protected: | 653 | protected: |
652 | CalendarView *mView; | 654 | CalendarView *mView; |
653 | }; | 655 | }; |
654 | 656 | ||
655 | class ShowIncidenceVisitor : public CalendarViewVisitor | 657 | class ShowIncidenceVisitor : public CalendarViewVisitor |
656 | { | 658 | { |
657 | protected: | 659 | protected: |
658 | bool visit( Event *event ) { mView->showEvent( event ); return true; } | 660 | bool visit( Event *event ) { mView->showEvent( event ); return true; } |
659 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } | 661 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } |
660 | bool visit( Journal * j ) { mView->showJournal( j );return true; } | 662 | bool visit( Journal * j ) { mView->showJournal( j );return true; } |
661 | }; | 663 | }; |
662 | 664 | ||
663 | class EditIncidenceVisitor : public CalendarViewVisitor | 665 | class EditIncidenceVisitor : public CalendarViewVisitor |
664 | { | 666 | { |
665 | protected: | 667 | protected: |
666 | bool visit( Event *event ) { mView->editEvent( event ); return true; } | 668 | bool visit( Event *event ) { mView->editEvent( event ); return true; } |
667 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } | 669 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } |
668 | bool visit( Journal *j ) { mView->editJournal( j); return true; } | 670 | bool visit( Journal *j ) { mView->editJournal( j); return true; } |
669 | }; | 671 | }; |
670 | 672 | ||
671 | class DeleteIncidenceVisitor : public CalendarViewVisitor | 673 | class DeleteIncidenceVisitor : public CalendarViewVisitor |
672 | { | 674 | { |
673 | protected: | 675 | protected: |
674 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } | 676 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } |
675 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } | 677 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } |
676 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } | 678 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } |
677 | }; | 679 | }; |
678 | 680 | ||
679 | #endif | 681 | #endif |