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

0001 /*
0002     SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/Item>
0010 #include <Akonadi/ResourceBase>
0011 #include <Akonadi/TransportResourceBase>
0012 
0013 class OrgKdeAkonadiEwsResourceInterface;
0014 
0015 class EwsMtaResource : public Akonadi::ResourceBase, public Akonadi::TransportResourceBase
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit EwsMtaResource(const QString &id);
0020     ~EwsMtaResource() override;
0021 
0022     void sendItem(const Akonadi::Item &item) override;
0023 public Q_SLOTS:
0024     void configure(WId windowId) override;
0025 protected Q_SLOTS:
0026     void retrieveCollections() override;
0027     void retrieveItems(const Akonadi::Collection &collection) override;
0028     bool retrieveItems(const Akonadi::Item::List &items, const QSet<QByteArray> &parts) override;
0029 
0030 private:
0031     void messageSent(const QString &id, const QString &error);
0032     [[nodiscard]] bool connectEws();
0033 
0034     OrgKdeAkonadiEwsResourceInterface *mEwsResource = nullptr;
0035     QHash<QString, Akonadi::Item> mItemHash;
0036 };