File indexing completed on 2024-12-22 04:57:00
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 "ewsfolder.h" 0013 #include "ewsrequest.h" 0014 #include "ewstypes.h" 0015 0016 class QXmlStreamReader; 0017 0018 class EwsCreateFolderRequest : public EwsRequest 0019 { 0020 Q_OBJECT 0021 public: 0022 class Response : public EwsRequest::Response 0023 { 0024 public: 0025 const EwsId &folderId() const 0026 { 0027 return mId; 0028 } 0029 0030 protected: 0031 Response(QXmlStreamReader &reader); 0032 0033 EwsId mId; 0034 0035 friend class EwsCreateFolderRequest; 0036 }; 0037 0038 EwsCreateFolderRequest(EwsClient &client, QObject *parent); 0039 ~EwsCreateFolderRequest() override; 0040 0041 void setFolders(const EwsFolder::List &folders) 0042 { 0043 mFolders = folders; 0044 } 0045 0046 void setParentFolderId(const EwsId &id) 0047 { 0048 mParentFolderId = 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 EwsFolder::List mFolders; 0064 EwsId mParentFolderId; 0065 QList<Response> mResponses; 0066 };