Messagelib

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

KDE's Doxygen guidelines are available online.