Akonadi::FreeBusyProviderBase Class

Base class for resources providing free-busy information * * This class must be inherited by resources that are able to provide * free-busy information for a given contact on request. A resource * will thus inherit from ResourceBase and FreeBusyProvider. * * Resources that provide FB info must declare it by adding * 'FreeBusyProvider' in the X-Akonadi-Capabilities field of their * .desktop file:. More...

Header: #include <Akonadi/FreeBusyProviderBase>
CMake: find_package(KPim6AkonadiCalendar REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendarCore)

Public Functions

FreeBusyProviderBase()
virtual ~FreeBusyProviderBase()
virtual void canHandleFreeBusy(const QString &email) const = 0
void freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString())
void handlesFreeBusy(const QString &email, bool handles) const
virtual QDateTime lastCacheUpdate() const = 0
virtual void retrieveFreeBusy(const QString &email, const QDateTime &start, const QDateTime &end) = 0

Detailed Description

*

X-Akonadi-Capabilities=Resource,FreeBusyProvider

* * Resource inheriting from this class must implement lastCacheUpdate(), * canHandleFreeBusy() and retrieveFreeBusy(). * * * * * *

Member Function Documentation

FreeBusyProviderBase::FreeBusyProviderBase()

Creates a new FreeBusyProvider

[virtual noexcept] FreeBusyProviderBase::~FreeBusyProviderBase()

Destroys a FreeBusyProvider

[pure virtual] void FreeBusyProviderBase::canHandleFreeBusy(const QString &email) const

This method is called to find out is the resource handle free-busy information for the contact with email address email.

The caller will not wait for the result. Once the decision is known, the resource must call handlesFreeBusy().

email The email address of the contact we want the free-busy info. This is a simple email address, in the form foo@bar.com (no display name or quoting).

See also handlesFreeBusy().

void FreeBusyProviderBase::freeBusyRetrieved(const QString &email, const QString &freeBusy, bool success, const QString &errorText = QString())

Derivate classes must call this method to notify the requester that the result is here.

The freeBusy is expected to be an iTIP request containing the free-busy data. The simplest way to generate this is to use KCalendarCore::ICalFormat::createScheduleMessage() with the method KCalendarCore::iTIPRequest.

email The email address of the contact we give the response for. This is a simple email address, in the form foo@bar.com (no display name or quoting). freeBusy The free-busy data. success Whether the retrieval was successful or not. errorText An optional error message that can be displayed back to the user.

void FreeBusyProviderBase::handlesFreeBusy(const QString &email, bool handles) const

Derivate classes must call this method once they know if they handle free-busy information for the contact with email address email.

email The email address of the contact we give the response for. This is a simple email address, in the form foo@bar.com (no display name or quoting). handles Whether this resource handles free-busy (true) or not (false).

[pure virtual] QDateTime FreeBusyProviderBase::lastCacheUpdate() const

Returns the last time the free-busy information was fetched from the server. This can be used for example to issue a warning to the user that this information may not be accurate and must be refreshed; pretty useful when the resource was offline for too long.

Returns The date and time the cache was last updated.

[pure virtual] void FreeBusyProviderBase::retrieveFreeBusy(const QString &email, const QDateTime &start, const QDateTime &end)

This method is called when the resource must do the real work and fetch the free-busy information for the contact with email address email.

As with canHandleFreeBusy() the caller will not wait for the result and the resource must call freeBusyRetrieved() once done.

email The email address of the contact we want the free-busy info. This is a simple email address, in the form foo@bar.com (no display name or quoting). start The start of the period the free-busy request covers end The end of the free-busy period

See also freeBusyRetrieved().