• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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_EXPORT_DEPRECATED 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:29:16 by doxygen 1.8.3.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
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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