mKCal::ServiceHandler Class Reference

Singleton class to get the exact handler (plugin) of the service In case of API with a notebook argument, the plugin to be used is determined calling Notebook::pluginName(). More...

#include <servicehandler.h>

Inheritance diagram for mKCal::ServiceHandler:

Public Types

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

Signals

void downloadProgress (int id, int percentage)
 Monitors the progress of the download.
 
void downloadFinished (int id)
 Informs that the download is over.
 
void downloadError (int id, ErrorCode error)
 Informs that the download is finished with errors.
 

Public Member Functions

bool sendInvitation (const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body)
 Send the invitation to the list of people stated as attendees.
 
bool sendUpdate (const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body)
 Send the updated invitation to the list of people stated as attendees.
 
bool sendResponse (const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body)
 Send the updated invitation to the organiser.
 
QString icon (const QString &serviceId)
 Icon.
 
bool multiCalendar (const QString &serviceId)
 multiCalendar
 
QString emailAddress (const Notebook::Ptr &notebook)
 emailAddress Retrieve the email address of the notebook.
 
QString displayName (const Notebook::Ptr &notebook)
 displayName
 
int downloadAttachment (const Notebook::Ptr &notebook, const QString &uri, const QString &path)
 downloadAttachment
 
bool deleteAttachment (const KCalendarCore::Incidence::Ptr &incidence, const Notebook::Ptr &notebook, const QString &uri)
 deleteAttachment
 
bool shareNotebook (const Notebook::Ptr &notebook, const QStringList &sharedWith)
 Share notebook.
 
QStringList sharedWith (const Notebook::Ptr &notebook)
 sharedWith
 
QString defaultNotebook (const QString &productId)
 Try to get the notebook where to put the invitation.
 
ServiceHandler::ErrorCode error () const
 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.
 
QStringList availableServices ()
 MultiCalendar services.
 
QString icon (QString serviceId)
 Get the Icon of a service based on the id of the plugin.
 
QString uiName (QString serviceId)
 Get the Name to be shown on the UI of a service based on the id of the plugin.
 
ServiceInterfaceservice (const QString &serviceId)
 Get the plugin object providing the service.
 

Static Public Member Functions

static ServiceHandlerinstance ()
 Obtain an instance of the ServiceHandler.
 

Detailed Description

Singleton class to get the exact handler (plugin) of the service In case of API with a notebook argument, the plugin to be used is determined calling Notebook::pluginName().

Member Enumeration Documentation

◆ ErrorCode

Error Codes that can be returned by the plugins.

Enumerator
ErrorOk 
ErrorNoAccount 
ErrorNotSupported 
ErrorNoConnectivity 
ErrorInvalidParameters 
ErrorInternal 

Member Function Documentation

◆ availableServices()

QStringList ServiceHandler::availableServices ( )

MultiCalendar services.

List available Services There can be many available services. This method returns the ids of the plugins that handle those services.

Note
this id can be used in the Notebook creation to "attach" a notebook to a certain service.
Returns
list of the ids of the plugins available

◆ defaultNotebook()

QString ServiceHandler::defaultNotebook ( const QString & productId)

Try to get the notebook where to put the invitation.

This is done based on the product Id of the invitation received. (in the iCal file).

Parameters
productIdthe id of the generator of the iCal
Returns
a string with the id of the notebook. it can be null

◆ deleteAttachment()

bool ServiceHandler::deleteAttachment ( const KCalendarCore::Incidence::Ptr & incidence,
const Notebook::Ptr & notebook,
const QString & uri )

deleteAttachment

Parameters
incienceincidence of attachment to be deleted
notebooknotebook
storagePointer to the storage in use
uriuri of attachment to be deleted
Returns
True if OK, false in case of error

◆ displayName()

QString ServiceHandler::displayName ( const Notebook::Ptr & notebook)

displayName

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
display name

◆ downloadAttachment()

int ServiceHandler::downloadAttachment ( const Notebook::Ptr & notebook,
const QString & uri,
const QString & path )

