Akonadi Mime

messagefolderattribute.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "messagefolderattribute.h"
8
9using namespace Akonadi;
10
11class Akonadi::MessageFolderAttributePrivate
12{
13public:
14 bool isOutboundFolder = false;
15};
16
18 : d(new MessageFolderAttributePrivate)
19{
20}
21
23 : Attribute(other)
24 , d(new MessageFolderAttributePrivate(*(other.d)))
25{
26}
27
29
30QByteArray MessageFolderAttribute::type() const
31{
32 static const QByteArray sType("MESSAGEFOLDER");
33 return sType;
34}
35
36MessageFolderAttribute *MessageFolderAttribute::clone() const
37{
38 return new MessageFolderAttribute(*this);
39}
40
41QByteArray MessageFolderAttribute::serialized() const
42{
43 QByteArray rv;
44
45 if (d->isOutboundFolder) {
46 rv = "outbound";
47 } else {
48 rv = "inbound";
49 }
50
51 return rv;
52}
53
54void MessageFolderAttribute::deserialize(const QByteArray &data)
55{
56 if (data == "outbound") {
57 d->isOutboundFolder = true;
58 } else {
59 d->isOutboundFolder = false;
60 }
61}
62
64{
65 return d->isOutboundFolder;
66}
67
69{
70 d->isOutboundFolder = outbound;
71}
MessageFolderAttribute()
Creates an empty folder attribute.
bool isOutboundFolder() const
Indicates if the folder is supposed to contain mostly outbound messages.
void setOutboundFolder(bool outbound)
Set if the folder should be considered as containing mostly outbound messages.
~MessageFolderAttribute() override
Destructor.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:21:09 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.