Akonadi Mime

newmailnotifierattribute.cpp
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "newmailnotifierattribute.h"
8
9#include <QByteArray>
10#include <QDataStream>
11#include <QIODevice>
12
13namespace Akonadi
14{
15class NewMailNotifierAttributePrivate
16{
17public:
18 bool ignoreNewMail = false;
19};
20
21NewMailNotifierAttribute::NewMailNotifierAttribute()
22 : d(new NewMailNotifierAttributePrivate)
23{
24}
25
26NewMailNotifierAttribute::~NewMailNotifierAttribute() = default;
27
28NewMailNotifierAttribute *NewMailNotifierAttribute::clone() const
29{
30 auto attr = new NewMailNotifierAttribute();
31 attr->setIgnoreNewMail(ignoreNewMail());
32 return attr;
33}
34
35QByteArray NewMailNotifierAttribute::type() const
36{
37 static const QByteArray sType("newmailnotifierattribute");
38 return sType;
39}
40
41QByteArray NewMailNotifierAttribute::serialized() const
42{
43 QByteArray result;
45 s << ignoreNewMail();
46 return result;
47}
48
49void NewMailNotifierAttribute::deserialize(const QByteArray &data)
50{
51 QDataStream s(data);
52 s >> d->ignoreNewMail;
53}
54
55bool NewMailNotifierAttribute::ignoreNewMail() const
56{
57 return d->ignoreNewMail;
58}
59
60void NewMailNotifierAttribute::setIgnoreNewMail(bool b)
61{
62 d->ignoreNewMail = b;
63}
64
65bool NewMailNotifierAttribute::operator==(const NewMailNotifierAttribute &other) const
66{
67 return d->ignoreNewMail == other.ignoreNewMail();
68}
69}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.