File indexing completed on 2024-05-12 05:10:44

0001 /*
0002     SPDX-FileCopyrightText: 2011 Grégory Oestreicher <greg@kamago.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "freebusyproviderbase.h"
0010 
0011 #include <QObject>
0012 
0013 class Akonadi__FreeBusyProviderAdaptor;
0014 
0015 namespace Akonadi
0016 {
0017 /**
0018  * @internal
0019  * This class implements the D-Bus interface of FreeBusyProviderBase
0020  *
0021  * @since 4.7
0022  */
0023 class FreeBusyProviderBasePrivate : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit FreeBusyProviderBasePrivate(FreeBusyProviderBase *qq);
0029 
0030 Q_SIGNALS:
0031     /**
0032      * This signal gets emitted when the resource answered
0033      * the free-busy handling request.
0034      *
0035      * @param email The email address of the contact the resource
0036      *              answered for.
0037      * @param handles Whether the resource handles free-busy information
0038      *              (true) or not (false).
0039      */
0040     void handlesFreeBusy(const QString &email, bool handles);
0041 
0042     /**
0043      * This signal gets emitted when the resource answered the
0044      * free-busy retrieval request.
0045      *
0046      * @param email The email address of the contact the resource
0047      *              answers for.
0048      * @param freeBusy The free-busy data in iCal format.
0049      * @param success Whether the retrieval was successful or not.
0050      * @param errorText A human friendly error message in case something
0051      *                  went wrong.
0052      */
0053     void freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText);
0054 
0055 private:
0056     friend class FreeBusyProviderBase;
0057     friend class ::Akonadi__FreeBusyProviderAdaptor;
0058 
0059     // D-Bus calls
0060     QDateTime lastCacheUpdate();
0061     void canHandleFreeBusy(const QString &email);
0062     void retrieveFreeBusy(const QString &email, const QDateTime &start, const QDateTime &end);
0063 
0064     FreeBusyProviderBase *const q;
0065 };
0066 }