File indexing completed on 2024-04-14 03:50:42

0001 /*
0002   This file is part of the kcalcore library.
0003 
0004   SPDX-FileCopyrightText: 2004 Cornelius Schumacher <schumacher@kde.org>
0005 
0006   SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 /**
0009   @file
0010   This file is part of the API for handling calendar data and
0011   defines the FreeBusyCache abstract base class.
0012 
0013   @author Cornelius Schumacher \<schumacher@kde.org\>
0014 */
0015 
0016 #ifndef KCALCORE_FREEBUSYCACHE_H
0017 #define KCALCORE_FREEBUSYCACHE_H
0018 
0019 #include "kcalendarcore_export.h"
0020 
0021 #include "freebusy.h"
0022 
0023 class QString;
0024 
0025 namespace KCalendarCore
0026 {
0027 class Person;
0028 
0029 /**
0030   @brief
0031   An abstract base class to allow different implementations of storing
0032   free busy information, e.g. local storage or storage on a Kolab server.
0033 */
0034 class KCALENDARCORE_EXPORT FreeBusyCache
0035 {
0036 public:
0037     /**
0038       Destructor.
0039     */
0040     virtual ~FreeBusyCache();
0041 
0042     /**
0043       Save freebusy information belonging to an email.
0044 
0045       @param freebusy is a pointer to a valid FreeBusy instance.
0046       @param person is a valid Person instance.
0047       @return true if the save was successful; false otherwise.
0048     */
0049     virtual bool saveFreeBusy(const FreeBusy::Ptr &freebusy, const Person &person) = 0;
0050 
0051     /**
0052       Load freebusy information belonging to an email.
0053 
0054       @param email is a QString containing a email string in the
0055         "FirstName LastName <emailaddress>" format.
0056       @return A pointer to the FreeBusy object loaded for the specified email; returns 0 if
0057         there was some problem attempting to load the FreeBusy information.
0058     */
0059     virtual FreeBusy::Ptr loadFreeBusy(const QString &email) = 0;
0060 
0061 protected:
0062     /**
0063       @copydoc IncidenceBase::virtual_hook()
0064     */
0065     virtual void virtual_hook(int id, void *data);
0066 };
0067 
0068 }
0069 
0070 #endif