Singleton class to get the exact handler (plugin) of the service. More...
#include <servicehandler.h>
Classes | |
class | Private |
Public Types | |
enum | ErrorCode { ErrorOk = 0, ErrorNoAccount, ErrorNotSupported, ErrorNoConnectivity, ErrorInvalidParameters, ErrorInternal } |
Error Codes that can be returned by the plugins. More... | |
enum | ExecutedPlugin { None = 0, SendInvitation, SendResponse, SendUpdate } |
Executed 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 KCalCore::Incidence::Ptr &invitation, const QString &body, const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage) |
Send the invitation to the list of people stated as attendees. | |
bool | sendUpdate (const KCalCore::Incidence::Ptr &invitation, const QString &body, const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage) |
Send the updated invitation to the list of people stated as attendees. | |
bool | sendResponse (const KCalCore::Incidence::Ptr &invitation, const QString &body, const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage) |
Send the updated invitation to the organiser. | |
bool | responseClaimed (const KCalCore::Incidence::Ptr &response, const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage) |
Notify the service that the user accepts/declined the invitation, but declined to send the response. | |
QString | icon (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
Icon It would load the appropiate plugin to do it. | |
bool | multiCalendar (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
multiCalendar It would load the appropiate plugin to do it | |
QString | emailAddress (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
emailAddress It would load the appropiate plugin to do it | |
QString | displayName (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
displayName It would load the appropiate plugin to do it | |
int | downloadAttachment (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage, const QString &uri, const QString &path) |
downloadAttachment It would load the appropiate plugin to do it | |
bool | deleteAttachment (const KCalCore::Incidence::Ptr &incidence, const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage, const QString &uri) |
deleteAttachment It would load the appropiate plugin to do it | |
bool | shareNotebook (const Notebook::Ptr ¬ebook, const QStringList &sharedWith, const ExtendedStorage::Ptr &storage) |
Share notebook It would load the appropiate plugin to do it. | |
QStringList | sharedWith (const Notebook::Ptr ¬ebook, const ExtendedStorage::Ptr &storage) |
sharedWith It would load the appropiate plugin to do it | |
QString | defaultNotebook (const QString &productId) |
Try to get the notebook where to put the inviatation. | |
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 tp be shown on the UI of a service based on the id of the plugin. | |
QString | defaultEmailAddress () |
defaultEmailAddress Returns the default email address if available | |
Static Public Member Functions | |
static ServiceHandler & | instance () |
Obtain an instance of the ServiceHandler. | |
static void | destroy () |
Destroy the ServiceHandler. |
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::defaultEmailAddress | ( | ) |
defaultEmailAddress Returns the default email address if available
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 KCalCore::Incidence::Ptr & | incidence, | |
const Notebook::Ptr & | notebook, | |||
const ExtendedStorage::Ptr & | storage, | |||
const QString & | uri | |||
) |
deleteAttachment It would load the appropiate 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 |
void ServiceHandler::destroy | ( | ) | [static] |
Destroy the ServiceHandler.
It should be done before the QCoreApplication is closed
QString ServiceHandler::displayName | ( | const Notebook::Ptr & | notebook, | |
const ExtendedStorage::Ptr & | storage | |||
) |
displayName It would load the appropiate 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 appropiate 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 |
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
void mKCal::ServiceHandler::downloadFinished | ( | int | id | ) | [signal] |
Informs that the download is over.
The id is the return value got when download started
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
QString ServiceHandler::emailAddress | ( | const Notebook::Ptr & | notebook, | |
const ExtendedStorage::Ptr & | storage | |||
) |
emailAddress It would load the appropiate 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 | ( | QString | serviceId | ) |
Get the Icon of a service based on the id of the plugin.
QString ServiceHandler::icon | ( | const Notebook::Ptr & | notebook, | |
const ExtendedStorage::Ptr & | storage | |||
) |
Icon It would load the appropiate plugin to do it.
notebook | notebook | |
storage | Pointer to the storage in use |
ServiceHandler & ServiceHandler::instance | ( | ) | [static] |
Obtain an instance of the ServiceHandler.
bool ServiceHandler::multiCalendar | ( | const Notebook::Ptr & | notebook, | |
const ExtendedStorage::Ptr & | storage | |||
) |
multiCalendar It would load the appropiate plugin to do it
notebook | notebook | |
storage | Pointer to the storage in use |
bool ServiceHandler::responseClaimed | ( | const KCalCore::Incidence::Ptr & | response, | |
const ExtendedCalendar::Ptr & | calendar, | |||
const ExtendedStorage::Ptr & | storage | |||
) |
Notify the service that the user accepts/declined the invitation, but declined to send the response.
[in] | response | The incidence representing the user response |
[in] | storage | Pointer to the storage in use |
bool mKCal::ServiceHandler::sendInvitation | ( | const KCalCore::Incidence::Ptr & | invitation, | |
const QString & | body, | |||
const ExtendedCalendar::Ptr & | calendar, | |||
const ExtendedStorage::Ptr & | storage | |||
) |
Send the invitation to the list of people stated as attendees.
It would load the appropiate 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 |
bool mKCal::ServiceHandler::sendResponse | ( | const KCalCore::Incidence::Ptr & | invitation, | |
const QString & | body, | |||
const ExtendedCalendar::Ptr & | calendar, | |||
const ExtendedStorage::Ptr & | storage | |||
) |
Send the updated invitation to the organiser.
It would load the appropiate 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 |
bool mKCal::ServiceHandler::sendUpdate | ( | const KCalCore::Incidence::Ptr & | invitation, | |
const QString & | body, | |||
const ExtendedCalendar::Ptr & | calendar, | |||
const ExtendedStorage::Ptr & | storage | |||
) |
Send the updated invitation to the list of people stated as attendees.
It would load the appropiate 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 |
QStringList ServiceHandler::sharedWith | ( | const Notebook::Ptr & | notebook, | |
const ExtendedStorage::Ptr & | storage | |||
) |
sharedWith It would load the appropiate 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 appropiate 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.