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
42{
43 Q_OBJECT
44private:
49
50 ServiceHandlerPrivate *const d;
51
52public:
53
55 //Right now they are the same as defined in ServiceHandlerIf
56 //But semantically it doesn't make sense that they are defined
57 //there and at some point they might be different.
66
71 {
72 static ServiceHandler singleton;
73 return singleton;
74 }
75
82 bool sendInvitation(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body);
83
90 bool sendUpdate(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body);
91
98 bool sendResponse(const Notebook::Ptr &notebook, const KCalendarCore::Incidence::Ptr &invitation, const QString &body);
99
104 QString icon(const QString &serviceId);
105
110 bool multiCalendar(const QString &serviceId);
111
115 QString emailAddress(const Notebook::Ptr &notebook);
116
122 QString displayName(const Notebook::Ptr &notebook);
123
132 int downloadAttachment(const Notebook::Ptr &notebook, const QString &uri, const QString &path);
133
141 bool deleteAttachment(const KCalendarCore::Incidence::Ptr &incidence, const Notebook::Ptr &notebook,
142 const QString &uri);
143
150 bool shareNotebook(const Notebook::Ptr &notebook, const QStringList &sharedWith);
151
157 QStringList sharedWith(const Notebook::Ptr &notebook);
158
165 QString defaultNotebook(const QString &productId);
166
175 ServiceHandler::ErrorCode error() const;
176
177
179
187 QStringList availableServices();
188
195 QString icon(QString serviceId);
196
203 QString uiName(QString serviceId);
204
210 ServiceInterface* service(const QString &serviceId);
211
212signals:
214 void downloadProgress(int id, int percentage);
215
217 void downloadFinished(int id);
218
220 void downloadError(int id, ErrorCode error);
221};
222
223}
224#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
Singleton class to get the exact handler (plugin) of the service In case of API with a notebook argum...
Definition servicehandler.h:42
static ServiceHandler & instance()
Obtain an instance of the ServiceHandler.
Definition servicehandler.h:70
void downloadError(int id, ErrorCode error)
Informs that the download is finished with errors.
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:58
@ ErrorInvalidParameters
Definition servicehandler.h:63
@ ErrorNoAccount
Definition servicehandler.h:60
@ ErrorNotSupported
Definition servicehandler.h:61
@ ErrorNoConnectivity
Definition servicehandler.h:62
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 Thu Nov 28 2024 09:02:24 for libextendedkcal by doxygen 1.12.0