25 #ifndef CALENDARVIEW_H
26 #define CALENDARVIEW_H
29 #include <tqptrlist.h>
32 #include <korganizer/koeventviewer.h>
33 #include <libkcal/scheduler.h>
34 #include <tdemacros.h>
36 #include "koglobals.h"
37 #include "interfaces/korganizer/calendarviewbase.h"
46 class DateNavigatorContainer;
53 namespace KOrg {
class History;
class IncidenceChangerBase; }
54 class HTMLExportSettings;
59 class CalendarViewExtension :
public TQWidget
62 CalendarViewExtension( TQWidget *parent,
const char *name = 0 )
63 : TQWidget( parent, name ) {}
68 virtual CalendarViewExtension *create( TQWidget *parent ) = 0;
92 CalendarView( TQWidget *parent = 0,
const char *name = 0 );
98 CalendarViewVisitor() : mView( 0 ) {}
102 return incidence->
accept( *
this );
108 class CanDeleteIncidenceVisitor :
public CalendarViewVisitor
112 bool visit(
Todo *todo ) {
return mView->deleteTodo( todo ); }
113 bool visit(
Journal *journal ) {
return mView->deleteJournal( journal ); }
119 TQPair<ResourceCalendar *, TQString> viewSubResourceCalendar();
121 KOrg::History *history()
const {
return mHistory; }
126 TQWidgetStack *viewStack()
const {
return mRightFrame; }
127 TQWidget *leftFrame()
const {
return mLeftFrame; }
128 NavigatorBar *navigatorBar()
const {
return mNavigatorBar; }
129 DateNavigator *dateNavigator()
const {
return mDateNavigator; }
132 IncidenceChangerBase *incidenceChanger()
const {
return mChanger; }
145 void addExtension( CalendarViewExtension::Factory * );
153 TQString currentFilterName()
const;
159 void configChanged();
162 void categoriesChanged();
167 void closed( TQWidget * );
170 void modifiedChanged(
bool );
173 void readOnlyChanged(
bool );
176 void changeNavStringPrev(
const TQString & );
177 void changeNavStringNext(
const TQString & );
180 void organizerEventsSelected(
bool );
182 void groupEventsSelected(
bool );
187 void incidenceSelected(
Incidence *incidence,
const TQDate &date );
190 void todoSelected(
bool );
191 void subtodoSelected(
bool );
195 void dayPassed(
const TQDate & );
208 void pasteEnabled(
bool );
210 void statusMessage(
const TQString & );
212 void calendarViewExpanded(
bool );
215 void autoArchivingSettingsModified();
217 void newIncidenceChanger( IncidenceChangerBase* );
218 void exportHTML( HTMLExportSettings* );
220 void newFilterListSignal(
const TQStringList & );
221 void selectFilterSignal(
int );
222 void filterChanged();
227 void updateConfig(
const TQCString& );
230 void updateCategories();
238 bool openCalendar(
const TQString &filename,
bool merge =
false );
244 bool saveCalendar(
const TQString &filename );
250 void closeCalendar();
253 void archiveCalendar();
255 void showIncidence();
256 void editIncidence();
257 bool editIncidence(
const TQString &uid );
258 bool editIncidence(
const TQString &uid,
const TQDate &date );
259 void deleteIncidence();
269 bool addIncidence(
const TQString &ical );
280 const TQDate &startDt );
282 const TQDateTime &startDt );
284 const TQDateTime &startDt,
const TQDateTime &EndDt,
285 bool allDay =
false );
291 const TQString &summary,
292 const TQString &description = TQString(),
293 const TQStringList &attachment = TQStringList(),
294 const TQStringList &attendees = TQStringList(),
295 const TQStringList &attachmentMimetypes = TQStringList(),
296 bool inlineAttachment =
false );
299 void showIncidence(
Incidence *,
const TQDate & );
301 bool editIncidence(
Incidence *incidence,
const TQDate &date,
bool isCounter =
false );
307 void deleteIncidence(
Incidence *,
bool force =
false );
319 void pasteIncidence();
322 void deleteSubTodosIncidence (
Todo *todo );
328 void deleteTodoIncidence (
Todo *todo,
bool force =
false );
341 bool deleteIncidence(
const TQString &uid,
bool force =
false );
348 const TQDate &date );
352 void newSubTodo(
Todo * );
355 const TQString &summary,
356 const TQString &description = TQString(),
357 const TQStringList &attachments = TQStringList(),
358 const TQStringList &attendees = TQStringList(),
359 const TQStringList &attachmentMimetypes = TQStringList(),
360 bool inlineAttachment =
false,
bool createTask =
false );
365 const TQDate &date );
367 const TQString &text,
const TQDate &date = TQDate() );
370 void dissociateOccurrence(
Incidence *,
const TQDate & );
371 void dissociateFutureOccurrence(
Incidence *,
const TQDate & );
378 void checkClipboard();
389 void writeSettings();
392 void readFilterSettings( TDEConfig *config );
395 void writeFilterSettings( TDEConfig *config );
399 void changeIncidenceDisplay(
Incidence *,
int );
403 KOGlobals::WhatChanged modification );
404 void incidenceToBeDeleted(
Incidence *incidence );
406 void startMultiModify(
const TQString &text );
407 void endMultiModify();
411 void updateView(
const TQDate &start,
const TQDate &end );
414 void updateUnmanagedViews();
438 void exportICalendar();
441 void exportVCalendar();
444 void appointment_show();
450 void appointment_edit();
455 void appointment_delete();
466 bool makeSubTodosIndependent ( );
471 bool makeChildrenIndependent(
Incidence *inc );
474 void takeOverEvent();
477 void takeOverCalendar();
482 void setModified(
bool modified =
true );
487 void setReadOnly(
bool readOnly =
true );
492 void schedule_publish(
Incidence *incidence = 0 );
493 void schedule_request(
Incidence *incidence = 0 );
494 void schedule_refresh(
Incidence *incidence = 0 );
495 void schedule_cancel(
Incidence *incidence = 0 );
496 void schedule_add(
Incidence *incidence = 0 );
497 void schedule_reply(
Incidence *incidence = 0 );
498 void schedule_counter(
Incidence *incidence = 0 );
499 void schedule_declinecounter(
Incidence *incidence = 0 );
500 void schedule_forward(
Incidence *incidence = 0 );
501 void mailFreeBusy(
int daysToPublish = 30 );
502 void uploadFreeBusy();
504 void openAddressbook();
512 void showDateNavigator(
bool );
513 void showTodoView(
bool );
514 void showEventViewer(
bool );
517 void goDate(
const TQDate& date );
520 void showDate(
const TQDate &date );
532 void showLeftFrame(
bool show =
true );
536 void processMainViewSelection(
Incidence *incidence,
const TQDate &date );
537 void processTodoListSelection(
Incidence *incidence,
const TQDate &date );
539 void processIncidenceSelection(
Incidence *incidence,
const TQDate &date );
541 void purgeCompleted();
543 void slotAutoArchivingSettingsModified() { emit autoArchivingSettingsModified(); }
545 void showErrorMessage(
const TQString & );
547 void addIncidenceOn(
Incidence *,
const TQDate & );
548 void moveIncidenceTo(
Incidence *,
const TQDate & );
549 void filterActivated(
int filterNum );
551 void resourcesChanged();
559 void selectWeek(
const TQDate & );
566 void showDates(
const KCal::DateList &,
const TQDate &preferredMonth = TQDate() );
571 int msgCalModified();
576 void adaptNavigationUnits();
584 TQDate activeIncidenceDate();
596 TQDate activeDate(
bool fallbackToToday =
false );
620 KOGlobals::OccurrenceAction userAction,
621 KOGlobals::WhichOccurrences &chosenOption,
622 const TQDate &itemDate = TQDate(),
623 const bool commitToCalendar =
false );
626 void setIncidenceChanger( IncidenceChangerBase *changer );
629 int msgItemDelete(
Incidence *incidence );
631 Todo *selectedTodo();
634 void checkForFilteredChange(
Incidence *incidence );
638 void dateTimesForNewEvent( TQDateTime &startDt, TQDateTime &endDt,
bool &allDay );
640 const TQDateTime &startDtParam = TQDateTime(),
641 const TQDateTime &endDtParam = TQDateTime() ,
642 bool allDayParam =
false );
653 Incidence *incToSendToClipboard(
bool cut );
655 void calendarModified(
bool,
Calendar * );
659 bool purgeCompletedSubTodos(
Todo* todo,
bool ¬AllPurged );
664 void getIncidenceHierarchy(
Incidence *inc, Incidence::List &incidences );
666 KOrg::History *mHistory;
669 TQSplitter *mLeftSplitter;
670 TQWidget *mLeftFrame;
671 TQWidgetStack *mRightFrame;
675 NavigatorBar *mNavigatorBar;
677 DateNavigatorContainer *mDateNavigatorContainer;
680 TQPtrList<CalendarViewExtension> mExtensions;
685 DateChecker *mDateChecker;
692 TQPtrList<CalFilter> mFilters;
703 TQMap<Incidence*,KOIncidenceEditor*> mDialogList;
705 KOrg::IncidenceChangerBase *mChanger;