File indexing completed on 2024-11-17 04:44:46

0001 /*
0002     SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "ewscalendarhandler.h"
0008 
0009 #include <KCalendarCore/Event>
0010 
0011 #include "ewscreatecalendarjob.h"
0012 #include "ewsfetchcalendardetailjob.h"
0013 #include "ewsmodifycalendarjob.h"
0014 
0015 using namespace Akonadi;
0016 
0017 EwsCalendarHandler::EwsCalendarHandler() = default;
0018 
0019 EwsCalendarHandler::~EwsCalendarHandler() = default;
0020 
0021 EwsItemHandler *EwsCalendarHandler::factory()
0022 {
0023     return new EwsCalendarHandler();
0024 }
0025 
0026 EwsFetchItemDetailJob *EwsCalendarHandler::fetchItemDetailJob(EwsClient &client, QObject *parent, const Akonadi::Collection &collection)
0027 {
0028     return new EwsFetchCalendarDetailJob(client, parent, collection);
0029 }
0030 
0031 void EwsCalendarHandler::setSeenFlag(Item &item, bool value)
0032 {
0033     Q_UNUSED(item)
0034     Q_UNUSED(value)
0035 }
0036 
0037 QString EwsCalendarHandler::mimeType()
0038 {
0039     return KCalendarCore::Event::eventMimeType();
0040 }
0041 
0042 bool EwsCalendarHandler::setItemPayload(Akonadi::Item &item, const EwsItem &ewsItem)
0043 {
0044     Q_UNUSED(item)
0045     Q_UNUSED(ewsItem)
0046 
0047     return true;
0048 }
0049 
0050 EwsModifyItemJob *EwsCalendarHandler::modifyItemJob(EwsClient &client, const QList<Akonadi::Item> &items, const QSet<QByteArray> &parts, QObject *parent)
0051 {
0052     return new EwsModifyCalendarJob(client, items, parts, parent);
0053 }
0054 
0055 EwsCreateItemJob *EwsCalendarHandler::createItemJob(EwsClient &client,
0056                                                     const Akonadi::Item &item,
0057                                                     const Akonadi::Collection &collection,
0058                                                     EwsTagStore *tagStore,
0059                                                     EwsResource *parent)
0060 {
0061     return new EwsCreateCalendarJob(client, item, collection, tagStore, parent);
0062 }
0063 
0064 EWS_DECLARE_ITEM_HANDLER(EwsCalendarHandler, EwsItemTypeCalendarItem)