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

KCalCore Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcalcore
memorycalendar.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
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 */
32 #ifndef KCALCORE_MEMORYCALENDAR_H
33 #define KCALCORE_MEMORYCALENDAR_H
34 
35 #include "kcalcore_export.h"
36 #include "calendar.h"
37 
38 namespace KCalCore {
39 
40 class CalFormat;
41 
46 class KCALCORE_EXPORT MemoryCalendar : public Calendar
47 {
48 public:
49 
53  typedef QSharedPointer<MemoryCalendar> Ptr;
54 
58  explicit MemoryCalendar(const KDateTime::Spec &timeSpec);
59 
63  explicit MemoryCalendar(const QString &timeZoneId);
64 
68  ~MemoryCalendar();
69 
73  void close();
74 
78  bool deleteIncidence(const Incidence::Ptr &incidence);
79 
83  bool deleteIncidenceInstances(const Incidence::Ptr &incidence);
84 
88  bool addIncidence(const Incidence::Ptr &incidence);
89 
90  // Event Specific Methods //
91 
95  bool addEvent(const Event::Ptr &event);
96 
100  bool deleteEvent(const Event::Ptr &event);
101 
105  bool deleteEventInstances(const Event::Ptr &event);
106 
110  void deleteAllEvents();
111 
115  Event::List rawEvents(
116  EventSortField sortField = EventSortUnsorted,
117  SortDirection sortDirection = SortDirectionAscending) const;
118 
122  Event::List rawEvents(const QDate &start, const QDate &end,
123  const KDateTime::Spec &timeSpec = KDateTime::Spec(),
124  bool inclusive = false) const;
125 
137  Event::List rawEventsForDate(
138  const QDate &date, const KDateTime::Spec &timeSpec = KDateTime::Spec(),
139  EventSortField sortField = EventSortUnsorted,
140  SortDirection sortDirection = SortDirectionAscending) const;
141 
145  Event::List rawEventsForDate(const KDateTime &dt) const;
146 
152  Incidence::Ptr instance(const QString &identifier) const;
153 
157  Event::Ptr event(
158  const QString &uid,
159  const KDateTime &recurrenceId = KDateTime()) const;
160 
164  Event::Ptr deletedEvent(
165  const QString &uid, const KDateTime &recurrenceId = KDateTime()) const;
166 
170  Event::List deletedEvents(
171  EventSortField sortField = EventSortUnsorted,
172  SortDirection sortDirection = SortDirectionAscending) const;
173 
177  Event::List eventInstances(
178  const Incidence::Ptr &event,
179  EventSortField sortField = EventSortUnsorted,
180  SortDirection sortDirection = SortDirectionAscending) const;
181 
182  // To-do Specific Methods //
183 
187  bool addTodo(const Todo::Ptr &todo);
188 
192  bool deleteTodo(const Todo::Ptr &todo);
193 
197  bool deleteTodoInstances(const Todo::Ptr &todo);
198 
202  void deleteAllTodos();
203 
207  Todo::List rawTodos(
208  TodoSortField sortField = TodoSortUnsorted,
209  SortDirection sortDirection = SortDirectionAscending) const;
210 
214  Todo::List rawTodos(
215  const QDate &start, const QDate &end,
216  const KDateTime::Spec &timespec = KDateTime::Spec(),
217  bool inclusive = false) const;
218 
222  Todo::List rawTodosForDate(const QDate &date) const;
223 
227  Todo::Ptr todo(const QString &uid,
228  const KDateTime &recurrenceId = KDateTime()) const;
229 
233  Todo::Ptr deletedTodo(const QString &uid, const KDateTime &recurrenceId = KDateTime()) const;
234 
238  Todo::List deletedTodos(
239  TodoSortField sortField = TodoSortUnsorted,
240  SortDirection sortDirection = SortDirectionAscending) const;
241 
245  Todo::List todoInstances(const Incidence::Ptr &todo,
246  TodoSortField sortField = TodoSortUnsorted,
247  SortDirection sortDirection = SortDirectionAscending) const;
248 
249  // Journal Specific Methods //
250 
254  bool addJournal(const Journal::Ptr &journal);
255 
259  bool deleteJournal(const Journal::Ptr &journal);
260 
264  bool deleteJournalInstances(const Journal::Ptr &journal);
265 
269  void deleteAllJournals();
270 
274  Journal::List rawJournals(
275  JournalSortField sortField = JournalSortUnsorted,
276  SortDirection sortDirection = SortDirectionAscending) const;
277 
281  Journal::List rawJournalsForDate(const QDate &date) const;
282 
286  Journal::Ptr journal(const QString &uid,
287  const KDateTime &recurrenceId = KDateTime()) const;
288 
292  Journal::Ptr deletedJournal(const QString &uid,
293  const KDateTime &recurrenceId = KDateTime()) const;
294 
298  Journal::List deletedJournals(
299  JournalSortField sortField = JournalSortUnsorted,
300  SortDirection sortDirection = SortDirectionAscending) const;
301 
306  Journal::List journalInstances(const Incidence::Ptr &journal,
307  JournalSortField sortField = JournalSortUnsorted,
308  SortDirection sortDirection = SortDirectionAscending) const;
309 
310  // Alarm Specific Methods //
311 
315  Alarm::List alarms(const KDateTime &from, const KDateTime &to) const;
316 
323  Alarm::List alarmsTo(const KDateTime &to) const;
324 
328  void incidenceUpdate(const QString &uid, const KDateTime &recurrenceId);
329 
333  void incidenceUpdated(const QString &uid, const KDateTime &recurrenceId);
334 
335  using QObject::event; // prevent warning about hidden virtual method
336 
337 protected:
341  virtual void virtual_hook(int id, void *data);
342 
343 private:
344  //@cond PRIVATE
345  class Private;
346  Private *const d;
347  //@endcond
348 
349  Q_DISABLE_COPY(MemoryCalendar)
350 };
351 
352 }
353 
354 #endif
KCalCore::JournalSortField
JournalSortField
Calendar Journal sort keys.
Definition: calendar.h:100
KCalCore::Journal::List
QVector< Ptr > List
List of journals.
Definition: journal.h:54
KCalCore::Event::Ptr
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
Definition: event.h:55
KCalCore::Alarm::List
QVector< Ptr > List
List of alarms.
Definition: alarm.h:83
KCalCore::EventSortField
EventSortField
Calendar Event sort keys.
Definition: calendar.h:77
KCalCore::Incidence::Ptr
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
Definition: incidence.h:112
KCalCore::EventSortUnsorted
Do not sort Events.
Definition: calendar.h:78
KCalCore::Event::List
QVector< Ptr > List
List of events.
Definition: event.h:60
KCalCore::MemoryCalendar
This class provides a calendar stored in memory.
Definition: memorycalendar.h:46
KCalCore::SortDirection
SortDirection
Calendar Incidence sort directions.
Definition: calendar.h:69
KCalCore::MemoryCalendar::Ptr
QSharedPointer< MemoryCalendar > Ptr
A shared pointer to a MemoryCalendar.
Definition: memorycalendar.h:53
KCalCore::JournalSortUnsorted
Do not sort Journals.
Definition: calendar.h:101
calendar.h
This file is part of the API for handling calendar data and defines the Calendar class.
KCalCore::SortDirectionAscending
Sort in ascending order (first to last)
Definition: calendar.h:70
KCalCore::TodoSortField
TodoSortField
Calendar Todo sort keys.
Definition: calendar.h:87
KCalCore::Todo::List
QVector< Ptr > List
List of to-dos.
Definition: todo.h:55
KCalCore::Calendar
Represents the main calendar class.
Definition: calendar.h:128
KCalCore::Todo::Ptr
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
Definition: todo.h:50
KCalCore::TodoSortUnsorted
Do not sort Todos.
Definition: calendar.h:88
KCalCore::Journal::Ptr
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.
Definition: journal.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore 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