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 libextendedkcal 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 <incidence.h>
26 #include <QObject>
27 #include "mkcal_export.h"
28 #include "notebook.h"
29 #include "extendedcalendar.h"
30 #include "extendedstorage.h"
31 #include "servicehandlerif.h"
32 
33 const QString defaultName = "DefaultInvitationPlugin";
34 
35 class ServiceHandlerPrivate;
36 
37 namespace mKCal {
38 
42 {
43  Q_OBJECT
44 private:
48  ~ServiceHandler();
49 
50  ServiceHandlerPrivate *const d;
51 
52 public:
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.
58  enum ErrorCode {
59  ErrorOk = 0,
64  ErrorInternal
65  };
66 
71  {
72  static ServiceHandler singleton;
73  return singleton;
74  }
75 
86  bool sendInvitation(const KCalCore::Incidence::Ptr &invitation, const QString &body,
87  const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage,
88  const Notebook::Ptr &notebook = Notebook::Ptr());
89 
100  bool sendUpdate(const KCalCore::Incidence::Ptr &invitation, const QString &body, const ExtendedCalendar::Ptr &calendar,
101  const ExtendedStorage::Ptr &storage, const Notebook::Ptr &notebook = Notebook::Ptr());
102 
113  bool sendResponse(const KCalCore::Incidence::Ptr &invitation, const QString &body,
114  const ExtendedCalendar::Ptr &calendar, const ExtendedStorage::Ptr &storage,
115  const Notebook::Ptr &notebook = Notebook::Ptr());
116 
123  QString icon(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage);
124 
131  bool multiCalendar(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage);
132 
139  QString emailAddress(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage);
140 
147  QString displayName(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage);
148 
158  int downloadAttachment(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage, const QString &uri,
159  const QString &path);
160 
169  bool deleteAttachment(const KCalCore::Incidence::Ptr &incidence, const Notebook::Ptr &notebook,
170  const ExtendedStorage::Ptr &storage, const QString &uri);
171 
179  bool shareNotebook(const Notebook::Ptr &notebook, const QStringList &sharedWith, const ExtendedStorage::Ptr &storage);
180 
187  QStringList sharedWith(const Notebook::Ptr &notebook, const ExtendedStorage::Ptr &storage);
188 
195  QString defaultNotebook(const QString &productId);
196 
205  ServiceHandler::ErrorCode error() const;
206 
207 
209 
217  QStringList availableServices();
218 
225  QString icon(QString serviceId);
226 
233  QString uiName(QString serviceId);
234 
235 signals:
237  void downloadProgress(int id, int percentage);
238 
240  void downloadFinished(int id);
241 
243  void downloadError(int id, ErrorCode error);
244 };
245 
246 }
247 #endif // MKCAL_SERVICEHANDLER_H
extendedcalendar.h
mKCal::ServiceHandler::instance
static ServiceHandler & instance()
Obtain an instance of the ServiceHandler.
Definition: servicehandler.h:70
servicehandlerif.h
mKCal::ServiceHandler::ErrorNoAccount
@ ErrorNoAccount
Definition: servicehandler.h:60
notebook.h
mKCal::ServiceHandler::ErrorNotSupported
@ ErrorNotSupported
Definition: servicehandler.h:61
mKCal::ServiceHandler::ErrorCode
ErrorCode
Error Codes that can be returned by the plugins.
Definition: servicehandler.h:58
mkcal_export.h
defaultName
const QString defaultName
Definition: servicehandler.h:33
mKCal::ServiceHandler::ErrorInvalidParameters
@ ErrorInvalidParameters
Definition: servicehandler.h:63
mKCal::Notebook::Ptr
QSharedPointer< Notebook > Ptr
A shared pointer to a Notebook object.
Definition: notebook.h:53
mKCal
Definition: extendedstorage.h:49
mKCal::ServiceHandler::ErrorNoConnectivity
@ ErrorNoConnectivity
Definition: servicehandler.h:62
mKCal::ExtendedStorage::Ptr
QSharedPointer< ExtendedStorage > Ptr
A shared pointer to a ExtendedStorage.
Definition: extendedstorage.h:94
MKCAL_EXPORT
#define MKCAL_EXPORT
Definition: mkcal_export.h:27
extendedstorage.h
mKCal::ServiceHandler
Singleton class to get the exact handler (plugin) of the service.
Definition: servicehandler.h:41

Generated on Sat Oct 17 2020 06:54:57 for libextendedkcal by doxygen 1.8.17