Singleton class to get the exact handler (plugin) of the service. More...
#include <servicehandler.h>
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 ¬ebook=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 ¬ebook=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 ¬ebook=Notebook::Ptr()) |
Send the updated invitation to the organiser. More... | |
QString | icon (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
Icon It would load the appropriate plugin to do it. More... | |
bool | multiCalendar (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
multiCalendar It would load the appropriate plugin to do it More... | |
QString | emailAddress (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
emailAddress It would load the appropriate plugin to do it More... | |
QString | displayName (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
displayName It would load the appropriate plugin to do it More... | |
int | downloadAttachment (const Notebook::Ptr ¬ebook, 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 ¬ebook, const ExtendedStorage::Ptr &storage, const QString &uri) |
deleteAttachment It would load the appropriate plugin to do it More... | |
bool | shareNotebook (const Notebook::Ptr ¬ebook, const QStringList &sharedWith, const ExtendedStorage::Ptr &storage) |
Share notebook It would load the appropriate plugin to do it. More... | |
QStringList | sharedWith (const Notebook::Ptr ¬ebook, 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 tp be shown on the UI of a service based on the id of the plugin. More... | |
Static Public Member Functions | |
static ServiceHandler & | instance () |
Obtain an instance of the ServiceHandler. More... | |
Singleton class to get the exact handler (plugin) of the service.
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.
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).
productId | the id of the generator of the iCal |
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
incience | incidence of attachment to be deleted |
notebook | notebook |
storage | Pointer to the storage in use |
uri | uri of attachment to be deleted |
QString ServiceHandler::displayName | ( | const Notebook::Ptr & | notebook, |
const ExtendedStorage::Ptr & | storage | ||
) |
displayName It would load the appropriate plugin to do it
notebook | notebook |
storage | Pointer to the storage in use |
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
notebook | notebook |
storage | Pointer to the storage in use |
uri | uri of attachment to be downloaded |
path | path whre attachment to be downloaded to |
|
signal |
Informs that the download is finished with errors.
The id is the return value got when download started
|
signal |
Informs that the download is over.
The id is the return value got when download started
|
signal |
Monitors the progress of the download.
The id is the return value got when download started
QString ServiceHandler::emailAddress | ( | const Notebook::Ptr & | notebook, |
const ExtendedStorage::Ptr & | storage | ||
) |
emailAddress It would load the appropriate plugin to do it
notebook | notebook |
storage | Pointer to the storage in use |
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.
notebook | notebook |
storage | Pointer to the storage in use |
QString ServiceHandler::icon | ( | const Notebook::Ptr & | notebook, |
const ExtendedStorage::Ptr & | storage | ||
) |
Icon It would load the appropriate plugin to do it.
notebook | notebook |
storage | Pointer to the storage in use |
QString ServiceHandler::icon | ( | QString | serviceId | ) |
Get the Icon of a service based on the id of the plugin.
|
inlinestatic |
Obtain an instance of the ServiceHandler.
bool ServiceHandler::multiCalendar | ( | const Notebook::Ptr & | notebook, |
const ExtendedStorage::Ptr & | storage | ||
) |
multiCalendar It would load the appropriate plugin to do it
notebook | notebook |
storage | Pointer to the storage in use |
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.
invitation | The Incidence to send |
body | The body of the reply if any |
calendar | Pointer to the calendar in use |
storage | Pointer to the storage in use |
notebook | Optional notebook to use for account info |
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.
invitation | The Incidence to udpate |
body | The body of the reply if any |
calendar | Pointer to the calendar in use |
storage | Pointer to the storage in use |
notebook | Optional notebook to use for account info |
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.
invitation | The Incidence to udpate |
body | The body of the reply if any |
calendar | Pointer to the calendar in use |
storage | Pointer to the storage in use |
notebook | Optional notebook to use for account info |
QStringList ServiceHandler::sharedWith | ( | const Notebook::Ptr & | notebook, |
const ExtendedStorage::Ptr & | storage | ||
) |
sharedWith It would load the appropriate plugin to do it
notebook | notebook |
storage | Pointer to the storage in use |
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.
notebook | Shared notebook |
sharedWith | The list of email addresses or phone numbers of users |
storage | Pointer to the storage in use |
QString ServiceHandler::uiName | ( | QString | serviceId | ) |
Get the Name tp be shown on the UI of a service based on the id of the plugin.