Messagelib

messageviewercheckbeforedeletingparameters.cpp
1/*
2 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "messageviewercheckbeforedeletingparameters.h"
8using namespace MessageViewer;
9
10class MessageViewer::MessageViewerCheckBeforeDeletingParametersPrivate
11{
12public:
13 MessageViewerCheckBeforeDeletingParametersPrivate() = default;
15 MessageViewerCheckBeforeDeletingParameters::DeleteType mType = MessageViewerCheckBeforeDeletingParameters::Unknown;
16};
17
18MessageViewerCheckBeforeDeletingParameters::MessageViewerCheckBeforeDeletingParameters()
19 : d(new MessageViewer::MessageViewerCheckBeforeDeletingParametersPrivate)
20{
21}
22
23MessageViewerCheckBeforeDeletingParameters::MessageViewerCheckBeforeDeletingParameters(const MessageViewerCheckBeforeDeletingParameters &other)
24 : d(new MessageViewer::MessageViewerCheckBeforeDeletingParametersPrivate)
25{
26 (*this) = other;
27}
28
29MessageViewerCheckBeforeDeletingParameters::~MessageViewerCheckBeforeDeletingParameters() = default;
30
31Akonadi::Item::List MessageViewerCheckBeforeDeletingParameters::items() const
32{
33 return d->mList;
34}
35
36void MessageViewerCheckBeforeDeletingParameters::setItems(const Akonadi::Item::List &items)
37{
38 d->mList = items;
39}
40
41MessageViewerCheckBeforeDeletingParameters::DeleteType MessageViewerCheckBeforeDeletingParameters::deleteType() const
42{
43 return d->mType;
44}
45
46void MessageViewerCheckBeforeDeletingParameters::setDeleteType(DeleteType type)
47{
48 d->mType = type;
49}
50
51MessageViewerCheckBeforeDeletingParameters &MessageViewerCheckBeforeDeletingParameters::operator=(const MessageViewerCheckBeforeDeletingParameters &other)
52{
53 if (this != &other) {
54 d->mType = other.deleteType();
55 d->mList = other.items();
56 }
57 return *this;
58}
59
60bool MessageViewerCheckBeforeDeletingParameters::operator==(const MessageViewerCheckBeforeDeletingParameters &other) const
61{
62 return (d->mType == other.deleteType()) && (d->mList == other.items());
63}
64
65bool MessageViewerCheckBeforeDeletingParameters::isValid() const
66{
67 return !d->mList.isEmpty() && (d->mType != Unknown);
68}
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.