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

KCal Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcal
calendarresources.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcal library.
3 
4  Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
31 #ifndef KCAL_CALENDARRESOURCES_H
32 #define KCAL_CALENDARRESOURCES_H
33 
34 #include <QtCore/QMap>
35 
36 #include "calendar.h"
37 #include "exceptions.h"
38 #include "resourcecalendar.h"
39 
40 #include "kcal_export.h"
41 
42 class QWidget;
43 
44 namespace KCal {
45 
57 class KCAL_DEPRECATED_EXPORT CalendarResources
58  : public Calendar, public KRES::ManagerObserver<ResourceCalendar>
59 {
60  Q_OBJECT
61  public:
65  class DestinationPolicy
66  {
67  public:
73  explicit DestinationPolicy( CalendarResourceManager *manager, QWidget *parent = 0 );
74 
78  virtual ~DestinationPolicy();
79 
83  virtual QWidget *parent();
84 
89  virtual void setParent( QWidget *parent );
90 
95  virtual ResourceCalendar *destination( Incidence *incidence ) = 0;
96 
101  bool hasCalendarResources();
102  protected:
106  CalendarResourceManager *resourceManager();
107 
108  private:
109  //@cond PRIVATE
110  Q_DISABLE_COPY( DestinationPolicy )
111  class Private;
112  Private *d;
113  //@endcond
114  };
115 
119  class StandardDestinationPolicy : public DestinationPolicy
120  {
121  public:
127  explicit StandardDestinationPolicy( CalendarResourceManager *manager, QWidget *parent = 0 );
128 
132  virtual ~StandardDestinationPolicy();
133 
138  ResourceCalendar *destination( Incidence *incidence );
139 
140  private:
141  //@cond PRIVATE
142  Q_DISABLE_COPY( StandardDestinationPolicy )
143  class Private;
144  Private *d;
145  //@endcond
146  };
147 
151  class AskDestinationPolicy : public DestinationPolicy
152  {
153  public:
159  explicit AskDestinationPolicy( CalendarResourceManager *manager, QWidget *parent = 0 );
160 
164  virtual ~AskDestinationPolicy();
165 
170  ResourceCalendar *destination( Incidence *incidence );
171  private:
172  //@cond PRIVATE
173  Q_DISABLE_COPY( AskDestinationPolicy )
174  class Private;
175  Private *d;
176  //@endcond
177  };
178 
182  class Ticket
183  {
184  friend class CalendarResources;
185 
186  public:
190  ResourceCalendar *resource() const;
191 
195  ~Ticket();
196 
197  private:
202  Ticket( ResourceCalendar *resource );
203 
204  //@cond PRIVATE
205  Q_DISABLE_COPY( Ticket )
206  class Private;
207  Private *d;
208  //@endcond
209  };
210 
221  CalendarResources(
222  const KDateTime::Spec &timeSpec,
223  const QString &family = QLatin1String( "calendar" ) );
224 
234  CalendarResources(
235  const QString &timeZoneId,
236  const QString &family = QLatin1String( "calendar" ) );
237 
241  ~CalendarResources();
242 
247  void clearException();
248 
254  ErrorFormat *exception();
255 
261  void load();
262 
267  bool reload();
268 
273  void close();
274 
288  virtual bool save( Ticket *ticket, Incidence *incidence = 0 );
289 
294  bool save();
295 
300  bool isSaving();
301 
305  CalendarResourceManager *resourceManager() const;
306 
313  ResourceCalendar *resource( Incidence *incidence );
314 
323  void readConfig( KConfig *config = 0 );
324 
329  void setStandardDestinationPolicy();
330 
335  void setAskDestinationPolicy();
336 
341  bool hasCalendarResources();
342 
355  QWidget *dialogParentWidget();
356 
366  void setDialogParentWidget( QWidget *parent );
367 
379  Ticket *requestSaveTicket( ResourceCalendar *resource );
380 
387  virtual void releaseSaveTicket( Ticket *ticket );
388 
400  void resourceAdded( ResourceCalendar *resource );
401 
402  // Incidence Specific Methods //
403 
412  bool addIncidence( Incidence *incidence );
413 
422  bool addIncidence( Incidence *incidence, ResourceCalendar *resource );
423 
428  bool beginChange( Incidence *incidence );
429 
434  bool endChange( Incidence *incidence );
435 
436  // Event Specific Methods //
437 
442  bool addEvent( Event *event );
443 
455  bool addEvent( Event *event, ResourceCalendar *resource );
456 
461  bool deleteEvent( Event *event );
462 
467  void deleteAllEvents();
468 
473  Event::List rawEvents(
474  EventSortField sortField = EventSortUnsorted,
475  SortDirection sortDirection = SortDirectionAscending );
476 
481  Event::List rawEventsForDate( const KDateTime &dt );
482 
487  Event::List rawEvents( const QDate &start, const QDate &end,
488  const KDateTime::Spec &timeSpec = KDateTime::Spec(),
489  bool inclusive = false );
490 
502  Event::List rawEventsForDate( const QDate &date,
503  const KDateTime::Spec &timeSpec = KDateTime::Spec(),
504  EventSortField sortField = EventSortUnsorted,
505  SortDirection sortDirection = SortDirectionAscending );
506 
511  Event *event( const QString &uid );
512 
513  // Todo Specific Methods //
514 
519  bool addTodo( Todo *todo );
520 
532  bool addTodo( Todo *todo, ResourceCalendar *resource );
533 
538  bool deleteTodo( Todo *todo );
539 
544  void deleteAllTodos();
545 
550  Todo::List rawTodos( TodoSortField sortField = TodoSortUnsorted,
551  SortDirection sortDirection = SortDirectionAscending );
552 
557  Todo::List rawTodosForDate( const QDate &date );
558 
563  Todo *todo( const QString &uid );
564 
565  // Journal Specific Methods //
566 
571  bool addJournal( Journal *journal );
572 
584  bool addJournal( Journal *journal, ResourceCalendar *resource );
585 
590  bool deleteJournal( Journal *journal );
591 
596  void deleteAllJournals();
597 
602  Journal::List rawJournals(
603  JournalSortField sortField = JournalSortUnsorted,
604  SortDirection sortDirection = SortDirectionAscending );
605 
610  Journal::List rawJournalsForDate( const QDate &date );
611 
616  Journal *journal( const QString &uid );
617 
618  // Alarm Specific Methods //
619 
624  Alarm::List alarms( const KDateTime &from, const KDateTime &to );
625 
633  Alarm::List alarmsTo( const KDateTime &to );
634 
635  using QObject::event; // prevent warning about hidden virtual method
636 
637  Q_SIGNALS:
644  void signalResourceModified( ResourceCalendar *resource );
645 
652  void signalResourceAdded( ResourceCalendar *resource );
653 
660  void signalResourceDeleted( ResourceCalendar *resource );
661 
666  void signalErrorMessage( const QString &err );
667 
668  protected:
673  void connectResource( ResourceCalendar *resource );
674 
681  void resourceModified( ResourceCalendar *resource );
682 
688  void resourceDeleted( ResourceCalendar *resource );
689 
694  virtual void doSetTimeSpec( const KDateTime::Spec &timeSpec );
695 
703  int incrementChangeCount( ResourceCalendar *resource );
704 
712  int decrementChangeCount( ResourceCalendar *resource );
713 
714  protected Q_SLOTS:
723  void slotLoadError( ResourceCalendar *resource, const QString &err );
724 
733  void slotSaveError( ResourceCalendar *resource, const QString &err );
734 
741  void beginAddingIncidences();
742 
747  void endAddingIncidences();
748 
749  private:
750  //@cond PRIVATE
751  Q_DISABLE_COPY( CalendarResources )
752  class Private;
753  Private *d;
754  //@endcond
755 };
756 
757 }
758 
759 #endif
KCal::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:44
KCal::Calendar
Represents the main calendar class.
Definition: calendar.h:119
KCal::CalendarResources
This class provides a Calendar which is composed of other Calendars known as "Resources".
Definition: calendarresources.h:57
KCal::Event
This class provides an Event in the sense of RFC2445.
Definition: event.h:41
KCal::ResourceCalendar
This class provides the interfaces for a calendar resource.
Definition: resourcecalendar.h:50
KRES::ManagerObserver
calendar.h
This file is part of the API for handling calendar data and defines the Calendar class.
KCal::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:68
KCal::ListBase
This class provides a template for lists of pointers.
Definition: listbase.h:44
exceptions.h
This file is part of the API for handling calendar data and defines the Exception and ErrorFormat cla...
KCal::Journal
Provides a Journal in the sense of RFC2445.
Definition: journal.h:43
KCal::ErrorFormat
Calendar format related error class.
Definition: exceptions.h:82
KRES::Manager
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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