Public Types | Signals | Public Member Functions | Static Public Member Functions | List of all members
mKCal::ServiceHandler Class Reference

Singleton class to get the exact handler (plugin) of the service. More...

#include <servicehandler.h>

Inheritance diagram for mKCal::ServiceHandler:
Inheritance graph
[legend]

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. More...
 
void downloadFinished (int id)
 Informs that the download is over. More...
 
void downloadError (int id, ErrorCode error)
 Informs that the download is finished with errors. More...
 

Public Member Functions

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

Static Public Member Functions

static ServiceHandlerinstance ()
 Obtain an instance of the ServiceHandler. More...
 

Detailed Description

Singleton class to get the exact handler (plugin) of the service.

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 inviatation.

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 ExtendedStorage::Ptr storage,
const QString &  uri 
)

deleteAttachment It would load the appropriate plugin to do it

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,
const ExtendedStorage::Ptr storage 
)

displayName It would load the appropriate plugin to do it

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
display name

◆ downloadAttachment()

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

downloadAttachment It would load the appropriate plugin to do it

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,
const ExtendedStorage::Ptr storage 
)

emailAddress It would load the appropriate plugin to do it

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
email address

◆ 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 Notebook::Ptr notebook,
const ExtendedStorage::Ptr storage 
)

Icon It would load the appropriate plugin to do it.

Parameters
notebooknotebook
storagePointer to the storage in 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 Notebook::Ptr notebook,
const ExtendedStorage::Ptr storage 
)

multiCalendar It would load the appropriate plugin to do it

Parameters
notebooknotebook
storagePointer to the storage in use
Returns
True if multicalendar otherwise false

◆ sendInvitation()

bool ServiceHandler::sendInvitation ( const KCalendarCore::Incidence::Ptr &  invitation,
const QString &  body,
const ExtendedCalendar::Ptr &  calendar,
const ExtendedStorage::Ptr storage,
const Notebook::Ptr notebook = Notebook::Ptr() 
)

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

It would load the appropriate plugin to do it, and if there is no plugin it would use the default fall back plugin.

Parameters
invitationThe Incidence to send
bodyThe body of the reply if any
calendarPointer to the calendar in use
storagePointer to the storage in use
notebookOptional notebook to use for account info
Returns
True if OK, false in case of error

◆ sendResponse()

bool ServiceHandler::sendResponse ( const KCalendarCore::Incidence::Ptr &  invitation,
const QString &  body,
const ExtendedCalendar::Ptr &  calendar,
const ExtendedStorage::Ptr storage,
const Notebook::Ptr notebook = Notebook::Ptr() 
)

Send the updated invitation to the organiser.

It would load the appropriate plugin to do it, and if there is no plugin it would use the default fall back plugin.

Parameters
invitationThe Incidence to udpate
bodyThe body of the reply if any
calendarPointer to the calendar in use
storagePointer to the storage in use
notebookOptional notebook to use for account info
Returns
True if OK, false in case of error

◆ sendUpdate()

bool ServiceHandler::sendUpdate ( const KCalendarCore::Incidence::Ptr &  invitation,
const QString &  body,
const ExtendedCalendar::Ptr &  calendar,
const ExtendedStorage::Ptr storage,
const Notebook::Ptr notebook = Notebook::Ptr() 
)

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

It would load the appropriate plugin to do it, and if there is no plugin it would use the default fall back plugin.

Parameters
invitationThe Incidence to udpate
bodyThe body of the reply if any
calendarPointer to the calendar in use
storagePointer to the storage in use
notebookOptional notebook to use for account info
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,
const ExtendedStorage::Ptr storage 
)

sharedWith It would load the appropriate plugin to do it

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,
const ExtendedStorage::Ptr storage 
)

Share notebook It would load the appropriate plugin to do it.

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 Mon May 30 2022 06:54:51 for libextendedkcal by doxygen 1.9.4