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 
0011 #include "ewsid.h"
0012 #include "ewspropertyfield.h"
0013 
0014 class EwsItemBasePrivate;
0015 
0016 class EwsItemBase
0017 {
0018 public:
0019     EwsItemBase(const EwsItemBase &other);
0020     EwsItemBase(EwsItemBase &&other);
0021     virtual ~EwsItemBase();
0022     EwsItemBase &operator=(const EwsItemBase &other);
0023     EwsItemBase &operator=(EwsItemBase &&other);
0024 
0025     bool isValid() const;
0026 
0027     bool hasField(EwsItemFields f) const;
0028     QVariant operator[](EwsItemFields f) const;
0029 
0030     QVariant operator[](const EwsPropertyField &prop) const;
0031 
0032     void setField(EwsItemFields f, const QVariant &value);
0033     void setProperty(const EwsPropertyField &prop, const QVariant &value);
0034 
0035 protected:
0036     EwsItemBase(const QSharedDataPointer<EwsItemBasePrivate> &priv);
0037 
0038     void resetFields();
0039 
0040     QSharedDataPointer<EwsItemBasePrivate> d;
0041 };