• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

korganizer

  • sources
  • kde-4.12
  • kdepim
  • korganizer
calendarview.h
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2000,2001,2003,2004 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6  Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License along
19  with this program; if not, write to the Free Software Foundation, Inc.,
20  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  As a special exception, permission is given to link this program
23  with any edition of Qt, and distribute the resulting executable,
24  without including the source code for Qt in the source distribution.
25 */
26 
27 #ifndef KORG_CALENDARVIEW_H
28 #define KORG_CALENDARVIEW_H
29 
30 #include "korganizer_export.h"
31 #include "interfaces/korganizer/calendarviewbase.h"
32 
33 #include <KCalCore/Incidence>
34 #include <KCalCore/Visitor>
35 #include <KCalCore/ScheduleMessage>
36 
37 #include <akonadi/calendar/itiphandler.h>
38 
39 #include <calendarsupport/messagewidget.h>
40 
41 class CalPrinter;
42 class DateChecker;
43 class DateNavigator;
44 class DateNavigatorContainer;
45 class KODialogManager;
46 class KOTodoView;
47 class KOViewManager;
48 class NavigatorBar;
49 class KOCheckableProxyModel;
50 class AkonadiCollectionView;
51 namespace KOrg {
52  class HTMLExportSettings;
53 }
54 
55 namespace CalendarSupport {
56  class IncidenceViewer;
57 }
58 
59 namespace IncidenceEditorNG {
60  class IncidenceDialog;
61 }
62 
63 namespace Akonadi {
64  class History;
65  class IncidenceChanger;
66  class CalendarClipboard;
67  class TodoPurger;
68 }
69 
70 class KVBox;
71 
72 class QSplitter;
73 class QStackedWidget;
74 
75 using namespace KOrg;
76 
77 class CalendarViewExtension : public QWidget
78 {
79  public:
80  explicit CalendarViewExtension( QWidget *parent ) : QWidget( parent ) {}
81 
82  class Factory
83  {
84  public:
85  virtual ~Factory() {}
86  virtual CalendarViewExtension *create( QWidget *parent ) = 0;
87  };
88 };
89 
99 class KORGANIZERPRIVATE_EXPORT CalendarView : public KOrg::CalendarViewBase,
100  public Akonadi::ETMCalendar::CalendarObserver
101 {
102  Q_OBJECT
103  public:
108  explicit CalendarView( QWidget *parent=0 );
109  virtual ~CalendarView();
110 
111  class CalendarViewVisitor : public KCalCore::Visitor
112  {
113  public:
114  CalendarViewVisitor() : mView( 0 )
115  {
116  }
117 
118  bool act( KCalCore::IncidenceBase::Ptr &incidence, CalendarView *view )
119  {
120  mView = view;
121  return incidence->accept( *this, incidence );
122  }
123 
124  protected:
125  CalendarView *mView;
126  };
127 
128  void setCalendar( const Akonadi::ETMCalendar::Ptr & );
129  Akonadi::ETMCalendar::Ptr calendar() const;
130 
131  void showMessage(const QString &message, KMessageWidget::MessageType);
132 
133  Akonadi::History *history() const;
134  void setCheckableProxyModel( KOCheckableProxyModel * );
135 
136  KOViewManager *viewManager() const { return mViewManager; }
137  KODialogManager *dialogManager() const { return mDialogManager; }
138 
139  QStackedWidget *viewStack() const { return mRightFrame; }
140  QWidget *leftFrame() const { return mLeftFrame; }
141  NavigatorBar *navigatorBar() const { return mNavigatorBar; }
142  DateNavigator *dateNavigator() const { return mDateNavigator; }
143  // TODO_NG
144  //IncidenceEditors::IncidenceEditor *editorDialog( const Akonadi::Item &item ) const;
145  virtual Akonadi::IncidenceChanger *incidenceChanger() const { return mChanger; }
146 
152  void updateHighlightModes();
153 
154  QDate startDate();
155  QDate endDate();
156 
157  KOrg::BaseView *currentView() const;
158  void addView( KOrg::BaseView * );
159  void showView( KOrg::BaseView * );
160 
165  void addExtension( CalendarViewExtension::Factory * );
166 
171  Akonadi::Item currentSelection();
172 
177  Akonadi::Item selectedIncidence();
178 
182  bool isFiltered() const;
183 
187  QString currentFilterName() const;
188 
189  signals:
193  void configChanged();
194 
197  void categoriesChanged();
198 
201  void categoryConfigChanged();
202 
204  void closed( QWidget * );
205 
207  void modifiedChanged( bool );
208 
210  void readOnlyChanged( bool );
211 
213  void changeNavStringPrev( const QString & );
214  void changeNavStringNext( const QString & );
215 
217  void organizerEventsSelected( bool );
219  void groupEventsSelected( bool );
224  void incidenceSelected( const Akonadi::Item &incidence, const QDate &date );
227  void todoSelected( bool );
228  void subtodoSelected( bool );
229 
232  void dayPassed( const QDate & );
233 
238  void pasteEnabled( bool );
240  void statusMessage( const QString & );
241 
242  void calendarViewExpanded( bool );
243 
245  void autoArchivingSettingsModified();
246 
247  void newIncidenceChanger( Akonadi::IncidenceChanger * );
248  void exportHTML( KOrg::HTMLExportSettings * );
249 
250  void filtersUpdated( const QStringList &, int );
251  void filterChanged();
252 
253  public slots:
256  void updateConfig();
257  void updateConfig( const QByteArray & );
258 
261  void updateCategories();
262  void handleIncidenceCreated(const Akonadi::Item &item);
263 
269  bool saveCalendar( const QString &filename );
270 
272  void archiveCalendar();
273 
274  void newEvent( const QDate & );
275 
280  void newEvent();
281 
286  void newEvent( const QDateTime &startDt );
287 
288  void newEvent( const QDateTime &startDt, const QDateTime &EndDt, bool allDay=false );
289 
294  void newEvent( const QString &summary,
295  const QString &description=QString(),
296  const QStringList &attachment=QStringList(),
297  const QStringList &attendees=QStringList(),
298  const QStringList &attachmentMimetypes=QStringList(),
299  bool inlineAttachment=false );
300  void newFloatingEvent();
301 
304  void showIncidence( const Akonadi::Item &item );
305  bool showIncidence( Akonadi::Item::Id id );
306  void showIncidence();
307 
313  void showIncidenceContext( const Akonadi::Item &incidence );
314  bool showIncidenceContext( Akonadi::Item::Id id );
315 
317  bool editIncidence( const Akonadi::Item &item, bool isCounter = false );
318  bool editIncidence( Akonadi::Item::Id id );
319  void editIncidence();
320 
328  bool deleteIncidence( const Akonadi::Item &item, bool force=false );
329  bool deleteIncidence( Akonadi::Item::Id id, bool force=false );
330  void deleteIncidence();
331 
340  bool addIncidence( const QString &ical );
341  bool addIncidence( const KCalCore::Incidence::Ptr &incidence );
342 
346  void cutIncidence( const Akonadi::Item & );
347 
351  void copyIncidence( const Akonadi::Item & );
352 
356  void pasteIncidence();
357 
359  void deleteSubTodosIncidence ( const Akonadi::Item &todo );
360 
366  void deleteTodoIncidence ( const Akonadi::Item &todo, bool force=false );
367 
369  void newTodo();
370 
372  void newTodo( const QDate &date );
373 
375  void newTodo( const Akonadi::Collection &collection );
376 
378  void newSubTodo();
379 
381  void newSubTodo( const Akonadi::Item &todo );
382 
384  void newSubTodo( const Akonadi::Collection &collection );
385 
386  void newTodo( const QString &summary, const QString &description=QString(),
387  const QStringList &attachments=QStringList(),
388  const QStringList &attendees=QStringList(),
389  const QStringList &attachmentMimetypes=QStringList(),
390  bool inlineAttachment=false );
391 
392  void newJournal();
393  void newJournal( const QDate &date );
394  void newJournal( const QString &text, const QDate &date=QDate() );
395  void newJournal( const Akonadi::Collection &collection );
396 
397  void configureCurrentView();
398 
399  void toggleAlarm( const Akonadi::Item &incidence );
400  void toggleTodoCompleted( const Akonadi::Item &incidence );
401  void copyIncidenceToResource( const Akonadi::Item &incidence, const QString &resourceId );
402  void moveIncidenceToResource( const Akonadi::Item &incidence, const QString &resourceId );
403  void dissociateOccurrences( const Akonadi::Item &incidence, const QDate &date );
404 
409  void checkClipboard();
410 
417  void readSettings();
418 
420  void writeSettings();
421 
423  void readFilterSettings( KConfig *config );
424 
426  void writeFilterSettings( KConfig *config );
427 
430  void changeIncidenceDisplay( const Akonadi::Item &incidence,
431  Akonadi::IncidenceChanger::ChangeType );
432 
433  void slotCreateFinished( int changeId,
434  const Akonadi::Item &item,
435  Akonadi::IncidenceChanger::ResultCode resultCode,
436  const QString &errorString );
437 
438  void slotModifyFinished( int changeId,
439  const Akonadi::Item &item,
440  Akonadi::IncidenceChanger::ResultCode resultCode,
441  const QString &errorString );
442 
443  void slotDeleteFinished( int changeId,
444  const QVector<Akonadi::Item::Id> &itemIdList,
445  Akonadi::IncidenceChanger::ResultCode resultCode,
446  const QString &errorString );
447 
448  void startMultiModify( const QString &text );
449  void endMultiModify();
450 
451  void updateView( const QDate &start, const QDate &end,
452  const QDate &preferredMonth, const bool updateTodos=true );
453  void updateView();
454 
455  void updateUnmanagedViews();
456 
458  void edit_cut();
459 
461  void edit_copy();
462 
464  void edit_paste();
465 
466  void onCutFinished();
467 
469  void edit_options();
470 
475  void print();
476  void printPreview();
477 
479  void exportWeb();
480 
482  void exportICalendar();
483 
485  void exportVCalendar();
486 
488  void appointment_show();
494  void appointment_edit();
495 
500  void appointment_delete();
501 
503  void todo_unsub();
504 
505  /* Frees an incidence's children from it's relation, without the view update
506  Works with any incidence type, although currently we only pass to-dos
507  */
508  bool incidence_unsub( const Akonadi::Item &item );
509 
511  bool makeSubTodosIndependent( );
512 
516  bool makeChildrenIndependent( const Akonadi::Item &item );
517 
519  void takeOverEvent();
520 
522  bool isReadOnly() const;
523 
527  void setReadOnly( bool readOnly=true );
528 
529  void eventUpdated( const Akonadi::Item &incidence );
530 
531  /* iTIP scheduling actions */
532  void schedule_publish( const Akonadi::Item &incidence=Akonadi::Item() );
533  void schedule_request( const Akonadi::Item &incidence=Akonadi::Item() );
534  void schedule_refresh( const Akonadi::Item &incidence=Akonadi::Item() );
535  void schedule_cancel( const Akonadi::Item &incidence=Akonadi::Item() );
536  void schedule_add( const Akonadi::Item &incidence=Akonadi::Item() );
537  void schedule_reply( const Akonadi::Item &incidence=Akonadi::Item() );
538  void schedule_counter( const Akonadi::Item &incidence=Akonadi::Item() );
539  void schedule_declinecounter( const Akonadi::Item &incidence=Akonadi::Item() );
540  void schedule_forward( const Akonadi::Item &incidence=Akonadi::Item() );
541  void mailFreeBusy( int daysToPublish=30 );
542  void uploadFreeBusy();
543 
544  void openAddressbook();
545 
546  void editFilters();
547 
548  void updateFilter();
549 
550  void showIntro();
551 
552  void showDateNavigator( bool );
553  void showTodoView( bool );
554  void showEventViewer( bool );
555 
557  void goDate( const QDate &date );
558 
560  void showDate( const QDate &date );
561 
563  void goToday();
564 
566  void goNext();
567 
569  void goPrevious();
570 
571  void showLeftFrame( bool show=true );
572 
573  void dialogClosing( const Akonadi::Item &incidence );
574 
575  void processMainViewSelection( const Akonadi::Item &incidence, const QDate &date );
576  void processTodoListSelection( const Akonadi::Item &incidence, const QDate &date );
577 
578  void processIncidenceSelection( const Akonadi::Item &incidence, const QDate &date );
579 
580  void purgeCompleted();
581 
582  void slotAutoArchivingSettingsModified() { emit autoArchivingSettingsModified(); }
583 
584  void showErrorMessage( const QString & );
585  void schedule( KCalCore::iTIPMethod, const Akonadi::Item &incidence );
586  void addIncidenceOn( const Akonadi::Item &incidence, const QDate & );
587  void moveIncidenceTo( const Akonadi::Item &incidence, const QDate & );
588  void filterActivated( int filterNum );
589 
590  void resourcesChanged();
591 
601  void selectWeek( const QDate &week, const QDate &preferredMonth );
602 
609  void changeFullView( bool fullView );
610 
611  protected slots:
617  void showDates( const KCalCore::DateList &, const QDate &preferredMonth = QDate() );
618 
619  public:
620  int msgCalModified();
621 
625  void adaptNavigationUnits();
626 
633  QDate activeIncidenceDate();
634 
645  QDate activeDate( bool fallbackToToday = false );
646 
647  protected:
648  int msgItemDelete( const Akonadi::Item &incidence );
649 
650  Akonadi::Item selectedTodo();
651  IncidenceEditorNG::IncidenceDialog *incidenceDialog(const Akonadi::Item &);
652 
653  void warningChangeFailed( const Akonadi::Item & );
654  void checkForFilteredChange( const Akonadi::Item &incidence );
655 
660  void dateTimesForNewEvent( QDateTime &startDt, QDateTime &endDt, bool &allDay );
661  IncidenceEditorNG::IncidenceDialog *newEventEditor( const KCalCore::Event::Ptr &event );
662 
663  bool eventFilter( QObject *watched, QEvent *event );
664 
665  private Q_SLOTS:
666  void onCheckableProxyAboutToToggle( bool newState );
667  void onCheckableProxyToggled( bool newState );
668  void onTodosPurged(bool success, int numDeleted, int numIgnored);
669 
670  private:
671  void init();
672  Akonadi::Collection selectedCollection() const;
673  Akonadi::Collection::List checkedCollections() const;
674 
675  void createPrinter();
676 
677  void dissociateOccurrence( const Akonadi::Item &incidence, const QDate & , bool futureOccurrences);
678 
685  Akonadi::Collection defaultCollection(
686  const QLatin1String &mimeType = QLatin1String( "" ) ) const;
687 
692  IncidenceEditorNG::IncidenceDialog *createIncidenceEditor(
693  const Akonadi::Item &item, const Akonadi::Collection &collection = Akonadi::Collection() );
694 
695  CalPrinter *mCalPrinter;
696  Akonadi::TodoPurger *mTodoPurger;
697 
698  QSplitter *mPanner;
699  QSplitter *mLeftSplitter;
700  QWidget *mLeftFrame;
701  QStackedWidget *mRightFrame;
702  CalendarSupport::MessageWidget *mMessageWidget;
703 
704  // This navigator bar is used when in full window month view
705  // It has nothing to do with the date navigator
706  NavigatorBar *mNavigatorBar;
707 
708  DateNavigatorContainer *mDateNavigatorContainer;
709 
710  QList<CalendarViewExtension*> mExtensions;
711 
712  Akonadi::ETMCalendar::Ptr mCalendar;
713 
714  DateNavigator *mDateNavigator;
715  DateChecker *mDateChecker;
716 
717  KVBox *mEventViewerBox;
718  CalendarSupport::IncidenceViewer *mEventViewer;
719  KOViewManager *mViewManager;
720  KODialogManager *mDialogManager;
721 
722  // Calendar filters
723  QList<KCalCore::CalFilter*> mFilters;
724  KCalCore::CalFilter *mCurrentFilter;
725 
726  // various housekeeping variables.
727  bool mReadOnly; // flag indicating if calendar is read-only
728 
729  Akonadi::Item mSelectedIncidence;
730  QDate mSaveDate;
731 
732  KOTodoView *mTodoList;
733  Akonadi::IncidenceChanger *mChanger;
734  Akonadi::ITIPHandler *mITIPHandler;
735  QList<int> mMainSplitterSizes; // temp store for main splitter sizes while left frame is hidden
736  bool mSplitterSizesValid;
737  bool mCreatingEnabled;
738 
739  Akonadi::CalendarClipboard *mCalendarClipboard;
740  KOCheckableProxyModel *mCheckableProxyModel;
741  AkonadiCollectionView *mETMCollectionView;
742 };
743 
744 #endif
calendarviewbase.h
CalendarView::CalendarViewVisitor::CalendarViewVisitor
CalendarViewVisitor()
Definition: calendarview.h:114
CalendarView::incidenceChanger
virtual Akonadi::IncidenceChanger * incidenceChanger() const
Definition: calendarview.h:145
CalendarView::viewStack
QStackedWidget * viewStack() const
Definition: calendarview.h:139
DateChecker
Definition: datechecker.h:34
DateNavigatorContainer
Definition: datenavigatorcontainer.h:38
KOrg::HTMLExportSettings
Definition: htmlexportsettings.h:12
CalendarView::CalendarViewVisitor::mView
CalendarView * mView
Definition: calendarview.h:125
QWidget
CalendarViewExtension::Factory
Definition: calendarview.h:82
CalendarView::navigatorBar
NavigatorBar * navigatorBar() const
Definition: calendarview.h:141
CalendarView::CalendarViewVisitor::act
bool act(KCalCore::IncidenceBase::Ptr &incidence, CalendarView *view)
Definition: calendarview.h:118
QObject
CalendarView::CalendarViewVisitor
Definition: calendarview.h:111
CalendarView::dialogManager
KODialogManager * dialogManager() const
Definition: calendarview.h:137
CalendarView
This is the main calendar widget.
Definition: calendarview.h:99
CalendarView::dateNavigator
DateNavigator * dateNavigator() const
Definition: calendarview.h:142
CalendarViewExtension::CalendarViewExtension
CalendarViewExtension(QWidget *parent)
Definition: calendarview.h:80
KORGANIZERPRIVATE_EXPORT
#define KORGANIZERPRIVATE_EXPORT
Definition: korganizer_export.h:35
CalendarViewExtension
Definition: calendarview.h:77
CalendarObserver
CalendarView::slotAutoArchivingSettingsModified
void slotAutoArchivingSettingsModified()
Definition: calendarview.h:582
CalendarViewExtension::Factory::~Factory
virtual ~Factory()
Definition: calendarview.h:85
CalPrinter
CalPrinter is a class for printing Calendars.
Definition: calprinter.h:46
korganizer_export.h
NavigatorBar
Definition: navigatorbar.h:33
KOrg::BaseView
This class provides an interface for all views being displayed within the main calendar view...
Definition: baseview.h:51
AkonadiCollectionView
This class provides a view of calendar resources.
Definition: akonadicollectionview.h:67
CalendarView::leftFrame
QWidget * leftFrame() const
Definition: calendarview.h:140
DateNavigator
This class controls date navigation.
Definition: datenavigator.h:41
KOCheckableProxyModel
A KCheckableProxyModel that emits a signal before and after toggling.
Definition: kocheckableproxymodel.h:37
KOTodoView
Definition: kotodoview.h:39
KOViewManager
This class manages the views of the calendar.
Definition: koviewmanager.h:61
KOrg::CalendarViewBase
interface for main calendar view widget
Definition: calendarviewbase.h:35
CalendarView::viewManager
KOViewManager * viewManager() const
Definition: calendarview.h:136
KODialogManager
This class manages the dialogs used by the calendar view.
Definition: kodialogmanager.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal