File indexing completed on 2025-03-09 04:54:40

0001 /*
0002   SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: LGPL-2.0-or-later
0005 
0006 */
0007 
0008 #pragma once
0009 
0010 #include "messageviewer/viewer.h"
0011 #include "messageviewer_export.h"
0012 #include <Akonadi/Attribute>
0013 namespace MessageViewer
0014 {
0015 class MessageDisplayFormatAttributePrivate;
0016 /**
0017  * @brief The MessageDisplayFormatAttribute class
0018  * @author Laurent Montel <montel@kde.org>
0019  */
0020 class MESSAGEVIEWER_EXPORT MessageDisplayFormatAttribute : public Akonadi::Attribute
0021 {
0022 public:
0023     explicit MessageDisplayFormatAttribute();
0024     ~MessageDisplayFormatAttribute() override;
0025 
0026     [[nodiscard]] MessageDisplayFormatAttribute *clone() const override;
0027     [[nodiscard]] QByteArray type() const override;
0028     [[nodiscard]] QByteArray serialized() const override;
0029     void deserialize(const QByteArray &data) override;
0030 
0031     void setMessageFormat(Viewer::DisplayFormatMessage format);
0032     [[nodiscard]] Viewer::DisplayFormatMessage messageFormat() const;
0033 
0034     void setRemoteContent(bool remote);
0035     [[nodiscard]] bool remoteContent() const;
0036 
0037     [[nodiscard]] bool operator==(const MessageDisplayFormatAttribute &other) const;
0038 
0039 private:
0040     friend class MessageDisplayFormatAttributePrivate;
0041     std::unique_ptr<MessageDisplayFormatAttributePrivate> const d;
0042 };
0043 }