Interface implemented by plugins for handling services.
More...
#include <servicehandlerif.h>
|
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 ¬ebook)=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 ¬ebook) const =0 |
| returns the display name of account of service.
|
|
virtual bool | downloadAttachment (const mKCal::Notebook::Ptr ¬ebook, const QString &uri, const QString &path)=0 |
| Start the download of an attachment.
|
|
virtual bool | deleteAttachment (const mKCal::Notebook::Ptr ¬ebook, const KCalendarCore::Incidence::Ptr &incidence, const QString &uri)=0 |
| start the deletion of an attachment.
|
|
virtual bool | shareNotebook (const mKCal::Notebook::Ptr ¬ebook, const QStringList &sharedWith)=0 |
| Share notebook.
|
|
virtual QStringList | sharedWith (const mKCal::Notebook::Ptr ¬ebook)=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 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 () |
|
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.
◆ ErrorCode
Error Codes that can be returned by the plugins.
Enumerator |
---|
ErrorOk | |
ErrorNoAccount | |
ErrorNotSupported | |
ErrorNoConnectivity | |
ErrorInvalidParameters | |
ErrorInternal | |
◆ ~ServiceInterface()
virtual ServiceInterface::~ServiceInterface |
( |
| ) |
|
|
inlinevirtual |
◆ checkProductId()
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
◆ defaultNotebook()
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.
◆ deleteAttachment()
virtual bool ServiceInterface::deleteAttachment |
( |
const mKCal::Notebook::Ptr & | notebook, |
|
|
const KCalendarCore::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.
◆ displayName()
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
◆ downloadAttachment()
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.
@param notebook pointer to the notebook
@param uri uri of attachment to be downloaded
@param path path where attachment to be downloaded to
- Returns
- True if OK, false otherwise.
◆ emailAddress()
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
◆ error()
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
◆ icon()
virtual QString ServiceInterface::icon |
( |
| ) |
const |
|
pure virtual |
returns icon of service.
- Returns
- Path to the Icon.
◆ multiCalendar()
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.
◆ serviceName()
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.
◆ sharedWith()
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
◆ shareNotebook()
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.
◆ uiName()
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: