Akonadi Mime

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

KDE's Doxygen guidelines are available online.