Akonadi::FreeBusyProviderBase

Search for usage in LXR

Akonadi::FreeBusyProviderBase Class Referenceabstract

#include <freebusyproviderbase.h>

Public Member 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

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:

X-Akonadi-Capabilities=Resource,FreeBusyProvider
FreeBusyManager::Singleton.

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

Since
4.7

Definition at line 41 of file freebusyproviderbase.h.

Constructor & Destructor Documentation

◆ FreeBusyProviderBase()

FreeBusyProviderBase::FreeBusyProviderBase ( )

Creates a new FreeBusyProvider.

Definition at line 40 of file freebusyproviderbase.cpp.

◆ ~FreeBusyProviderBase()

FreeBusyProviderBase::~FreeBusyProviderBase ( )
virtualdefault

Destroys a FreeBusyProvider.

Member Function Documentation

◆ canHandleFreeBusy()

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

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().

Parameters
emailThe email address of the contact we want the free-busy info. This is a simple email address, in the form foo@b.nosp@m.ar.c.nosp@m.om (no display name or quoting).
See also
handlesFreeBusy()

◆ freeBusyRetrieved()

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

Derivate classes must call this method to notify the requestor 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.

Parameters
emailThe email address of the contact we give the response for. This is a simple email address, in the form foo@b.nosp@m.ar.c.nosp@m.om (no display name or quoting).
freeBusyThe free-busy data.
successWhether the retrieval was successful or not.
errorTextAn optional error message that can be displayed back to the user.

Definition at line 52 of file freebusyproviderbase.cpp.

◆ handlesFreeBusy()

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.

Parameters
emailThe email address of the contact we give the response for. This is a simple email address, in the form foo@b.nosp@m.ar.c.nosp@m.om (no display name or quoting).
handlesWhether this resource handles free-busy (true) or not (false).

Definition at line 47 of file freebusyproviderbase.cpp.

◆ lastCacheUpdate()

virtual QDateTime Akonadi::FreeBusyProviderBase::lastCacheUpdate ( ) const
pure virtual

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.

◆ retrieveFreeBusy()

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

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.

Parameters
emailThe email address of the contact we want the free-busy info. This is a simple email address, in the form foo@b.nosp@m.ar.c.nosp@m.om (no display name or quoting).
startThe start of the period the free-busy request covers
endThe end of the free-busy period
See also
freeBusyRetrieved()

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:03:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.