1/*
2 This file is part of the kcalcore library.
3
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21/**
22 @file
23 This file is part of the API for handling calendar data and
24 defines the FreeBusyCache abstract base class.
25
26 @author Cornelius Schumacher \<schumacher@kde.org\>
27*/
28
29#ifndef KCALCORE_FREEBUSYCACHE_H
30#define KCALCORE_FREEBUSYCACHE_H
31
32#include "kcalcore_export.h"
33
34#include "freebusy.h"
35
36class QString;
37
38namespace KCalCore {
39
40class Person;
41
42/**
43 @brief
44 An abstract base class to allow different implementations of storing
45 free busy information, e.g. local storage or storage on a Kolab server.
46*/
47class KCALCORE_EXPORT FreeBusyCache
48{
49public:
50 /**
51 Destructor.
52 */
53 virtual ~FreeBusyCache();
54
55 /**
56 Save freebusy information belonging to an email.
57
58 @param freebusy is a pointer to a valid FreeBusy instance.
59 @param person is a valid Person instance.
60 @return true if the save was successful; false otherwise.
61 */
62 virtual bool saveFreeBusy(const FreeBusy::Ptr &freebusy, const Person::Ptr &person) = 0;
63
64 /**
65 Load freebusy information belonging to an email.
66
67 @param email is a QString containing a email string in the
68 "FirstName LastName <emailaddress>" format.
69 @return A pointer to the FreeBusy object loaded for the specified email; returns 0 if
70 there was some problem attempting to load the FreeBusy information.
71 */
72 virtual FreeBusy::Ptr loadFreeBusy(const QString &email) = 0;
73
74protected:
75 /**
76 @copydoc IncidenceBase::virtual_hook()
77 */
78 virtual void virtual_hook(int id, void *data);
79};
80
81}
82
83#endif
84