downloadAttachment

Parameters
notebooknotebook
storagePointer to the storage in use
uriuri of attachment to be downloaded
pathpath whre attachment to be downloaded to
Returns
Id of the attachment download. It will be used to notify changes about it. If < 0 there was an error.

◆ downloadError

void mKCal::ServiceHandler::downloadError ( int id,
ErrorCode error )
signal

Informs that the download is finished with errors.

The id is the return value got when download started

◆ downloadFinished

void mKCal::ServiceHandler::downloadFinished ( int id)
signal

Informs that the download is over.

The id is the return value got when download started

◆ downloadProgress

void mKCal::ServiceHandler::downloadProgress ( int id,
int percentage )
signal

Monitors the progress of the download.

The id is the return value got when download started

◆ emailAddress()

QString ServiceHandler::emailAddress ( const Notebook::Ptr & notebook)

emailAddress Retrieve the email address of the notebook.

◆ error()

ServiceHandler::ErrorCode ServiceHandler::error ( ) const

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.

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
the ErrorCode of what happened

◆ icon() [1/2]

QString ServiceHandler::icon ( const QString & serviceId)

Icon.

Parameters
serviceIdthe name of the service to use
Returns
Icon

◆ icon() [2/2]

QString ServiceHandler::icon ( QString serviceId)

Get the Icon of a service based on the id of the plugin.

Returns
Path to the icon
See also
availableMulticalendarServices

◆ instance()

static ServiceHandler & mKCal::ServiceHandler::instance ( )
inlinestatic

Obtain an instance of the ServiceHandler.

Returns
The instance that handles all the services

◆ multiCalendar()

bool ServiceHandler::multiCalendar ( const QString & serviceId)

multiCalendar

Parameters
serviceIdthe name of the service to use
Returns
True if multicalendar otherwise false

◆ sendInvitation()

bool ServiceHandler::sendInvitation ( const Notebook::Ptr & notebook,
const KCalendarCore::Incidence::Ptr & invitation,
const QString & body )

Send the invitation to the list of people stated as attendees.

Parameters
notebooknotebook to use for account info
invitationThe Incidence to send
bodyThe body of the reply if any
Returns
True if OK, false in case of error

◆ sendResponse()

bool ServiceHandler::sendResponse ( const Notebook::Ptr & notebook,
const KCalendarCore::Incidence::Ptr & invitation,
const QString & body )

Send the updated invitation to the organiser.

Parameters
notebooknotebook to use for account info
invitationThe Incidence to udpate
bodyThe body of the reply if any
Returns
True if OK, false in case of error

◆ sendUpdate()

bool ServiceHandler::sendUpdate ( const Notebook::Ptr & notebook,
const KCalendarCore::Incidence::Ptr & invitation,
const QString & body )

Send the updated invitation to the list of people stated as attendees.

Parameters
notebooknotebook to use for account info
invitationThe Incidence to udpate
bodyThe body of the reply if any
Returns
True if OK, false in case of error

◆ service()

ServiceInterface * ServiceHandler::service ( const QString & serviceId)

Get the plugin object providing the service.

Returns
the plugin object
See also
availableMulticalendarServices

◆ sharedWith()

QStringList ServiceHandler::sharedWith ( const Notebook::Ptr & notebook)

sharedWith

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
list of users to share with

◆ shareNotebook()

bool ServiceHandler::shareNotebook ( const Notebook::Ptr & notebook,
const QStringList & sharedWith )

Share notebook.

Parameters
notebookShared notebook
sharedWithThe list of email addresses or phone numbers of users
storagePointer to the storage in use
Returns
True if OK, false in case of error

◆ uiName()

QString ServiceHandler::uiName ( QString serviceId)

Get the Name to be shown on the UI of a service based on the id of the plugin.

Returns
Name of the service
See also
availableMulticalendarServices

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

Generated on Thu Nov 28 2024 09:02:24 for libextendedkcal by doxygen 1.12.0