dummystorage.h
Go to the documentation of this file.
1 /*
2  This file is part of the mkcal library.
3 
4  Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
5  Contact: Alvaro Manera <alvaro.manera@nokia.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 */
22 #ifndef DUMMYSTORAGE_H
23 #define DUMMYSTORAGE_H
24 
25 #include "extendedstorage.h"
26 #include "extendedcalendar.h"
27 #include "notebook.h"
28 
29 
36 {
37 public:
38  DummyStorage(const mKCal::ExtendedCalendar::Ptr &cal) : mKCal::ExtendedStorage(cal)
39  {
41  "dummy-desc"));
42  bool r;
43  r = addNotebook(nb);
44  Q_ASSERT(r);
45  r = setDefaultNotebook(nb);
46  Q_ASSERT(r);
47  }
48 
49  void calendarModified(bool, KCalCore::Calendar *)
50  {
51  }
52  void calendarIncidenceAdded(const KCalCore::Incidence::Ptr &)
53  {
54  }
55  void calendarIncidenceChanged(const KCalCore::Incidence::Ptr &)
56  {
57  }
58  void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &)
59  {
60  }
61  void calendarIncidenceAdditionCanceled(const KCalCore::Incidence::Ptr &)
62  {
63  }
64  bool purgeDeletedIncidences(const KCalCore::Incidence::List &)
65  {
66  }
67 
72  bool open()
73  {
74  return true;
75  }
76 
81  bool load()
82  {
83  return true;
84  }
85 
90  bool save()
91  {
92  return true;
93  }
95  {
96  return true;
97  }
98  bool close()
99  {
100  return true;
101  }
102  bool load(const QString &, const KDateTime &)
103  {
104  return true;
105  }
106  bool load(const QDate &)
107  {
108  return true;
109  }
110  bool load(const QDate &, const QDate &)
111  {
112  return true;
113  }
114  bool loadSeries(const QString &)
115  {
116  return true;
117  }
118  bool loadNotebookIncidences(const QString &)
119  {
120  return true;
121  }
123  {
124  return true;
125  }
127  {
128  return true;
129  }
131  {
132  return true;
133  }
135  {
136  return true;
137  }
138  bool loadGeoIncidences(float, float, float, float)
139  {
140  return true;
141  }
143  {
144  return true;
145  }
147  {
148  return 0;
149  }
150  int loadCompletedTodos(bool, int, KDateTime *)
151  {
152  return 0;
153  }
154  int loadIncidences(bool, int, KDateTime *)
155  {
156  return 0;
157  }
158  int loadFutureIncidences(int, KDateTime *)
159  {
160  return 0;
161  }
162  int loadGeoIncidences(bool, int, KDateTime *)
163  {
164  return 0;
165  }
167  {
168  return 0;
169  }
170  int loadOldInvitationIncidences(int, KDateTime *)
171  {
172  return 0;
173  }
174  KCalCore::Person::List loadContacts()
175  {
176  KCalCore::Person::List l;
177  return l;
178  }
179  int loadContactIncidences(const KCalCore::Person::Ptr &, int, KDateTime *)
180  {
181  return 0;
182  }
183  int loadJournals(int, KDateTime *)
184  {
185  return 0;
186  }
187  bool notifyOpened(const KCalCore::Incidence::Ptr &)
188  {
189  return true;
190  }
191  bool cancel()
192  {
193  return true;
194  }
195  void calendarModified(bool, const KCalCore::Calendar *) const
196  {
197  }
198  void calendarIncidenceAdded(const KCalCore::Incidence::Ptr &) const
199  {
200  }
201  void calendarIncidenceChanged(const KCalCore::Incidence::Ptr &) const
202  {
203  }
204  void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &) const
205  {
206  }
207  void calendarIncidenceAdditionCanceled(const KCalCore::Incidence::Ptr &) const
208  {
209  }
210  bool insertedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
211  {
212  return true;
213  }
214  bool modifiedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
215  {
216  return true;
217  }
218  bool deletedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
219  {
220  return true;
221  }
222  bool allIncidences(KCalCore::Incidence::List *, const QString &)
223  {
224  return true;
225  }
226  bool duplicateIncidences(KCalCore::Incidence::List *, const KCalCore::Incidence::Ptr &, const QString &)
227  {
228  return true;
229  }
231  {
232  return true;
233  }
235  {
236  return true;
237  }
239  {
240  return true;
241  }
242  KDateTime incidenceDeletedDate(const KCalCore::Incidence::Ptr &incidence)
243  {
244  return KDateTime();
245  }
247  {
248  return 0;
249  }
250  int todoCount()
251  {
252  return 0;
253  }
255  {
256  return 0;
257  }
258  void virtual_hook(int, void *)
259  {
260  return;
261  }
262 };
263 
264 #endif /* DUMMYSTORAGE_H */
DummyStorage::reloadNotebooks
bool reloadNotebooks()
Definition: dummystorage.h:234
extendedcalendar.h
DummyStorage::save
bool save(DeleteAction)
This is an overload of save() method.
Definition: dummystorage.h:94
DummyStorage
This module provides a simple storage abstraction which contains exactly nothing.
Definition: dummystorage.h:35
DummyStorage::calendarModified
void calendarModified(bool, const KCalCore::Calendar *) const
Definition: dummystorage.h:195
DummyStorage::calendarModified
void calendarModified(bool, KCalCore::Calendar *)
Definition: dummystorage.h:49
DummyStorage::calendarIncidenceDeleted
void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &) const
Definition: dummystorage.h:204
DummyStorage::load
bool load()
Definition: dummystorage.h:81
DummyStorage::incidenceDeletedDate
KDateTime incidenceDeletedDate(const KCalCore::Incidence::Ptr &incidence)
Get deletion time of incidence.
Definition: dummystorage.h:242
DummyStorage::deletedIncidences
bool deletedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
Get deleted incidences from storage.
Definition: dummystorage.h:218
DummyStorage::modifyNotebook
bool modifyNotebook(const mKCal::Notebook::Ptr &, mKCal::DBOperation, bool)
Definition: dummystorage.h:238
DummyStorage::loadContacts
KCalCore::Person::List loadContacts()
Load all contacts in the database.
Definition: dummystorage.h:174
DummyStorage::calendarIncidenceChanged
void calendarIncidenceChanged(const KCalCore::Incidence::Ptr &)
Definition: dummystorage.h:55
DummyStorage::modifiedIncidences
bool modifiedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
Get modified incidences from storage.
Definition: dummystorage.h:214
DummyStorage::calendarIncidenceAdditionCanceled
void calendarIncidenceAdditionCanceled(const KCalCore::Incidence::Ptr &) const
Definition: dummystorage.h:207
DummyStorage::loadPlainIncidences
bool loadPlainIncidences()
Load plain incidences (no startdate and no enddate).
Definition: dummystorage.h:126
notebook.h
DummyStorage::close
bool close()
Definition: dummystorage.h:98
mKCal::ExtendedStorage
This class provides a calendar storage interface.
Definition: extendedstorage.h:76
DummyStorage::loadGeoIncidences
bool loadGeoIncidences(float, float, float, float)
Load incidences that have geo parameters inside given rectangle.
Definition: dummystorage.h:138
mKCal::DBOperation
DBOperation
Database operation type.
Definition: extendedstorage.h:54
DummyStorage::loadJournals
int loadJournals(int, KDateTime *)
Load journal entries based on parameters.
Definition: dummystorage.h:183
DummyStorage::loadSeries
bool loadSeries(const QString &)
Load all incidences sharing the same uid into the memory.
Definition: dummystorage.h:114
DummyStorage::save
bool save()
Definition: dummystorage.h:90
DummyStorage::loadGeoIncidences
bool loadGeoIncidences()
Load incidences that have geo parameters.
Definition: dummystorage.h:134
DummyStorage::loadNotebookIncidences
bool loadNotebookIncidences(const QString &)
Load incidences of one notebook into the memory.
Definition: dummystorage.h:118
DummyStorage::load
bool load(const QDate &)
Load incidences at given date into the memory.
Definition: dummystorage.h:106
DummyStorage::open
bool open()
Definition: dummystorage.h:72
DummyStorage::loadJournals
bool loadJournals()
Load journal type entries.
Definition: dummystorage.h:122
DummyStorage::loadUncompletedTodos
int loadUncompletedTodos()
Load all uncompleted todos.
Definition: dummystorage.h:146
DummyStorage::loadIncidences
int loadIncidences(bool, int, KDateTime *)
Load incidences based on start/due date or creation date.
Definition: dummystorage.h:154
DummyStorage::loadCompletedTodos
int loadCompletedTodos(bool, int, KDateTime *)
Load completed todos based on parameters.
Definition: dummystorage.h:150
DummyStorage::duplicateIncidences
bool duplicateIncidences(KCalCore::Incidence::List *, const KCalCore::Incidence::Ptr &, const QString &)
Get possible duplicates for given incidence.
Definition: dummystorage.h:226
DummyStorage::loadContactIncidences
int loadContactIncidences(const KCalCore::Person::Ptr &, int, KDateTime *)
Load all incidences that have the specified attendee.
Definition: dummystorage.h:179
DummyStorage::load
bool load(const QString &, const KDateTime &)
Load incidence by uid into the memory.
Definition: dummystorage.h:102
mKCal::Notebook::Ptr
QSharedPointer< Notebook > Ptr
A shared pointer to a Notebook object.
Definition: notebook.h:53
mKCal
Definition: extendedstorage.h:49
DummyStorage::calendarIncidenceDeleted
void calendarIncidenceDeleted(const KCalCore::Incidence::Ptr &)
Definition: dummystorage.h:58
DummyStorage::virtual_hook
void virtual_hook(int, void *)
Standard trick to add virtuals later.
Definition: dummystorage.h:258
DummyStorage::notifyOpened
bool notifyOpened(const KCalCore::Incidence::Ptr &)
Mark if supported by the storage that an incidence has been opened.
Definition: dummystorage.h:187
mKCal::Notebook
Placeholder for Notebook parameters.
Definition: notebook.h:47
DummyStorage::loadRecurringIncidences
bool loadRecurringIncidences()
Load recurring incidences.
Definition: dummystorage.h:130
DummyStorage::calendarIncidenceChanged
void calendarIncidenceChanged(const KCalCore::Incidence::Ptr &) const
Definition: dummystorage.h:201
DummyStorage::calendarIncidenceAdded
void calendarIncidenceAdded(const KCalCore::Incidence::Ptr &)
Definition: dummystorage.h:52
DummyStorage::loadGeoIncidences
int loadGeoIncidences(bool, int, KDateTime *)
Load incidences that have location information based on parameters.
Definition: dummystorage.h:162
MKCAL_EXPORT
#define MKCAL_EXPORT
Definition: mkcal_export.h:27
DummyStorage::loadUnreadInvitationIncidences
int loadUnreadInvitationIncidences()
Load all unread incidences that are related to an invitation.
Definition: dummystorage.h:166
DummyStorage::loadFutureIncidences
int loadFutureIncidences(int, KDateTime *)
Load future incidences based on start/due date.
Definition: dummystorage.h:158
DummyStorage::cancel
bool cancel()
Cancel any ongoing action (load etc.).
Definition: dummystorage.h:191
DummyStorage::purgeDeletedIncidences
bool purgeDeletedIncidences(const KCalCore::Incidence::List &)
Remove from storage all incidences that have been previously marked as deleted and that matches the U...
Definition: dummystorage.h:64
extendedstorage.h
DummyStorage::insertedIncidences
bool insertedIncidences(KCalCore::Incidence::List *, const KDateTime &, const QString &)
Get inserted incidences from storage.
Definition: dummystorage.h:210
mKCal::ExtendedStorage::setDefaultNotebook
bool setDefaultNotebook(const Notebook::Ptr &nb)
setDefaultNotebook to the storage.
Definition: extendedstorage.cpp:462
DummyStorage::loadOldInvitationIncidences
int loadOldInvitationIncidences(int, KDateTime *)
Load incidences that are related to an invitation.
Definition: dummystorage.h:170
mKCal::ExtendedStorage::addNotebook
bool addNotebook(const Notebook::Ptr &nb, bool signal=true)
Add new notebook to the storage.
Definition: extendedstorage.cpp:361
DummyStorage::journalCount
int journalCount()
Get count of journals.
Definition: dummystorage.h:254
DummyStorage::todoCount
int todoCount()
Get count of todos.
Definition: dummystorage.h:250
DummyStorage::calendarIncidenceAdded
void calendarIncidenceAdded(const KCalCore::Incidence::Ptr &) const
Definition: dummystorage.h:198
DummyStorage::load
bool load(const QDate &, const QDate &)
Load incidences between given dates into the memory.
Definition: dummystorage.h:110
DummyStorage::loadAttendeeIncidences
bool loadAttendeeIncidences()
Load incidences that have attendee.
Definition: dummystorage.h:142
DummyStorage::DummyStorage
DummyStorage(const mKCal::ExtendedCalendar::Ptr &cal)
Definition: dummystorage.h:38
DummyStorage::eventCount
int eventCount()
Get count of events.
Definition: dummystorage.h:246
DummyStorage::calendarIncidenceAdditionCanceled
void calendarIncidenceAdditionCanceled(const KCalCore::Incidence::Ptr &)
Definition: dummystorage.h:61
DummyStorage::allIncidences
bool allIncidences(KCalCore::Incidence::List *, const QString &)
Get all incidences from storage.
Definition: dummystorage.h:222
DummyStorage::loadNotebooks
bool loadNotebooks()
Definition: dummystorage.h:230
mKCal::ExtendedStorage::DeleteAction
DeleteAction
Action to be performed on save for deleted incidences.
Definition: extendedstorage.h:86

Generated on Sat Oct 17 2020 06:54:57 for libextendedkcal by doxygen 1.8.17