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

KCal Library

  • kcal
resourcecalendar.h
1 /*
2  This file is part of the kcal library.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
6  Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
7  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
24 
25 #ifndef KCAL_RESOURCECALENDAR_H
26 #define KCAL_RESOURCECALENDAR_H
27 
28 #include "alarm.h"
29 #include "todo.h"
30 #include "event.h"
31 #include "journal.h"
32 #include "calendar.h"
33 #include "exceptions.h"
34 
35 #include "kresources/resource.h"
36 #include "kresources/manager.h"
37 #include "kabc/lock.h"
38 
39 #include <kdatetime.h>
40 #include <kconfig.h>
41 
42 #include <QtCore/QString>
43 
44 namespace KCal {
45 
50 class KCAL_DEPRECATED_EXPORT ResourceCalendar : public KRES::Resource
51 {
52  Q_OBJECT
53  public:
54  ResourceCalendar();
55  explicit ResourceCalendar( const KConfigGroup &group );
56  virtual ~ResourceCalendar();
57 
58  bool isResolveConflictSet() const;
59  void setResolveConflict( bool b );
60 
61  virtual void writeConfig( KConfigGroup &group );
62 
67  virtual QString infoText() const;
68 
88  virtual bool load();
89 
107  bool save( Incidence *incidence = 0 );
108 
118  bool save( QString &err, Incidence *incidence = 0 );
119 
124  virtual bool isSaving();
125 
133  void setInhibitSave( bool inhibit );
134 
138  bool saveInhibited() const;
139 
143  virtual KABC::Lock *lock() = 0;
144 
148  virtual bool addIncidence( Incidence * );
149 
153  virtual bool deleteIncidence( Incidence * );
154 
161  Incidence *incidence( const QString &uid );
162 
166  virtual bool addEvent( Event *event ) = 0;
167 
171  virtual bool deleteEvent( Event * ) = 0;
172 
176  virtual void deleteAllEvents() = 0;
177 
181  virtual Event *event( const QString &uid ) = 0;
182 
190  virtual Event::List rawEvents(
191  EventSortField sortField = EventSortUnsorted,
192  SortDirection sortDirection = SortDirectionAscending ) = 0;
193 
203  virtual Event::List rawEventsForDate(
204  const QDate &date,
205  const KDateTime::Spec &timeSpec = KDateTime::Spec(),
206  EventSortField sortField = EventSortUnsorted,
207  SortDirection sortDirection = SortDirectionAscending ) = 0;
208 
212  virtual Event::List rawEventsForDate( const KDateTime &dt ) = 0;
213 
224  virtual Event::List rawEvents(
225  const QDate &start, const QDate &end,
226  const KDateTime::Spec &timeSpec = KDateTime::Spec(),
227  bool inclusive = false ) = 0;
228 
251  virtual bool setValue( const QString &key, const QString &value );
252 
253  Q_SIGNALS:
260  void resourceChanged( ResourceCalendar * );
261 
266  void resourceLoaded( ResourceCalendar * );
267 
272  void resourceSaved( ResourceCalendar * );
273 
277  void resourceLoadError( ResourceCalendar *, const QString &error );
278 
282  void resourceSaveError( ResourceCalendar *, const QString &error );
283 
287  void signalSubresourceAdded( ResourceCalendar *, const QString &type,
288  const QString &subresource, const QString &label );
289 
293  void signalSubresourceRemoved( ResourceCalendar *, const QString &,
294  const QString & );
295 
296  public:
300  virtual bool addTodo( Todo *todo ) = 0;
301 
305  virtual bool deleteTodo( Todo * ) = 0;
306 
310  virtual void deleteAllTodos() = 0;
311 
318  virtual Todo *todo( const QString &uid ) = 0;
319 
323  virtual Todo::List rawTodos(
324  TodoSortField sortField = TodoSortUnsorted,
325  SortDirection sortDirection = SortDirectionAscending ) = 0;
326 
330  virtual Todo::List rawTodosForDate( const QDate &date ) = 0;
331 
335  virtual bool addJournal( Journal * ) = 0;
336 
340  virtual bool deleteJournal( Journal * ) = 0;
341 
345  virtual void deleteAllJournals() = 0;
346 
350  virtual Journal *journal( const QString &uid ) = 0;
351 
355  virtual Journal::List rawJournals(
356  JournalSortField sortField = JournalSortUnsorted,
357  SortDirection sortDirection = SortDirectionAscending ) = 0;
358 
362  virtual Journal::List rawJournalsForDate( const QDate &date ) = 0;
363 
367  virtual Alarm::List alarms( const KDateTime &from,
368  const KDateTime &to ) = 0;
369 
373  virtual Alarm::List alarmsTo( const KDateTime &to ) = 0;
374 
376  Incidence::List rawIncidences();
377 
384  virtual void setTimeSpec( const KDateTime::Spec &timeSpec ) = 0;
385 
391  virtual KDateTime::Spec timeSpec() const = 0;
392 
402  virtual void setTimeZoneId( const QString &timeZoneId ) = 0;
403 
411  virtual QString timeZoneId() const = 0;
412 
427  virtual void shiftTimes( const KDateTime::Spec &oldSpec,
428  const KDateTime::Spec &newSpec ) = 0;
429 
435  virtual QStringList subresources() const;
436 
440  virtual bool canHaveSubresources() const;
441 
445  virtual bool subresourceActive( const QString &resource ) const;
446 
450  virtual QString labelForSubresource( const QString &resource ) const;
451 
460  virtual QString subresourceIdentifier( Incidence *incidence );
461 
462  public Q_SLOTS:
466  virtual void setSubresourceActive( const QString &resource, bool active );
467 
471  virtual bool removeSubresource( const QString &resource );
472 
477  virtual bool addSubresource( const QString &resource, const QString &parent );
478 
483  virtual QString subresourceType( const QString &resource );
484 
485  protected:
489  virtual bool doLoad( bool syncCache ) = 0;
490 
494  virtual bool doSave( bool syncCache ) = 0;
495 
501  virtual bool doSave( bool syncCache, Incidence * );
502 
506  virtual void addInfoText( QString & ) const {}
507 
511  void loadError( const QString &errorMessage = QString() );
512 
516  void saveError( const QString &errorMessage = QString() );
517 
518  bool receivedLoadError() const;
519  void setReceivedLoadError( bool b );
520  bool receivedSaveError() const;
521  void setReceivedSaveError( bool b );
522 
529  void setNoReadOnlyOnLoad( bool noReadOnly );
530 
535  bool noReadOnlyOnLoad() const;
536 
537  using QObject::event; // prevent warning about hidden virtual method
538 
539  private:
540  //@cond PRIVATE
541  Q_DISABLE_COPY( ResourceCalendar )
542 
543  class Private;
544  Private *const d;
545  //@endcond
546 };
547 
549 typedef KRES::Manager<ResourceCalendar> CalendarResourceManager;
550 
551 }
552 
553 #endif
alarm.h
This file is part of the API for handling calendar data and defines the Alarm class.
calendar.h
This file is part of the API for handling calendar data and defines the Calendar class.
KCal::TodoSortField
TodoSortField
Calendar Todo sort keys.
Definition: calendar.h:79
KCal::JournalSortField
JournalSortField
Calendar Journal sort keys.
Definition: calendar.h:91
KCal::EventSortField
EventSortField
Calendar Event sort keys.
Definition: calendar.h:69
KCal::SortDirection
SortDirection
Calendar Incidence sort directions.
Definition: calendar.h:61
KCal::Event
This class provides an Event in the sense of RFC2445.
Definition: event.h:42
KCal::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:70
KCal::Journal
Provides a Journal in the sense of RFC2445.
Definition: journal.h:44
KCal::ListBase
This class provides a template for lists of pointers.
Definition: listbase.h:45
KCal::ResourceCalendar
This class provides the interfaces for a calendar resource.
Definition: resourcecalendar.h:51
KCal::ResourceCalendar::deleteAllJournals
virtual void deleteAllJournals()=0
Removes all Journals from the calendar.
KCal::ResourceCalendar::resourceSaveError
void resourceSaveError(ResourceCalendar *, const QString &error)
This signal is emitted when an error occurs during saving.
KCal::ResourceCalendar::doLoad
virtual bool doLoad(bool syncCache)=0
Do the actual loading of the resource data.
KCal::ResourceCalendar::addTodo
virtual bool addTodo(Todo *todo)=0
Add a todo to the todolist.
KCal::ResourceCalendar::rawEventsForDate
virtual Event::List rawEventsForDate(const QDate &date, const KDateTime::Spec &timeSpec=KDateTime::Spec(), EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Builds and then returns a list of all events that match the date specified.
KCal::ResourceCalendar::todo
virtual Todo * todo(const QString &uid)=0
Searches todolist for an event with this unique id.
KCal::ResourceCalendar::rawEvents
virtual Event::List rawEvents(const QDate &start, const QDate &end, const KDateTime::Spec &timeSpec=KDateTime::Spec(), bool inclusive=false)=0
Get unfiltered events in a range of dates.
KCal::ResourceCalendar::event
virtual Event * event(const QString &uid)=0
Retrieves an event on the basis of the unique string ID.
KCal::ResourceCalendar::addEvent
virtual bool addEvent(Event *event)=0
Add event to resource.
KCal::ResourceCalendar::resourceLoadError
void resourceLoadError(ResourceCalendar *, const QString &error)
This signal is emitted when an error occurs during loading.
KCal::ResourceCalendar::resourceLoaded
void resourceLoaded(ResourceCalendar *)
This signal is emitted when loading data into the resource has been finished.
KCal::ResourceCalendar::deleteJournal
virtual bool deleteJournal(Journal *)=0
Remove a Journal entry from calendar.
KCal::ResourceCalendar::deleteAllEvents
virtual void deleteAllEvents()=0
Removes all Events from the calendar.
KCal::ResourceCalendar::rawEvents
virtual Event::List rawEvents(EventSortField sortField=EventSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Return unfiltered list of all events in calendar.
KCal::ResourceCalendar::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)=0
Shifts the times of all incidences so that they appear at the same clock time as before but in a new ...
KCal::ResourceCalendar::addInfoText
virtual void addInfoText(QString &) const
Add info text for concrete resources.
Definition: resourcecalendar.h:506
KCal::ResourceCalendar::addJournal
virtual bool addJournal(Journal *)=0
Add a Journal entry to the resource.
KCal::ResourceCalendar::journal
virtual Journal * journal(const QString &uid)=0
Return Journal with given unique id.
KCal::ResourceCalendar::deleteEvent
virtual bool deleteEvent(Event *)=0
Delete event from this resource.
KCal::ResourceCalendar::rawTodos
virtual Todo::List rawTodos(TodoSortField sortField=TodoSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Return list of all todos.
KCal::ResourceCalendar::resourceSaved
void resourceSaved(ResourceCalendar *)
This signal is emitted when saving the data of the resource has been finished.
KCal::ResourceCalendar::setTimeSpec
virtual void setTimeSpec(const KDateTime::Spec &timeSpec)=0
Sets the default and viewing time specification for the calendar.
KCal::ResourceCalendar::deleteAllTodos
virtual void deleteAllTodos()=0
Removes all To-dos from the calendar.
KCal::ResourceCalendar::setTimeZoneId
virtual void setTimeZoneId(const QString &timeZoneId)=0
Sets the time zone ID for the Calendar.
KCal::ResourceCalendar::resourceChanged
void resourceChanged(ResourceCalendar *)
This signal is emitted when the data in the resource has changed.
KCal::ResourceCalendar::lock
virtual KABC::Lock * lock()=0
Return object for locking the resource.
KCal::ResourceCalendar::rawJournalsForDate
virtual Journal::List rawJournalsForDate(const QDate &date)=0
Returns list of journals for the given date.
KCal::ResourceCalendar::signalSubresourceRemoved
void signalSubresourceRemoved(ResourceCalendar *, const QString &, const QString &)
This signal is emitted when a subresource is removed.
KCal::ResourceCalendar::rawJournals
virtual Journal::List rawJournals(JournalSortField sortField=JournalSortUnsorted, SortDirection sortDirection=SortDirectionAscending)=0
Return list of all journals.
KCal::ResourceCalendar::rawTodosForDate
virtual Todo::List rawTodosForDate(const QDate &date)=0
Returns list of todos due on the specified date.
KCal::ResourceCalendar::signalSubresourceAdded
void signalSubresourceAdded(ResourceCalendar *, const QString &type, const QString &subresource, const QString &label)
This signal is emitted when a subresource is added.
KCal::ResourceCalendar::timeZoneId
virtual QString timeZoneId() const =0
Returns the time zone ID used for creating or modifying incidences in the calendar.
KCal::ResourceCalendar::timeSpec
virtual KDateTime::Spec timeSpec() const =0
Get the viewing time specification (time zone etc.) for the calendar.
KCal::ResourceCalendar::doSave
virtual bool doSave(bool syncCache)=0
Do the actual saving of the resource data.
KCal::ResourceCalendar::rawEventsForDate
virtual Event::List rawEventsForDate(const KDateTime &dt)=0
Get unfiltered events for date dt.
KCal::ResourceCalendar::alarms
virtual Alarm::List alarms(const KDateTime &from, const KDateTime &to)=0
Return all alarms which occur in the given time interval.
KCal::ResourceCalendar::alarmsTo
virtual Alarm::List alarmsTo(const KDateTime &to)=0
Return all alarms which occur before given date.
KCal::ResourceCalendar::deleteTodo
virtual bool deleteTodo(Todo *)=0
Remove a todo from the todolist.
KCal::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:45
KRES::Manager
KRES::Resource
event.h
This file is part of the API for handling calendar data and defines the Event class.
exceptions.h
This file is part of the API for handling calendar data and defines the Exception and ErrorFormat cla...
journal.h
This file is part of the API for handling calendar data and defines the Journal class.
todo.h
This file is part of the API for handling calendar data and defines the Todo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jan 20 2022 00:00:00 by doxygen 1.9.1 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-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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