• 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
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
KCal::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:44
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
KCal::ResourceCalendar::addInfoText
virtual void addInfoText(QString &) const
Add info text for concrete resources.
Definition: resourcecalendar.h:506
todo.h
This file is part of the API for handling calendar data and defines the Todo class.
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
KRES::Resource
journal.h
This file is part of the API for handling calendar data and defines the Journal class.
alarm.h
This file is part of the API for handling calendar data and defines the Alarm class.
event.h
This file is part of the API for handling calendar data and defines the Event class.
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:58 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