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 <QSharedDataPointer>
0010 #include <QXmlStreamReader>
0011 
0012 #include "ewsitembase.h"
0013 
0014 class EwsMailboxPrivate;
0015 
0016 namespace KMime
0017 {
0018 namespace Types
0019 {
0020 class Mailbox;
0021 }
0022 }
0023 
0024 class EwsMailbox
0025 {
0026 public:
0027     typedef QList<EwsMailbox> List;
0028 
0029     EwsMailbox();
0030     explicit EwsMailbox(QXmlStreamReader &reader);
0031     EwsMailbox(const EwsMailbox &other);
0032     EwsMailbox(EwsMailbox &&other);
0033     virtual ~EwsMailbox();
0034 
0035     EwsMailbox &operator=(const EwsMailbox &other);
0036     EwsMailbox &operator=(EwsMailbox &&other);
0037 
0038     bool isValid() const;
0039     QString name() const;
0040     QString email() const;
0041     QString emailWithName() const;
0042     operator KMime::Types::Mailbox() const;
0043 
0044 protected:
0045     QSharedDataPointer<EwsMailboxPrivate> d;
0046 };
0047 
0048 Q_DECLARE_METATYPE(EwsMailbox)
0049 Q_DECLARE_METATYPE(EwsMailbox::List)