servicehandler.h
Go to the documentation of this file.
1#ifndef MKCAL_SERVICEHANDLER_H
2#define MKCAL_SERVICEHANDLER_H
3/*
4 This file is part of the libmkcal library.
5
6 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
7 Contact: Alvaro Manera <alvaro.manera@nokia.com>
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.
23*/
24
25#include <KCalendarCore/Incidence>
26#include <QObject>
27#include "mkcal_export.h"
28#include "notebook.h"
29#include "servicehandlerif.h"
30
31const QString defaultName = "DefaultInvitationPlugin";
32
33class ServiceHandlerPrivate;
34
35namespace mKCal {
36
41class MKCAL_EXPORT ServiceHandler : QObject
42{
43 Q_OBJECT
44private:
47 ServiceHandler();
48 ~ServiceHandler();
49
50 ServiceHandlerPrivate *const d;
51
52public:
54 //Right now they are the same as defined in ServiceHandlerIf
55 //But semantically it doesn't make sense that they are defined
56 //there and at some point they might be different.
65
69 static ServiceHandler &instance()
70 {
71 static ServiceHandler singleton;
72 return singleton;
73 }
74
81 bool sendInvitation(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation,
82 const QString &body);
83
90 bool sendUpdate(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation,
91 const QString &body);
92
99 bool sendResponse(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation,
100 const QString &body);
101
106 QString icon(const QString &serviceId);
107
112 bool multiCalendar(const QString &serviceId);
113
117 QString emailAddress(const Notebook::Ptr &notebook);
118
124 QString displayName(const Notebook::Ptr &notebook);
125
134 int downloadAttachment(const Notebook::Ptr &notebook, const QString &uri, const QString &path);
135
143 bool deleteAttachment(const KCalendarCore::Incidence::Ptr &incidence, const Notebook::Ptr &notebook,
144 const QString &uri);
145
152 bool shareNotebook(const Notebook::Ptr &notebook, const QStringList &sharedWith);
153
159 QStringList sharedWith(const Notebook::Ptr &notebook);
160
167 QString defaultNotebook(const QString &productId);
168
177 ServiceHandler::ErrorCode error() const;
178
179
181
189 QStringList availableServices();
190
197 QString icon(QString serviceId);
198
205 QString uiName(QString serviceId);
206
212 ServiceInterface* service(const QString &serviceId);
213
214signals:
216 void downloadProgress(int id, int percentage);
217
219 void downloadFinished(int id);
220
223};
224
225}
226#endif // MKCAL_SERVICEHANDLER_H
Interface implemented by plugins for handling services.
Definition servicehandlerif.h:51
QSharedPointer< Notebook > Ptr
A shared pointer to a Notebook object.
Definition notebook.h:51
static ServiceHandler & instance()
Obtain an instance of the ServiceHandler.
Definition servicehandler.h:69
void downloadError(int id, ErrorCode error)
Informs that the download is finished with errors.
ServiceHandler::ErrorCode error() const
In case of error, more detailed information can be provided Sometimes the true/false is not enough,...
Definition servicehandler.cpp:354
void downloadProgress(int id, int percentage)
Monitors the progress of the download.
ErrorCode
Error Codes that can be returned by the plugins.
Definition servicehandler.h:57
@ ErrorInvalidParameters
Definition servicehandler.h:62
@ ErrorOk
Definition servicehandler.h:58
@ ErrorNoAccount
Definition servicehandler.h:59
@ ErrorNotSupported
Definition servicehandler.h:60
@ ErrorNoConnectivity
Definition servicehandler.h:61
@ ErrorInternal
Definition servicehandler.h:63
void downloadFinished(int id)
Informs that the download is over.
#define MKCAL_EXPORT
Definition mkcal_export.h:29
Definition extendedstorage.h:49
This file is part of the API for handling calendar data and defines the Notebook class.
const QString defaultName
Definition servicehandler.h:31
This file defines the common Interface to be inherited by all processes that handle service informati...

Generated on for libextendedkcal by doxygen 1.16.1