File indexing completed on 2024-12-22 04:57:01

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 "ewsitembase.h"
0010 #include "ewstypes.h"
0011 
0012 class QXmlStreamReader;
0013 class QXmlStreamWriter;
0014 class EwsFolderPrivate;
0015 
0016 class EwsFolder : public EwsItemBase
0017 {
0018 public:
0019     typedef QList<EwsFolder> List;
0020 
0021     EwsFolder();
0022     explicit EwsFolder(QXmlStreamReader &reader);
0023     EwsFolder(const EwsFolder &other);
0024     EwsFolder(EwsFolder &&other);
0025     ~EwsFolder() override;
0026 
0027     EwsFolder &operator=(const EwsFolder &other);
0028     EwsFolder &operator=(EwsFolder &&other);
0029 
0030     EwsFolderType type() const;
0031     void setType(EwsFolderType type);
0032 
0033     const QList<EwsFolder> childFolders() const;
0034     void addChild(EwsFolder &child);
0035     EwsFolder *parentFolder() const;
0036     void setParentFolder(EwsFolder *parent);
0037 
0038     bool write(QXmlStreamWriter &writer) const;
0039 
0040 protected:
0041     bool readBaseFolderElement(QXmlStreamReader &reader);
0042 };
0043 
0044 Q_DECLARE_METATYPE(EwsFolder)