Public Types | Public Member Functions

ServiceInterface Class Reference

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

#include <servicehandlerif.h>

List of all members.

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.
virtual QString uiName () const =0
 returns name of service.
virtual bool multiCalendar () const =0
 is this service supporting multiple calendars.
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.
virtual QString displayName (const mKCal::Notebook::Ptr &notebook) const =0
 returns the display name of account of service.
virtual bool downloadAttachment (const mKCal::Notebook::Ptr &notebook, const QString &uri, const QString &path)=0
 Start the download of an attachment.
virtual bool deleteAttachment (const mKCal::Notebook::Ptr &notebook, const KCalCore::Incidence::Ptr &incidence, const QString &uri)=0
 start the deletion of an attachment.
virtual bool shareNotebook (const mKCal::Notebook::Ptr &notebook, const QStringList &sharedWith)=0
 Share notebook.
virtual QStringList sharedWith (const mKCal::Notebook::Ptr &notebook)=0
 Returns list of emails, phones# of the persons that a notebook is shared with.
virtual QString serviceName () const =0
 The name of this service.
virtual QString defaultNotebook () const =0
 A service might have a default Notebook in the set of notebooks supported It can be a null value.
virtual bool checkProductId (const QString &prodId) const =0
 Checks if a give Product Id obtained in an iCal file is handled by this plugin.
virtual bool responseClaimed (const QString &accountId, const KCalCore::Incidence::Ptr &response)
 Notify the plugin that the user accepted/declined an invitation.
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.
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

Error Codes that can be returned by the plugins.

Enumerator:
ErrorOk 
ErrorNoAccount 
ErrorNotSupported 
ErrorNoConnectivity 
ErrorInvalidParameters 
ErrorInternal 

Constructor & Destructor Documentation

virtual ServiceInterface::~ServiceInterface (  )  [inline, virtual]

Member Function Documentation

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:
The string that was in the iCal file
Returns:
The true if it is from the service provider
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.
virtual bool ServiceInterface::deleteAttachment ( const mKCal::Notebook::Ptr notebook,
const KCalCore::Incidence::Ptr &  incidence,
const QString &  uri 
) [pure virtual]

start the deletion of an attachment.

Parameters:
notebook pointer to the notebook
incidence incidence of attachment to be deleted
uri uri of attachment to be deleted
Returns:
True if OK, false otherwise.
virtual QString ServiceInterface::displayName ( const mKCal::Notebook::Ptr notebook  )  const [pure virtual]

returns the display name of account of service.

Parameters:
notebook pointer to the notebook that we want to share
Returns:
display name of account of service
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.

Parameters:
notebook pointer to the notebook
uri uri of attachment to be downloaded
path path where attachment to be downloaded to
Returns:
True if OK, false otherwise.
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:
notebook pointer to the notebook that we want to share
Returns:
email address of service
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
virtual QString ServiceInterface::icon (  )  const [pure virtual]

returns icon of service.

Returns:
Path to the Icon.
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.
virtual bool ServiceInterface::responseClaimed ( const QString &  accountId,
const KCalCore::Incidence::Ptr &  response 
) [inline, virtual]

Notify the plugin that the user accepted/declined an invitation.

Parameters:
[in] accountId The account ID related to the response
[in] response The response incidence
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.
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:
notebook pointer to the notebook
Returns:
list of email addresses or phone numbers
virtual bool ServiceInterface::shareNotebook ( const mKCal::Notebook::Ptr notebook,
const QStringList &  sharedWith 
) [pure virtual]

Share notebook.

Parameters:
notebook pointer to the notebook that we want to share
sharedWith email address or phone number of users
Returns:
True if OK, false otherwise.
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 Tue Jul 5 2011 16:40:27 for libmkcal by doxygen 1.7.1