korganizer Library API Documentation

calendarview.h

00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2000,2001,2003,2004 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of Qt, and distribute the resulting executable, 00022 without including the source code for Qt in the source distribution. 00023 */ 00024 #ifndef CALENDARVIEW_H 00025 #define CALENDARVIEW_H 00026 00027 #include <qwidget.h> 00028 #include <qptrlist.h> 00029 #include <qmap.h> 00030 00031 #include <libkcal/scheduler.h> 00032 00033 #include <korganizer/calendarviewbase.h> 00034 00035 class QWidgetStack; 00036 class QSplitter; 00037 00038 class CalPrinter; 00039 class KOFilterView; 00040 class KOViewManager; 00041 class KODialogManager; 00042 class KOTodoView; 00043 class DateNavigatorContainer; 00044 class DateNavigator; 00045 class KOIncidenceEditor; 00046 class ResourceView; 00047 class NavigatorBar; 00048 class DateChecker; 00049 00050 namespace KOrg { class History; } 00051 00052 using namespace KCal; 00053 00054 class CalendarViewExtension : public QWidget 00055 { 00056 public: 00057 CalendarViewExtension( QWidget *parent, const char *name = 0 ) 00058 : QWidget( parent, name ) {} 00059 00060 class Factory 00061 { 00062 public: 00063 virtual CalendarViewExtension *create( QWidget *parent ) = 0; 00064 }; 00065 }; 00066 00076 class CalendarView : public KOrg::CalendarViewBase, public Calendar::Observer 00077 { 00078 Q_OBJECT 00079 public: 00086 CalendarView( QWidget *parent = 0, const char *name = 0 ); 00087 virtual ~CalendarView(); 00088 00089 void setCalendar( Calendar * ); 00090 Calendar *calendar(); 00091 00092 KOrg::History *history() { return mHistory; } 00093 00094 KOViewManager *viewManager(); 00095 KODialogManager *dialogManager(); 00096 00097 QDate startDate(); 00098 QDate endDate(); 00099 00100 QWidgetStack *viewStack(); 00101 QWidget *leftFrame(); 00102 NavigatorBar *navigatorBar(); 00103 KOIncidenceEditor *editorDialog( Incidence* ); 00104 00105 DateNavigator *dateNavigator(); 00106 00107 void addView( KOrg::BaseView * ); 00108 void showView( KOrg::BaseView * ); 00109 00114 void addExtension( CalendarViewExtension::Factory * ); 00115 00117 Incidence *currentSelection(); 00120 Incidence *selectedIncidence(); 00121 00122 signals: 00126 void configChanged(); 00129 void categoriesChanged(); 00132 void closingDown(); 00134 void closed( QWidget * ); 00135 00137 void modifiedChanged( bool ); 00138 00140 void readOnlyChanged( bool ); 00141 00143 void changeNavStringPrev( const QString & ); 00144 void changeNavStringNext( const QString & ); 00145 00147 void organizerEventsSelected( bool ); 00149 void groupEventsSelected( bool ); 00154 void incidenceSelected( Incidence * ); 00157 void todoSelected( bool ); 00158 void subtodoSelected( bool ); 00159 00162 void dayPassed( QDate ); 00163 00164 00169 void pasteEnabled( bool ); 00170 00172 void numIncomingChanged( int ); 00173 00175 void numOutgoingChanged( int ); 00176 00178 void statusMessage( const QString & ); 00179 00180 void calendarViewExpanded( bool ); 00181 00183 void autoArchivingSettingsModified(); 00184 00185 public slots: 00188 void updateConfig(); 00191 void updateCategories(); 00192 00193 00199 bool openCalendar( const QString &filename, bool merge = false ); 00200 00205 bool saveCalendar( const QString &filename ); 00206 00211 void closeCalendar(); 00212 00214 void archiveCalendar(); 00215 00216 void showIncidence(); 00217 void editIncidence(); 00218 bool editIncidence( const QString& uid ); 00219 void deleteIncidence(); 00220 00223 void newEvent( QDateTime, QDateTime, bool allDay = false ); 00224 void newEvent( QDateTime fh ); 00225 void newEvent( QDate dt ); 00228 void newEvent(); 00232 void newEvent( const QString & ); 00233 void newEvent( const QString &summary, const QString &description, 00234 const QString &attachment ); 00235 void newEvent( const QString &summary, const QString &description, 00236 const QString &attachment, const QStringList &attendees ); 00237 void newFloatingEvent(); 00238 00240 void showIncidence( Incidence * ); 00242 bool editIncidence( Incidence * ); 00244 void deleteIncidence( Incidence * ); 00245 00247 void editJournal( Journal * ); 00249 void deleteJournal( Journal * ); 00251 void showJournal( Journal * ); 00252 00254 void editEvent( Event * ); 00256 void deleteEvent( Event * ); 00261 bool deleteEvent( const QString &uid ); 00263 void showEvent( Event * ); 00264 00266 void editTodo( Todo * ); 00268 void showTodo( Todo * ); 00270 void newTodo(); 00272 void newTodo( QDate date ); 00274 void newSubTodo(); 00276 void newSubTodo( Todo * ); 00278 void deleteTodo( Todo * ); 00280 void recurTodo( Todo * ); 00281 00282 void newTodo( const QString & ); 00283 void newTodo( const QString &summary, const QString &description, 00284 const QString &attachment ); 00285 void newTodo( const QString &summary, const QString &description, 00286 const QString &attachment, const QStringList &attendees ); 00287 00288 void toggleAlarm( Incidence * ); 00289 00294 void checkClipboard(); 00295 00302 void readSettings(); 00303 00305 void writeSettings(); 00306 00308 void readFilterSettings( KConfig *config ); 00309 00311 void writeFilterSettings( KConfig *config ); 00312 00315 void changeIncidenceDisplay( Incidence *, int ); 00316 00317 void incidenceAdded( Incidence * ); 00318 void incidenceChanged( Incidence *oldEvent, Incidence *newEvent ); 00319 void incidenceChanged( Incidence *oldEvent, Incidence *newEvent, int what ); 00320 void incidenceToBeDeleted( Incidence *incidence ); 00321 void incidenceDeleted( Incidence * ); 00322 void startMultiModify( const QString &text ); 00323 void endMultiModify(); 00324 00325 void editCanceled( Incidence * ); 00326 00327 void updateView( const QDate &start, const QDate &end ); 00328 void updateView(); 00329 00330 void updateUnmanagedViews(); 00331 00333 void edit_cut(); 00334 00336 void edit_copy(); 00337 00339 void edit_paste(); 00340 00342 void edit_options(); 00343 00348 void print(); 00349 void printSetup(); 00350 void printPreview(); 00351 00353 void exportICalendar(); 00354 00356 void exportVCalendar(); 00357 00359 void appointment_show(); 00365 void appointment_edit(); 00370 void appointment_delete(); 00371 00374 void action_mail(); 00375 00376 /* frees a subtodo from it's relation */ 00377 void todo_unsub(); 00378 00380 void takeOverEvent(); 00381 00383 void takeOverCalendar(); 00384 00386 bool isModified(); 00388 void setModified( bool modified = true ); 00389 00391 bool isReadOnly(); 00393 void setReadOnly( bool readOnly = true ); 00394 00395 void eventUpdated( Incidence * ); 00396 00397 /* iTIP scheduling actions */ 00398 void schedule_publish( Incidence *incidence = 0 ); 00399 void schedule_request( Incidence *incidence = 0 ); 00400 void schedule_refresh( Incidence *incidence = 0 ); 00401 void schedule_cancel( Incidence *incidence = 0 ); 00402 void schedule_add( Incidence *incidence = 0 ); 00403 void schedule_reply( Incidence *incidence = 0 ); 00404 void schedule_counter( Incidence *incidence = 0 ); 00405 void schedule_declinecounter( Incidence *incidence = 0 ); 00406 void mailFreeBusy( int daysToPublish = 30 ); 00407 void uploadFreeBusy(); 00408 00409 void openAddressbook(); 00410 00411 void editFilters(); 00412 00413 void showFilter( bool visible ); 00414 void updateFilter(); 00415 void filterEdited(); 00416 00417 void showIntro(); 00418 00420 void goDate( const QDate& date ); 00421 00423 void goToday(); 00424 00426 void goNext(); 00427 00429 void goPrevious(); 00430 00431 void toggleExpand(); 00432 void showLeftFrame( bool show = true ); 00433 00434 void dialogClosing( Incidence * ); 00435 00437 void lookForIncomingMessages(); 00439 void lookForOutgoingMessages(); 00440 00441 void processMainViewSelection( Incidence * ); 00442 void processTodoListSelection( Incidence * ); 00443 00444 void processIncidenceSelection( Incidence * ); 00445 00446 void purgeCompleted(); 00447 00448 void slotCalendarChanged(); 00449 00450 void slotAutoArchivingSettingsModified() { emit autoArchivingSettingsModified(); } 00451 00452 void importQtopia( const QString &categoriesFile, 00453 const QString &datebookFile, 00454 const QString &tasklistFile ); 00455 00456 void showErrorMessage( const QString & ); 00457 00458 protected slots: 00460 void showDates( const KCal::DateList & ); 00461 00462 public: 00463 // show a standard warning 00464 // returns KMsgBox::yesNoCancel() 00465 int msgCalModified(); 00466 00470 void adaptNavigationUnits(); 00471 00472 //Attendee* getYourAttendee( Event *event ); 00473 00474 protected: 00475 void schedule( Scheduler::Method, Incidence *incidence = 0 ); 00476 00477 // returns KMsgBox::OKCandel() 00478 int msgItemDelete(); 00479 00480 Todo *selectedTodo(); 00481 00482 void warningChangeFailed( Incidence * ); 00483 00484 private: 00485 void init(); 00486 00487 void createPrinter(); 00488 00489 void calendarModified( bool, Calendar * ); 00490 // Helper function for purgeCompleted that recursively purges a todo and 00491 // its subitems. If it cannot delete a completed todo (because it has 00492 // uncompleted subitems), notAllPurged is set to true. 00493 bool purgeCompletedSubTodos( Todo* todo, bool &notAllPurged ); 00494 00495 KOrg::History *mHistory; 00496 00497 CalPrinter *mCalPrinter; 00498 00499 QSplitter *mPanner; 00500 QSplitter *mLeftSplitter; 00501 QWidget *mLeftFrame; 00502 QWidgetStack *mRightFrame; 00503 00504 NavigatorBar *mNavigatorBar; 00505 00506 DateNavigatorContainer *mDateNavigator; 00507 00508 KOFilterView *mFilterView; 00509 00510 QPtrList<CalendarViewExtension> mExtensions; 00511 00512 Calendar *mCalendar; 00513 00514 DateNavigator *mNavigator; 00515 DateChecker *mDateChecker; 00516 00517 KOViewManager *mViewManager; 00518 KODialogManager *mDialogManager; 00519 00520 // Calendar filters 00521 QPtrList<CalFilter> mFilters; 00522 00523 // various housekeeping variables. 00524 bool mModified; // flag indicating if calendar is modified 00525 bool mReadOnly; // flag indicating if calendar is read-only 00526 QDate mSaveSingleDate; 00527 00528 Incidence *mSelectedIncidence; 00529 00530 KOTodoView *mTodoList; 00531 QMap<Incidence*,KOIncidenceEditor*> mDialogList; 00532 }; 00533 00534 00535 class CalendarViewVisitor : public Incidence::Visitor 00536 { 00537 public: 00538 CalendarViewVisitor() : mView( 0 ) {} 00539 00540 bool act( Incidence *incidence, CalendarView *view ) 00541 { 00542 mView = view; 00543 return incidence->accept( *this ); 00544 } 00545 00546 protected: 00547 CalendarView *mView; 00548 }; 00549 00550 class ShowIncidenceVisitor : public CalendarViewVisitor 00551 { 00552 protected: 00553 bool visit( Event *event ) { mView->showEvent( event ); return true; } 00554 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } 00555 bool visit( Journal *journal ) { mView->showJournal( journal ); return true; } 00556 }; 00557 00558 class EditIncidenceVisitor : public CalendarViewVisitor 00559 { 00560 protected: 00561 bool visit( Event *event ) { mView->editEvent( event ); return true; } 00562 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } 00563 bool visit( Journal *journal ) { mView->editJournal( journal ); return true; } 00564 }; 00565 00566 class DeleteIncidenceVisitor : public CalendarViewVisitor 00567 { 00568 protected: 00569 bool visit( Event *event ) { mView->deleteEvent( event ); return true; } 00570 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } 00571 bool visit( Journal *journal ) { mView->deleteJournal( journal ); return true; } 00572 }; 00573 00574 00575 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 19:46:55 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003