8#include "messagedisplayformatattribute.h"
13using namespace MessageViewer;
15class MessageViewer::MessageDisplayFormatAttributePrivate
18 MessageDisplayFormatAttributePrivate() =
default;
20 Viewer::DisplayFormatMessage messageFormat = Viewer::UseGlobalSetting;
21 bool remoteContent =
false;
24MessageDisplayFormatAttribute::MessageDisplayFormatAttribute()
25 : d(new MessageDisplayFormatAttributePrivate)
29MessageDisplayFormatAttribute::~MessageDisplayFormatAttribute() =
default;
34 messageDisplayFormatAttr->setMessageFormat(messageFormat());
35 messageDisplayFormatAttr->setRemoteContent(remoteContent());
36 return messageDisplayFormatAttr;
39QByteArray MessageDisplayFormatAttribute::type()
const
41 static const QByteArray sType(
"MessageDisplayFormatAttribute");
45QByteArray MessageDisplayFormatAttribute::serialized()
const
56void MessageDisplayFormatAttribute::setMessageFormat(Viewer::DisplayFormatMessage format)
58 d->messageFormat = format;
61void MessageDisplayFormatAttribute::setRemoteContent(
bool remote)
63 d->remoteContent = remote;
66bool MessageDisplayFormatAttribute::remoteContent()
const
68 return d->remoteContent;
73 return (d->messageFormat == other.messageFormat()) && (d->remoteContent == other.remoteContent());
76Viewer::DisplayFormatMessage MessageDisplayFormatAttribute::messageFormat()
const
78 return d->messageFormat;
81void MessageDisplayFormatAttribute::deserialize(
const QByteArray &data)
87 d->messageFormat =
static_cast<Viewer::DisplayFormatMessage
>(value);
88 s >> d->remoteContent;