summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.h
Unidiff
Diffstat (limited to 'korganizer/calendarview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 664d700..fac9a9e 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -1,103 +1,105 @@
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 <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#include <KDGanttMinimizeSplitter.h>
42 43
43#include <korganizer/calendarviewbase.h> 44#include <korganizer/calendarviewbase.h>
44 45
45#include <ksyncmanager.h> 46#include <ksyncmanager.h>
46 47
47class QWidgetStack; 48class QWidgetStack;
48class QSplitter; 49class QSplitter;
49 50
50class CalPrinter; 51class CalPrinter;
51class KOFilterView; 52class KOFilterView;
52class KOViewManager; 53class KOViewManager;
53class KODialogManager; 54class KODialogManager;
54class KOTodoView; 55class KOTodoView;
55class KDateNavigator; 56class KDateNavigator;
57class DateNavigatorContainer;
56class DateNavigator; 58class DateNavigator;
57class KOIncidenceEditor; 59class KOIncidenceEditor;
58class KDatePicker; 60class KDatePicker;
59class ResourceView; 61class ResourceView;
60class KOEventEditor; 62class KOEventEditor;
61class KOTodoEditor ; 63class KOTodoEditor ;
62class KOEventViewerDialog; 64class KOEventViewerDialog;
63class KOBeamPrefs; 65class KOBeamPrefs;
64class KSyncProfile; 66class KSyncProfile;
65class AlarmDialog; 67class AlarmDialog;
66class KCal::Attendee; 68class KCal::Attendee;
67 69
68namespace KCal { class FileStorage; } 70namespace KCal { class FileStorage; }
69 71
70using namespace KCal; 72using namespace KCal;
71 73
72/** 74/**
73 This is the main calendar widget. It provides the different vies on t he 75 This is the main calendar widget. It provides the different vies on t he
74 calendar data as well as the date navigator. It also handles synchronisation 76 calendar data as well as the date navigator. It also handles synchronisation
75 of the different views and controls the different dialogs like preferences, 77 of the different views and controls the different dialogs like preferences,
76 event editor, search dialog etc. 78 event editor, search dialog etc.
77 79
78 @short main calendar view widget 80 @short main calendar view widget
79 @author Cornelius Schumacher 81 @author Cornelius Schumacher
80*/ 82*/
81class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 83class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
82{ 84{
83 Q_OBJECT 85 Q_OBJECT
84 public: 86 public:
85 /** 87 /**
86 Constructs a new calendar view widget. 88 Constructs a new calendar view widget.
87 89
88 @param calendar calendar document 90 @param calendar calendar document
89 @param parent parent window 91 @param parent parent window
90 @param name Qt internal widget object name 92 @param name Qt internal widget object name
91 */ 93 */
92 CalendarView( CalendarResources *calendar, QWidget *parent = 0, 94 CalendarView( CalendarResources *calendar, QWidget *parent = 0,
93 const char *name = 0 ); 95 const char *name = 0 );
94 CalendarView( Calendar *calendar, QWidget *parent = 0, 96 CalendarView( Calendar *calendar, QWidget *parent = 0,
95 const char *name = 0 ); 97 const char *name = 0 );
96 virtual ~CalendarView(); 98 virtual ~CalendarView();
97 99
98 Calendar *calendar() { return mCalendar; } 100 Calendar *calendar() { return mCalendar; }
99 101
100 KOViewManager *viewManager(); 102 KOViewManager *viewManager();
101 KODialogManager *dialogManager(); 103 KODialogManager *dialogManager();
102 104
103 QDate startDate(); 105 QDate startDate();
@@ -484,103 +486,103 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
484 void adaptNavigationUnits(); 486 void adaptNavigationUnits();
485 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 487 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
486 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 488 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
487 //Attendee* getYourAttendee(Event *event); 489 //Attendee* getYourAttendee(Event *event);
488 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 490 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
489 protected: 491 protected:
490 void schedule(Scheduler::Method, Incidence *incidence = 0); 492 void schedule(Scheduler::Method, Incidence *incidence = 0);
491 493
492 // returns KMsgBox::OKCandel() 494 // returns KMsgBox::OKCandel()
493 int msgItemDelete(const QString name); 495 int msgItemDelete(const QString name);
494 void showEventEditor(); 496 void showEventEditor();
495 void showTodoEditor(); 497 void showTodoEditor();
496 void writeLocale(); 498 void writeLocale();
497 Todo *selectedTodo(); 499 Todo *selectedTodo();
498 500
499 private: 501 private:
500 bool mViewerCallerIsSearchDialog; 502 bool mViewerCallerIsSearchDialog;
501 bool mBlockShowDates; 503 bool mBlockShowDates;
502 KSyncManager* mSyncManager; 504 KSyncManager* mSyncManager;
503 AlarmDialog * mAlarmDialog; 505 AlarmDialog * mAlarmDialog;
504 QString mAlarmNotification; 506 QString mAlarmNotification;
505 QString mSuspendAlarmNotification; 507 QString mSuspendAlarmNotification;
506 QTimer* mSuspendTimer; 508 QTimer* mSuspendTimer;
507 QTimer* mAlarmTimer; 509 QTimer* mAlarmTimer;
508 QTimer* mRecheckAlarmTimer; 510 QTimer* mRecheckAlarmTimer;
509 void computeAlarm( QString ); 511 void computeAlarm( QString );
510 void startAlarm( QString, QString ); 512 void startAlarm( QString, QString );
511 void setSyncEventsReadOnly(); 513 void setSyncEventsReadOnly();
512 514
513 QDateTime loadedFileVersion; 515 QDateTime loadedFileVersion;
514 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 516 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
515 void checkExternalId( Incidence * inc ); 517 void checkExternalId( Incidence * inc );
516 int mGlobalSyncMode; 518 int mGlobalSyncMode;
517 QString mCurrentSyncDevice; 519 QString mCurrentSyncDevice;
518 QString mCurrentSyncName; 520 QString mCurrentSyncName;
519 KOBeamPrefs* beamDialog; 521 KOBeamPrefs* beamDialog;
520 void init(); 522 void init();
521 int mDatePickerMode; 523 int mDatePickerMode;
522 bool mFlagEditDescription; 524 bool mFlagEditDescription;
523 QDateTime mLastCalendarSync; 525 QDateTime mLastCalendarSync;
524 void createPrinter(); 526 void createPrinter();
525 527
526 void calendarModified( bool, Calendar * ); 528 void calendarModified( bool, Calendar * );
527 529
528 CalPrinter *mCalPrinter; 530 CalPrinter *mCalPrinter;
529 531
530 QSplitter *mPanner; 532 QSplitter *mPanner;
531 QSplitter *mLeftSplitter; 533 QSplitter *mLeftSplitter;
532 QWidget *mLeftFrame; 534 KDGanttMinimizeSplitter *mLeftFrame;
533 QWidgetStack *mRightFrame; 535 QWidgetStack *mRightFrame;
534 536
535 KDatePicker* mDatePicker; 537 KDatePicker* mDatePicker;
536 QVBox* mDateFrame; 538 QVBox* mDateFrame;
537 539
538 KDateNavigator *mDateNavigator; // widget showing small month view. 540 DateNavigatorContainer *mDateNavigator; // widget showing small month view.
539 541
540 KOFilterView *mFilterView; 542 KOFilterView *mFilterView;
541 543
542 ResourceView *mResourceView; 544 ResourceView *mResourceView;
543 545
544 // calendar object for this viewing instance 546 // calendar object for this viewing instance
545 Calendar *mCalendar; 547 Calendar *mCalendar;
546 548
547 CalendarResourceManager *mResourceManager; 549 CalendarResourceManager *mResourceManager;
548 550
549 FileStorage *mStorage; 551 FileStorage *mStorage;
550 552
551 DateNavigator *mNavigator; 553 DateNavigator *mNavigator;
552 554
553 KOViewManager *mViewManager; 555 KOViewManager *mViewManager;
554 KODialogManager *mDialogManager; 556 KODialogManager *mDialogManager;
555 557
556 // Calendar filters 558 // Calendar filters
557 QPtrList<CalFilter> mFilters; 559 QPtrList<CalFilter> mFilters;
558 560
559 // various housekeeping variables. 561 // various housekeeping variables.
560 bool mModified; // flag indicating if calendar is modified 562 bool mModified; // flag indicating if calendar is modified
561 bool mReadOnly; // flag indicating if calendar is read-only 563 bool mReadOnly; // flag indicating if calendar is read-only
562 QDate mSaveSingleDate; 564 QDate mSaveSingleDate;
563 565
564 Incidence *mSelectedIncidence; 566 Incidence *mSelectedIncidence;
565 Incidence *mMoveIncidence; 567 Incidence *mMoveIncidence;
566 QDate mMoveIncidenceOldDate; 568 QDate mMoveIncidenceOldDate;
567 KOTodoView *mTodoList; 569 KOTodoView *mTodoList;
568 KOEventEditor * mEventEditor; 570 KOEventEditor * mEventEditor;
569 KOTodoEditor * mTodoEditor; 571 KOTodoEditor * mTodoEditor;
570 KOEventViewerDialog * mEventViewerDialog; 572 KOEventViewerDialog * mEventViewerDialog;
571 void keyPressEvent ( QKeyEvent *e) ; 573 void keyPressEvent ( QKeyEvent *e) ;
572 //QMap<Incidence*,KOIncidenceEditor*> mDialogList; 574 //QMap<Incidence*,KOIncidenceEditor*> mDialogList;
573}; 575};
574 576
575 577
576class CalendarViewVisitor : public Incidence::Visitor 578class CalendarViewVisitor : public Incidence::Visitor
577{ 579{
578 public: 580 public:
579 CalendarViewVisitor() : mView( 0 ) {} 581 CalendarViewVisitor() : mView( 0 ) {}
580 582
581 bool act( Incidence *incidence, CalendarView *view ) 583 bool act( Incidence *incidence, CalendarView *view )
582 { 584 {
583 mView = view; 585 mView = view;
584 return incidence->accept( *this ); 586 return incidence->accept( *this );
585 } 587 }
586 588