summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.h
Unidiff
Diffstat (limited to 'korganizer/calendarview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.h32
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
@@ -3,152 +3,154 @@
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
50class QWidgetStack; 52class Q3WidgetStack;
51class QSplitter; 53class QSplitter;
52class KopiCalendarFile; 54class KopiCalendarFile;
53class CalPrinter; 55class CalPrinter;
54class KOFilterView; 56class KOFilterView;
55class KOCalEditView; 57class KOCalEditView;
56class KOViewManager; 58class KOViewManager;
57class KODialogManager; 59class KODialogManager;
58class KOTodoView; 60class KOTodoView;
59class KDateNavigator; 61class KDateNavigator;
60class DateNavigatorContainer; 62class DateNavigatorContainer;
61class DateNavigator; 63class DateNavigator;
62class KOIncidenceEditor; 64class KOIncidenceEditor;
63class KDatePicker; 65class KDatePicker;
64class ResourceView; 66class ResourceView;
65class KOEventEditor; 67class KOEventEditor;
66class KOTodoEditor ; 68class KOTodoEditor ;
67class KOEventViewerDialog; 69class KOEventViewerDialog;
68class KOBeamPrefs; 70class KOBeamPrefs;
69class KSyncProfile; 71class KSyncProfile;
70class AlarmDialog; 72class AlarmDialog;
71class KCal::Attendee; 73class KCal::Attendee;
72 74
73namespace KCal { class FileStorage; } 75namespace KCal { class FileStorage; }
74 76
75using namespace KCal; 77using 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
90class MissedAlarmTextBrowser : public QTextBrowser { 92class 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
105class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 107class 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();
@@ -420,49 +422,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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();
@@ -474,49 +476,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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()
@@ -554,92 +556,92 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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
640class CalendarViewVisitor : public Incidence::Visitor 642class 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 )