File indexing completed on 2024-12-22 04:57:02
0001 /* 0002 SPDX-FileCopyrightText: 2015-2017 Krzysztof Nowicki <krissn@op.pl> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QList> 0010 #include <QSharedPointer> 0011 0012 #include "ewsitem.h" 0013 #include "ewsrequest.h" 0014 #include "ewstypes.h" 0015 0016 class QXmlStreamReader; 0017 0018 class EwsMoveItemRequest : public EwsRequest 0019 { 0020 Q_OBJECT 0021 public: 0022 class Response : public EwsRequest::Response 0023 { 0024 public: 0025 const EwsId &itemId() const 0026 { 0027 return mId; 0028 } 0029 0030 protected: 0031 explicit Response(QXmlStreamReader &reader); 0032 0033 EwsId mId; 0034 0035 friend class EwsMoveItemRequest; 0036 }; 0037 0038 EwsMoveItemRequest(EwsClient &client, QObject *parent); 0039 ~EwsMoveItemRequest() override; 0040 0041 void setItemIds(const EwsId::List &ids) 0042 { 0043 mIds = ids; 0044 } 0045 0046 void setDestinationFolderId(const EwsId &id) 0047 { 0048 mDestFolderId = id; 0049 } 0050 0051 void start() override; 0052 0053 const QList<Response> &responses() const 0054 { 0055 return mResponses; 0056 } 0057 0058 protected: 0059 bool parseResult(QXmlStreamReader &reader) override; 0060 bool parseItemsResponse(QXmlStreamReader &reader); 0061 0062 private: 0063 EwsId::List mIds; 0064 EwsId mDestFolderId; 0065 QList<Response> mResponses; 0066 };