-rw-r--r-- | korganizer/calendarview.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d7ff36..731298d 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -12,216 +12,213 @@ | |||
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 | 42 | ||
43 | #include <korganizer/calendarviewbase.h> | 43 | #include <korganizer/calendarviewbase.h> |
44 | 44 | ||
45 | #include <ksyncmanager.h> | 45 | #include <ksyncmanager.h> |
46 | 46 | ||
47 | class QWidgetStack; | 47 | class QWidgetStack; |
48 | class QSplitter; | 48 | class QSplitter; |
49 | 49 | ||
50 | class CalPrinter; | 50 | class CalPrinter; |
51 | class KOFilterView; | 51 | class KOFilterView; |
52 | class KOViewManager; | 52 | class KOViewManager; |
53 | class KODialogManager; | 53 | class KODialogManager; |
54 | class KOTodoView; | 54 | class KOTodoView; |
55 | class KDateNavigator; | 55 | class KDateNavigator; |
56 | class DateNavigator; | 56 | class DateNavigator; |
57 | class KOIncidenceEditor; | 57 | class KOIncidenceEditor; |
58 | class KDatePicker; | 58 | class KDatePicker; |
59 | class ResourceView; | 59 | class ResourceView; |
60 | class NavigatorBar; | ||
61 | class KOEventEditor; | 60 | class KOEventEditor; |
62 | class KOTodoEditor ; | 61 | class KOTodoEditor ; |
63 | class KOEventViewerDialog; | 62 | class KOEventViewerDialog; |
64 | class KOBeamPrefs; | 63 | class KOBeamPrefs; |
65 | class KSyncProfile; | 64 | class KSyncProfile; |
66 | class AlarmDialog; | 65 | class AlarmDialog; |
67 | class KCal::Attendee; | 66 | class KCal::Attendee; |
68 | 67 | ||
69 | namespace KCal { class FileStorage; } | 68 | namespace KCal { class FileStorage; } |
70 | 69 | ||
71 | using namespace KCal; | 70 | using namespace KCal; |
72 | 71 | ||
73 | /** | 72 | /** |
74 | This is the main calendar widget. It provides the different vies on t he | 73 | This is the main calendar widget. It provides the different vies on t he |
75 | calendar data as well as the date navigator. It also handles synchronisation | 74 | calendar data as well as the date navigator. It also handles synchronisation |
76 | of the different views and controls the different dialogs like preferences, | 75 | of the different views and controls the different dialogs like preferences, |
77 | event editor, search dialog etc. | 76 | event editor, search dialog etc. |
78 | 77 | ||
79 | @short main calendar view widget | 78 | @short main calendar view widget |
80 | @author Cornelius Schumacher | 79 | @author Cornelius Schumacher |
81 | */ | 80 | */ |
82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 81 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
83 | { | 82 | { |
84 | Q_OBJECT | 83 | Q_OBJECT |
85 | public: | 84 | public: |
86 | /** | 85 | /** |
87 | Constructs a new calendar view widget. | 86 | Constructs a new calendar view widget. |
88 | 87 | ||
89 | @param calendar calendar document | 88 | @param calendar calendar document |
90 | @param parent parent window | 89 | @param parent parent window |
91 | @param name Qt internal widget object name | 90 | @param name Qt internal widget object name |
92 | */ | 91 | */ |
93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 92 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
94 | const char *name = 0 ); | 93 | const char *name = 0 ); |
95 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 94 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
96 | const char *name = 0 ); | 95 | const char *name = 0 ); |
97 | virtual ~CalendarView(); | 96 | virtual ~CalendarView(); |
98 | 97 | ||
99 | Calendar *calendar() { return mCalendar; } | 98 | Calendar *calendar() { return mCalendar; } |
100 | 99 | ||
101 | KOViewManager *viewManager(); | 100 | KOViewManager *viewManager(); |
102 | KODialogManager *dialogManager(); | 101 | KODialogManager *dialogManager(); |
103 | 102 | ||
104 | QDate startDate(); | 103 | QDate startDate(); |
105 | QDate endDate(); | 104 | QDate endDate(); |
106 | 105 | ||
107 | QWidgetStack *viewStack(); | 106 | QWidgetStack *viewStack(); |
108 | QWidget *leftFrame(); | 107 | QWidget *leftFrame(); |
109 | NavigatorBar *navigatorBar(); | ||
110 | 108 | ||
111 | DateNavigator *dateNavigator(); | 109 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 110 | KDateNavigator *dateNavigatorWidget(); |
113 | 111 | ||
114 | void addView(KOrg::BaseView *); | 112 | void addView(KOrg::BaseView *); |
115 | void showView(KOrg::BaseView *); | 113 | void showView(KOrg::BaseView *); |
116 | KOEventViewerDialog* getEventViewerDialog(); | 114 | KOEventViewerDialog* getEventViewerDialog(); |
117 | Incidence *currentSelection(); | 115 | Incidence *currentSelection(); |
118 | 116 | ||
119 | signals: | 117 | signals: |
120 | void save (); | 118 | void save (); |
121 | void saveStopTimer (); | 119 | void saveStopTimer (); |
122 | void tempDisableBR(bool); | 120 | void tempDisableBR(bool); |
123 | /** This todo has been modified */ | 121 | /** This todo has been modified */ |
124 | void todoModified(Todo *, int); | 122 | void todoModified(Todo *, int); |
125 | 123 | ||
126 | /** when change is made to options dialog, the topwidget will catch this | 124 | /** when change is made to options dialog, the topwidget will catch this |
127 | * and emit this signal which notifies all widgets which have registered | 125 | * and emit this signal which notifies all widgets which have registered |
128 | * for notification to update their settings. */ | 126 | * for notification to update their settings. */ |
129 | void configChanged(); | 127 | void configChanged(); |
130 | /** emitted when the topwidget is closing down, so that any attached | 128 | /** emitted when the topwidget is closing down, so that any attached |
131 | child windows can also close. */ | 129 | child windows can also close. */ |
132 | void closingDown(); | 130 | void closingDown(); |
133 | /** emitted right before we die */ | 131 | /** emitted right before we die */ |
134 | void closed(QWidget *); | 132 | void closed(QWidget *); |
135 | 133 | ||
136 | /** Emitted when state of modified flag changes */ | 134 | /** Emitted when state of modified flag changes */ |
137 | void modifiedChanged(bool); | 135 | void modifiedChanged(bool); |
138 | void signalmodified(); | 136 | void signalmodified(); |
139 | 137 | ||
140 | /** Emitted when state of read-only flag changes */ | 138 | /** Emitted when state of read-only flag changes */ |
141 | void readOnlyChanged(bool); | 139 | void readOnlyChanged(bool); |
142 | 140 | ||
143 | /** Emitted when the unit of navigation changes */ | 141 | /** Emitted when the unit of navigation changes */ |
144 | void changeNavStringPrev(const QString &); | 142 | void changeNavStringPrev(const QString &); |
145 | void changeNavStringNext(const QString &); | 143 | void changeNavStringNext(const QString &); |
146 | 144 | ||
147 | /** Emitted when state of events selection has changed and user is organizer*/ | 145 | /** Emitted when state of events selection has changed and user is organizer*/ |
148 | void organizerEventsSelected(bool); | 146 | void organizerEventsSelected(bool); |
149 | /** Emitted when state of events selection has changed and user is attendee*/ | 147 | /** Emitted when state of events selection has changed and user is attendee*/ |
150 | void groupEventsSelected(bool); | 148 | void groupEventsSelected(bool); |
151 | /** | 149 | /** |
152 | Emitted when an incidence gets selected. If the selection is cleared the | 150 | Emitted when an incidence gets selected. If the selection is cleared the |
153 | signal is emitted with 0 as argument. | 151 | signal is emitted with 0 as argument. |
154 | */ | 152 | */ |
155 | void incidenceSelected( Incidence * ); | 153 | void incidenceSelected( Incidence * ); |
156 | /** Emitted, when a todoitem is selected or deselected. */ | 154 | /** Emitted, when a todoitem is selected or deselected. */ |
157 | void todoSelected( bool ); | 155 | void todoSelected( bool ); |
158 | 156 | ||
159 | /** | 157 | /** |
160 | Emitted, when clipboard content changes. Parameter indicates if paste | 158 | Emitted, when clipboard content changes. Parameter indicates if paste |
161 | is possible or not. | 159 | is possible or not. |
162 | */ | 160 | */ |
163 | void pasteEnabled(bool); | 161 | void pasteEnabled(bool); |
164 | 162 | ||
165 | /** Emitted, when the number of incoming messages has changed. */ | 163 | /** Emitted, when the number of incoming messages has changed. */ |
166 | void numIncomingChanged(int); | 164 | void numIncomingChanged(int); |
167 | 165 | ||
168 | /** Emitted, when the number of outgoing messages has changed. */ | 166 | /** Emitted, when the number of outgoing messages has changed. */ |
169 | void numOutgoingChanged(int); | 167 | void numOutgoingChanged(int); |
170 | 168 | ||
171 | /** Send status message, which can e.g. be displayed in the status bar. */ | 169 | /** Send status message, which can e.g. be displayed in the status bar. */ |
172 | void statusMessage(const QString &); | 170 | void statusMessage(const QString &); |
173 | 171 | ||
174 | void calendarViewExpanded( bool ); | 172 | void calendarViewExpanded( bool ); |
175 | void updateSearchDialog(); | 173 | void updateSearchDialog(); |
176 | 174 | ||
177 | 175 | ||
178 | public slots: | 176 | public slots: |
179 | void showNavigatorBar(bool); | ||
180 | void showOpenError(); | 177 | void showOpenError(); |
181 | void watchSavedFile(); | 178 | void watchSavedFile(); |
182 | void recheckTimerAlarm(); | 179 | void recheckTimerAlarm(); |
183 | void checkNextTimerAlarm(); | 180 | void checkNextTimerAlarm(); |
184 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 181 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
185 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 182 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
186 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 183 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
187 | 184 | ||
188 | /** options dialog made a changed to the configuration. we catch this | 185 | /** options dialog made a changed to the configuration. we catch this |
189 | * and notify all widgets which need to update their configuration. */ | 186 | * and notify all widgets which need to update their configuration. */ |
190 | void updateConfig(); | 187 | void updateConfig(); |
191 | 188 | ||
192 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 189 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
193 | const QStringList& anniversaryList, const QStringList& realNameList, | 190 | const QStringList& anniversaryList, const QStringList& realNameList, |
194 | const QStringList& emailList, const QStringList& assembledNameList, | 191 | const QStringList& emailList, const QStringList& assembledNameList, |
195 | const QStringList& uidList); | 192 | const QStringList& uidList); |
196 | 193 | ||
197 | /** | 194 | /** |
198 | Load calendar from file \a filename. If \a merge is true, load | 195 | Load calendar from file \a filename. If \a merge is true, load |
199 | calendar into existing one, if it is false, clear calendar, before | 196 | calendar into existing one, if it is false, clear calendar, before |
200 | loading. Return true, if calendar could be successfully loaded. | 197 | loading. Return true, if calendar could be successfully loaded. |
201 | */ | 198 | */ |
202 | bool openCalendar(QString filename, bool merge=false); | 199 | bool openCalendar(QString filename, bool merge=false); |
203 | bool syncCalendar(QString filename,int mode = 0 ); | 200 | bool syncCalendar(QString filename,int mode = 0 ); |
204 | 201 | ||
205 | /** | 202 | /** |
206 | Save calendar data to file. Return true if calendar could be | 203 | Save calendar data to file. Return true if calendar could be |
207 | successfully saved. | 204 | successfully saved. |
208 | */ | 205 | */ |
209 | bool saveCalendar(QString filename); | 206 | bool saveCalendar(QString filename); |
210 | 207 | ||
211 | /** | 208 | /** |
212 | Close calendar. Clear calendar data and reset views to display an empty | 209 | Close calendar. Clear calendar data and reset views to display an empty |
213 | calendar. | 210 | calendar. |
214 | */ | 211 | */ |
215 | void closeCalendar(); | 212 | void closeCalendar(); |
216 | 213 | ||
217 | /** Archive old events of calendar */ | 214 | /** Archive old events of calendar */ |
218 | void archiveCalendar(); | 215 | void archiveCalendar(); |
219 | 216 | ||
220 | void showIncidence(); | 217 | void showIncidence(); |
221 | void editIncidence(); | 218 | void editIncidence(); |
222 | void editIncidenceDescription(); | 219 | void editIncidenceDescription(); |
223 | void deleteIncidence(); | 220 | void deleteIncidence(); |
224 | void cloneIncidence(); | 221 | void cloneIncidence(); |
225 | void moveIncidence(); | 222 | void moveIncidence(); |
226 | void beamIncidence(); | 223 | void beamIncidence(); |
227 | void toggleCancelIncidence(); | 224 | void toggleCancelIncidence(); |
@@ -488,97 +485,96 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
488 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} | 485 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} |
489 | protected: | 486 | protected: |
490 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 487 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
491 | 488 | ||
492 | // returns KMsgBox::OKCandel() | 489 | // returns KMsgBox::OKCandel() |
493 | int msgItemDelete(const QString name); | 490 | int msgItemDelete(const QString name); |
494 | void showEventEditor(); | 491 | void showEventEditor(); |
495 | void showTodoEditor(); | 492 | void showTodoEditor(); |
496 | void writeLocale(); | 493 | void writeLocale(); |
497 | Todo *selectedTodo(); | 494 | Todo *selectedTodo(); |
498 | 495 | ||
499 | private: | 496 | private: |
500 | bool mBlockShowDates; | 497 | bool mBlockShowDates; |
501 | KSyncManager* mSyncManager; | 498 | KSyncManager* mSyncManager; |
502 | AlarmDialog * mAlarmDialog; | 499 | AlarmDialog * mAlarmDialog; |
503 | QString mAlarmNotification; | 500 | QString mAlarmNotification; |
504 | QString mSuspendAlarmNotification; | 501 | QString mSuspendAlarmNotification; |
505 | QTimer* mSuspendTimer; | 502 | QTimer* mSuspendTimer; |
506 | QTimer* mAlarmTimer; | 503 | QTimer* mAlarmTimer; |
507 | QTimer* mRecheckAlarmTimer; | 504 | QTimer* mRecheckAlarmTimer; |
508 | void computeAlarm( QString ); | 505 | void computeAlarm( QString ); |
509 | void startAlarm( QString, QString ); | 506 | void startAlarm( QString, QString ); |
510 | void setSyncEventsReadOnly(); | 507 | void setSyncEventsReadOnly(); |
511 | 508 | ||
512 | QDateTime loadedFileVersion; | 509 | QDateTime loadedFileVersion; |
513 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 510 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); |
514 | void checkExternalId( Incidence * inc ); | 511 | void checkExternalId( Incidence * inc ); |
515 | int mGlobalSyncMode; | 512 | int mGlobalSyncMode; |
516 | QString mCurrentSyncDevice; | 513 | QString mCurrentSyncDevice; |
517 | QString mCurrentSyncName; | 514 | QString mCurrentSyncName; |
518 | KOBeamPrefs* beamDialog; | 515 | KOBeamPrefs* beamDialog; |
519 | void init(); | 516 | void init(); |
520 | int mDatePickerMode; | 517 | int mDatePickerMode; |
521 | bool mFlagEditDescription; | 518 | bool mFlagEditDescription; |
522 | QDateTime mLastCalendarSync; | 519 | QDateTime mLastCalendarSync; |
523 | void createPrinter(); | 520 | void createPrinter(); |
524 | 521 | ||
525 | void calendarModified( bool, Calendar * ); | 522 | void calendarModified( bool, Calendar * ); |
526 | 523 | ||
527 | CalPrinter *mCalPrinter; | 524 | CalPrinter *mCalPrinter; |
528 | 525 | ||
529 | QSplitter *mPanner; | 526 | QSplitter *mPanner; |
530 | QSplitter *mLeftSplitter; | 527 | QSplitter *mLeftSplitter; |
531 | QWidget *mLeftFrame; | 528 | QWidget *mLeftFrame; |
532 | QWidgetStack *mRightFrame; | 529 | QWidgetStack *mRightFrame; |
533 | 530 | ||
534 | KDatePicker* mDatePicker; | 531 | KDatePicker* mDatePicker; |
535 | QVBox* mDateFrame; | 532 | QVBox* mDateFrame; |
536 | NavigatorBar *mNavigatorBar; | ||
537 | 533 | ||
538 | KDateNavigator *mDateNavigator; // widget showing small month view. | 534 | KDateNavigator *mDateNavigator; // widget showing small month view. |
539 | 535 | ||
540 | KOFilterView *mFilterView; | 536 | KOFilterView *mFilterView; |
541 | 537 | ||
542 | ResourceView *mResourceView; | 538 | ResourceView *mResourceView; |
543 | 539 | ||
544 | // calendar object for this viewing instance | 540 | // calendar object for this viewing instance |
545 | Calendar *mCalendar; | 541 | Calendar *mCalendar; |
546 | 542 | ||
547 | CalendarResourceManager *mResourceManager; | 543 | CalendarResourceManager *mResourceManager; |
548 | 544 | ||
549 | FileStorage *mStorage; | 545 | FileStorage *mStorage; |
550 | 546 | ||
551 | DateNavigator *mNavigator; | 547 | DateNavigator *mNavigator; |
552 | 548 | ||
553 | KOViewManager *mViewManager; | 549 | KOViewManager *mViewManager; |
554 | KODialogManager *mDialogManager; | 550 | KODialogManager *mDialogManager; |
555 | 551 | ||
556 | // Calendar filters | 552 | // Calendar filters |
557 | QPtrList<CalFilter> mFilters; | 553 | QPtrList<CalFilter> mFilters; |
558 | 554 | ||
559 | // various housekeeping variables. | 555 | // various housekeeping variables. |
560 | bool mModified; // flag indicating if calendar is modified | 556 | bool mModified; // flag indicating if calendar is modified |
561 | bool mReadOnly; // flag indicating if calendar is read-only | 557 | bool mReadOnly; // flag indicating if calendar is read-only |
562 | QDate mSaveSingleDate; | 558 | QDate mSaveSingleDate; |
563 | 559 | ||
564 | Incidence *mSelectedIncidence; | 560 | Incidence *mSelectedIncidence; |
565 | Incidence *mMoveIncidence; | 561 | Incidence *mMoveIncidence; |
566 | QDate mMoveIncidenceOldDate; | 562 | QDate mMoveIncidenceOldDate; |
567 | KOTodoView *mTodoList; | 563 | KOTodoView *mTodoList; |
568 | KOEventEditor * mEventEditor; | 564 | KOEventEditor * mEventEditor; |
569 | KOTodoEditor * mTodoEditor; | 565 | KOTodoEditor * mTodoEditor; |
570 | KOEventViewerDialog * mEventViewerDialog; | 566 | KOEventViewerDialog * mEventViewerDialog; |
571 | void keyPressEvent ( QKeyEvent *e) ; | 567 | void keyPressEvent ( QKeyEvent *e) ; |
572 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 568 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
573 | }; | 569 | }; |
574 | 570 | ||
575 | 571 | ||
576 | class CalendarViewVisitor : public Incidence::Visitor | 572 | class CalendarViewVisitor : public Incidence::Visitor |
577 | { | 573 | { |
578 | public: | 574 | public: |
579 | CalendarViewVisitor() : mView( 0 ) {} | 575 | CalendarViewVisitor() : mView( 0 ) {} |
580 | 576 | ||
581 | bool act( Incidence *incidence, CalendarView *view ) | 577 | bool act( Incidence *incidence, CalendarView *view ) |
582 | { | 578 | { |
583 | mView = view; | 579 | mView = view; |
584 | return incidence->accept( *this ); | 580 | return incidence->accept( *this ); |