Public Types | Public Member Functions | List of all members
ServiceInterface Class Referenceabstract

Interface implemented by plugins for handling services. More...

#include <servicehandlerif.h>

Public Types

enum  ErrorCode {
  ErrorOk = 0 , ErrorNoAccount , ErrorNotSupported , ErrorNoConnectivity ,
  ErrorInvalidParameters , ErrorInternal
}
 Error Codes that can be returned by the plugins. More...
 

Public Member Functions

virtual QString icon () const =0
 returns icon of service. More...
 
virtual QString uiName () const =0
 returns name of service. More...
 
virtual bool multiCalendar () const =0
 is this service supporting multiple calendars. More...
 
virtual QString emailAddress (const mKCal::Notebook::Ptr &notebook)=0
 returns the email address that is currently configured in the service, it can be different per account. More...
 
virtual QString displayName (const mKCal::Notebook::Ptr &notebook) const =0
 returns the display name of account of service. More...
 
virtual bool downloadAttachment (const mKCal::Notebook::Ptr &notebook, const QString &uri, const QString &path)=0
 Start the download of an attachment. More...
 
virtual bool deleteAttachment (const mKCal::Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &incidence, const QString &uri)=0
 start the deletion of an attachment. More...
 
virtual bool shareNotebook (const mKCal::Notebook::Ptr &notebook, const QStringList &sharedWith)=0
 Share notebook. More...
 
virtual QStringList sharedWith (const mKCal::Notebook::Ptr &notebook)=0
 Returns list of emails, phones# of the persons that a notebook is shared with. More...
 
virtual QString serviceName () const =0
 The name of this service. More...
 
virtual QString defaultNotebook () const =0
 A service might have a default Notebook in the set of notebooks supported It can be a null value. More...
 
virtual bool checkProductId (const QString &prodId) const =0
 Checks if a give Product Id obtained in an iCal file is handled by this plugin. More...
 
virtual ErrorCode error () const =0
 In case of error, more detailed information can be provided Sometimes the true/false is not enough, so in case of false more details can be obtained. More...
 
virtual ~ServiceInterface ()
 

Detailed Description

Interface implemented by plugins for handling services.

This plugins implement service specific things that are hidden form the application.

Warning
The class who implements this interface has to inherit also from QObject if the download of attachments on demand is supported. In that case then the plugin has to emit a signal downloadProgress(int percentage) to notify the application how the download is being done.

Member Enumeration Documentation

◆ ErrorCode

Error Codes that can be returned by the plugins.

Enumerator
ErrorOk 
ErrorNoAccount 
ErrorNotSupported 
ErrorNoConnectivity 
ErrorInvalidParameters 
ErrorInternal 

Constructor & Destructor Documentation

◆ ~ServiceInterface()

virtual ServiceInterface::~ServiceInterface ( )
inlinevirtual

Member Function Documentation

◆ checkProductId()

virtual bool ServiceInterface::checkProductId ( const QString &  prodId) const
pure virtual

Checks if a give Product Id obtained in an iCal file is handled by this plugin.

In some situations special behaviour might be needed for invitation from certain providers. To check if this is the case, this function is used.

For example it can be used to put it in the right notebook

Parameters
Thestring that was in the iCal file
Returns
The true if it is from the service provider

◆ defaultNotebook()

virtual QString ServiceInterface::defaultNotebook ( ) const
pure virtual

A service might have a default Notebook in the set of notebooks supported It can be a null value.

If multi Calendar is supported, in some situations it might be required to select a default calendar from all of the ones supported. This function allows exactly that.

Returns
The name of the service.

◆ deleteAttachment()

virtual bool ServiceInterface::deleteAttachment ( const mKCal::Notebook::Ptr notebook,
const KCalendarCore::Incidence::Ptr &  incidence,
const QString &  uri 
)
pure virtual

start the deletion of an attachment.

Parameters
notebookpointer to the notebook
incidenceincidence of attachment to be deleted
uriuri of attachment to be deleted
Returns
True if OK, false otherwise.

◆ displayName()

virtual QString ServiceInterface::displayName ( const mKCal::Notebook::Ptr notebook) const
pure virtual

returns the display name of account of service.

Parameters
notebookpointer to the notebook that we want to share
Returns
display name of account of service

◆ downloadAttachment()

virtual bool ServiceInterface::downloadAttachment ( const mKCal::Notebook::Ptr notebook,
const QString &  uri,
const QString &  path 
)
pure virtual

Start the download of an attachment.

This cannot be a blocking operation.

If used also the implementor of this class has to emit the following signals:

- downloadProgress(int percentage) which will inform the application how the progress is doing.
- downloadFinished(const QString &uri) to notify that the download is done
- downloadError(const QString &uri) to notify that the download failed.

There has to be a signal also to notify that the More than one download at a time can be started.

@param notebook pointer to the notebook
@param uri uri of attachment to be downloaded
@param path path where attachment to be downloaded to
Returns
True if OK, false otherwise.

◆ emailAddress()

virtual QString ServiceInterface::emailAddress ( const mKCal::Notebook::Ptr notebook)
pure virtual

returns the email address that is currently configured in the service, it can be different per account.

Parameters
notebookpointer to the notebook that we want to share
Returns
email address of service

◆ error()

virtual ErrorCode ServiceInterface::error ( ) const
pure virtual

In case of error, more detailed information can be provided Sometimes the true/false is not enough, so in case of false more details can be obtained.

Returns
the ErrorCode of what happened

◆ icon()

virtual QString ServiceInterface::icon ( ) const
pure virtual

returns icon of service.

Returns
Path to the Icon.

◆ multiCalendar()

virtual bool ServiceInterface::multiCalendar ( ) const
pure virtual

is this service supporting multiple calendars.

This name is something to be show to the user

Returns
true is service supports multiple calendars otherwise false.

◆ serviceName()

virtual QString ServiceInterface::serviceName ( ) const
pure virtual

The name of this service.

It should be a uniq name specifying which service to use The service name is stored in the Calendars table (pluginname).

Returns
The name of the service.

◆ sharedWith()

virtual QStringList ServiceInterface::sharedWith ( const mKCal::Notebook::Ptr notebook)
pure virtual

Returns list of emails, phones# of the persons that a notebook is shared with.

Parameters
notebookpointer to the notebook
Returns
list of email addresses or phone numbers

◆ shareNotebook()

virtual bool ServiceInterface::shareNotebook ( const mKCal::Notebook::Ptr notebook,
const QStringList &  sharedWith 
)
pure virtual

Share notebook.

Parameters
notebookpointer to the notebook that we want to share
sharedWithemail address or phone number of users
Returns
True if OK, false otherwise.

◆ uiName()

virtual QString ServiceInterface::uiName ( ) const
pure virtual

returns name of service.

Returns
Path to the Icon.

The documentation for this class was generated from the following file:

Generated on Mon May 30 2022 06:54:51 for libextendedkcal by doxygen 1.9.5