-rw-r--r-- | korganizer/calendarview.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8d329a9..751b8d9 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -21,84 +21,86 @@ | |||
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> | ||
46 | |||
45 | class QWidgetStack; | 47 | class QWidgetStack; |
46 | class QSplitter; | 48 | class QSplitter; |
47 | 49 | ||
48 | class CalPrinter; | 50 | class CalPrinter; |
49 | class KOFilterView; | 51 | class KOFilterView; |
50 | class KOViewManager; | 52 | class KOViewManager; |
51 | class KODialogManager; | 53 | class KODialogManager; |
52 | class KOTodoView; | 54 | class KOTodoView; |
53 | class KDateNavigator; | 55 | class KDateNavigator; |
54 | class DateNavigator; | 56 | class DateNavigator; |
55 | class KOIncidenceEditor; | 57 | class KOIncidenceEditor; |
56 | class KDatePicker; | 58 | class KDatePicker; |
57 | class ResourceView; | 59 | class ResourceView; |
58 | class NavigatorBar; | 60 | class NavigatorBar; |
59 | class KOEventEditor; | 61 | class KOEventEditor; |
60 | class KOTodoEditor ; | 62 | class KOTodoEditor ; |
61 | class KOEventViewerDialog; | 63 | class KOEventViewerDialog; |
62 | class KOBeamPrefs; | 64 | class KOBeamPrefs; |
63 | class KSyncProfile; | 65 | class KSyncProfile; |
64 | class AlarmDialog; | 66 | class AlarmDialog; |
65 | class KCal::Attendee; | 67 | class KCal::Attendee; |
66 | 68 | ||
67 | namespace KCal { class FileStorage; } | 69 | namespace KCal { class FileStorage; } |
68 | 70 | ||
69 | using namespace KCal; | 71 | using namespace KCal; |
70 | 72 | ||
71 | /** | 73 | /** |
72 | This is the main calendar widget. It provides the different vies on t he | 74 | 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 | 75 | calendar data as well as the date navigator. It also handles synchronisation |
74 | of the different views and controls the different dialogs like preferences, | 76 | of the different views and controls the different dialogs like preferences, |
75 | event editor, search dialog etc. | 77 | event editor, search dialog etc. |
76 | 78 | ||
77 | @short main calendar view widget | 79 | @short main calendar view widget |
78 | @author Cornelius Schumacher | 80 | @author Cornelius Schumacher |
79 | */ | 81 | */ |
80 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer | 82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
81 | { | 83 | { |
82 | Q_OBJECT | 84 | Q_OBJECT |
83 | public: | 85 | public: |
84 | /** | 86 | /** |
85 | Constructs a new calendar view widget. | 87 | Constructs a new calendar view widget. |
86 | 88 | ||
87 | @param calendar calendar document | 89 | @param calendar calendar document |
88 | @param parent parent window | 90 | @param parent parent window |
89 | @param name Qt internal widget object name | 91 | @param name Qt internal widget object name |
90 | */ | 92 | */ |
91 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
92 | const char *name = 0 ); | 94 | const char *name = 0 ); |
93 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 95 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
94 | const char *name = 0 ); | 96 | const char *name = 0 ); |
95 | virtual ~CalendarView(); | 97 | virtual ~CalendarView(); |
96 | 98 | ||
97 | Calendar *calendar() { return mCalendar; } | 99 | Calendar *calendar() { return mCalendar; } |
98 | 100 | ||
99 | KOViewManager *viewManager(); | 101 | KOViewManager *viewManager(); |
100 | KODialogManager *dialogManager(); | 102 | KODialogManager *dialogManager(); |
101 | 103 | ||
102 | QDate startDate(); | 104 | QDate startDate(); |
103 | QDate endDate(); | 105 | QDate endDate(); |
104 | 106 | ||
@@ -440,71 +442,76 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
440 | void slotSelectPickerDate( QDate ) ; | 442 | void slotSelectPickerDate( QDate ) ; |
441 | void showDatePicker( ) ; | 443 | void showDatePicker( ) ; |
442 | void moveIncidence(Incidence *) ; | 444 | void moveIncidence(Incidence *) ; |
443 | void beamIncidence(Incidence *) ; | 445 | void beamIncidence(Incidence *) ; |
444 | void beamCalendar() ; | 446 | void beamCalendar() ; |
445 | void beamFilteredCalendar() ; | 447 | void beamFilteredCalendar() ; |
446 | void beamIncidenceList(QPtrList<Incidence>) ; | 448 | void beamIncidenceList(QPtrList<Incidence>) ; |
447 | void manageCategories(); | 449 | void manageCategories(); |
448 | int addCategories(); | 450 | int addCategories(); |
449 | void removeCategories(); | 451 | void removeCategories(); |
450 | void setSyncDevice( QString ); | 452 | void setSyncDevice( QString ); |
451 | void setSyncName( QString ); | 453 | void setSyncName( QString ); |
452 | protected slots: | 454 | protected slots: |
453 | void timerAlarm(); | 455 | void timerAlarm(); |
454 | void suspendAlarm(); | 456 | void suspendAlarm(); |
455 | void beamDone( Ir *ir ); | 457 | void beamDone( Ir *ir ); |
456 | /** Select a view or adapt the current view to display the specified dates. */ | 458 | /** Select a view or adapt the current view to display the specified dates. */ |
457 | void showDates( const KCal::DateList & ); | 459 | void showDates( const KCal::DateList & ); |
458 | void selectWeekNum ( int ); | 460 | void selectWeekNum ( int ); |
459 | 461 | ||
460 | public: | 462 | public: |
461 | // show a standard warning | 463 | // show a standard warning |
462 | // returns KMsgBox::yesNoCancel() | 464 | // returns KMsgBox::yesNoCancel() |
463 | int msgCalModified(); | 465 | int msgCalModified(); |
466 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | ||
467 | |||
468 | virtual bool syncExternal(KSyncManager* manager, QString resource); | ||
464 | void confSync(); | 469 | void confSync(); |
470 | void setSyncManager(KSyncManager* manager); | ||
465 | void setLoadedFileVersion(QDateTime); | 471 | void setLoadedFileVersion(QDateTime); |
466 | bool checkFileVersion(QString fn); | 472 | bool checkFileVersion(QString fn); |
467 | bool checkFileChanged(QString fn); | 473 | bool checkFileChanged(QString fn); |
468 | Event* getLastSyncEvent(); | 474 | Event* getLastSyncEvent(); |
469 | /** Adapt navigation units correpsonding to step size of navigation of the | 475 | /** Adapt navigation units correpsonding to step size of navigation of the |
470 | * current view. | 476 | * current view. |
471 | */ | 477 | */ |
472 | void adaptNavigationUnits(); | 478 | void adaptNavigationUnits(); |
473 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 479 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
474 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 480 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
475 | //Attendee* getYourAttendee(Event *event); | 481 | //Attendee* getYourAttendee(Event *event); |
476 | protected: | 482 | protected: |
477 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 483 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
478 | 484 | ||
479 | // returns KMsgBox::OKCandel() | 485 | // returns KMsgBox::OKCandel() |
480 | int msgItemDelete(); | 486 | int msgItemDelete(); |
481 | void showEventEditor(); | 487 | void showEventEditor(); |
482 | void showTodoEditor(); | 488 | void showTodoEditor(); |
483 | void writeLocale(); | 489 | void writeLocale(); |
484 | Todo *selectedTodo(); | 490 | Todo *selectedTodo(); |
485 | 491 | ||
486 | private: | 492 | private: |
493 | KSyncManager* mSyncManager; | ||
487 | AlarmDialog * mAlarmDialog; | 494 | AlarmDialog * mAlarmDialog; |
488 | QString mAlarmNotification; | 495 | QString mAlarmNotification; |
489 | QString mSuspendAlarmNotification; | 496 | QString mSuspendAlarmNotification; |
490 | QTimer* mSuspendTimer; | 497 | QTimer* mSuspendTimer; |
491 | QTimer* mAlarmTimer; | 498 | QTimer* mAlarmTimer; |
492 | QTimer* mRecheckAlarmTimer; | 499 | QTimer* mRecheckAlarmTimer; |
493 | void computeAlarm( QString ); | 500 | void computeAlarm( QString ); |
494 | void startAlarm( QString, QString ); | 501 | void startAlarm( QString, QString ); |
495 | void setSyncEventsReadOnly(); | 502 | void setSyncEventsReadOnly(); |
496 | 503 | ||
497 | QDateTime loadedFileVersion; | 504 | QDateTime loadedFileVersion; |
498 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 505 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); |
499 | void checkExternalId( Incidence * inc ); | 506 | void checkExternalId( Incidence * inc ); |
500 | int mGlobalSyncMode; | 507 | int mGlobalSyncMode; |
501 | QString mCurrentSyncDevice; | 508 | QString mCurrentSyncDevice; |
502 | QString mCurrentSyncName; | 509 | QString mCurrentSyncName; |
503 | KOBeamPrefs* beamDialog; | 510 | KOBeamPrefs* beamDialog; |
504 | void init(); | 511 | void init(); |
505 | int mDatePickerMode; | 512 | int mDatePickerMode; |
506 | bool mFlagEditDescription; | 513 | bool mFlagEditDescription; |
507 | QDateTime mLastCalendarSync; | 514 | QDateTime mLastCalendarSync; |
508 | void createPrinter(); | 515 | void createPrinter(); |
509 | 516 | ||
510 | void calendarModified( bool, Calendar * ); | 517 | void calendarModified( bool, Calendar * ); |