KWeatherCore

alertentry.cpp
1 /*
2  * SPDX-FileCopyrightText: 2021 Anjani Kumar <[email protected]>
3  * SPDX-License-Identifier: LGPL-2.0-or-later
4  */
5 
6 #include "alertentry.h"
7 #include "alertinfo.h"
8 
9 namespace KWeatherCore
10 {
11 class AlertEntry::AlertEntryPrivate
12 {
13 public:
17  Status status = Status::Unknown;
18  MsgType msgType = MsgType::Unknown;
19  Scope scope = Scope::Unknown;
20  QString note;
21  std::vector<AlertInfo> infoVec;
22 };
23 
25  : d(std::make_unique<AlertEntryPrivate>())
26 {
27 }
29  : d(std::make_unique<AlertEntryPrivate>(*other.d))
30 {
31 }
32 AlertEntry::AlertEntry(AlertEntry &&other) = default;
33 AlertEntry::~AlertEntry() = default;
34 AlertEntry &AlertEntry::operator=(const AlertEntry &other)
35 {
36  *this->d = *other.d;
37  return *this;
38 }
39 AlertEntry &AlertEntry::operator=(AlertEntry &&other) = default;
40 const QString &AlertEntry::identifier() const
41 {
42  return d->identifier;
43 }
44 const QString &AlertEntry::sender() const
45 {
46  return d->sender;
47 }
48 const QDateTime &AlertEntry::sentTime() const
49 {
50  return d->sentTime;
51 }
52 AlertEntry::Status AlertEntry::status() const
53 {
54  return d->status;
55 }
56 AlertEntry::MsgType AlertEntry::msgType() const
57 {
58  return d->msgType;
59 }
60 AlertEntry::Scope AlertEntry::scope() const
61 {
62  return d->scope;
63 }
64 const QString &AlertEntry::note() const
65 {
66  return d->note;
67 }
68 const std::vector<AlertInfo> &AlertEntry::infoVec() const
69 {
70  return d->infoVec;
71 }
72 void AlertEntry::setIdentifier(const QString &identifier)
73 {
74  d->identifier = identifier;
75 }
76 void AlertEntry::setSender(const QString &sender)
77 {
78  d->sender = sender;
79 }
80 void AlertEntry::setSentTime(const QDateTime &dateTime)
81 {
82  d->sentTime = dateTime;
83 }
84 void AlertEntry::setStatus(Status status)
85 {
86  d->status = status;
87 }
88 void AlertEntry::setMsgType(MsgType msgType)
89 {
90  d->msgType = msgType;
91 }
92 void AlertEntry::setScope(Scope scope)
93 {
94  d->scope = scope;
95 }
96 void AlertEntry::setNote(const QString &note)
97 {
98  d->note = note;
99 }
100 void AlertEntry::setInfoVec(const std::vector<AlertInfo> &infoVec)
101 {
102  d->infoVec = infoVec;
103 }
104 void AlertEntry::setInfoVec(std::vector<AlertInfo> &&infoVec)
105 {
106  d->infoVec = std::move(infoVec);
107 }
108 void AlertEntry::addInfo(const AlertInfo &alertInfo)
109 {
110  d->infoVec.push_back(alertInfo);
111 }
112 void AlertEntry::addInfo(AlertInfo &&alertInfo)
113 {
114  d->infoVec.emplace_back(alertInfo);
115 }
116 }
Class represents single CAP.
Definition: alertinfo.h:27
const QString & note() const
note of CAP
AlertEntry()
Default constructor, Status, MsgType, Scope are set to Unknown.
Definition: alertentry.cpp:24
Class represents single CAP.
Definition: alertentry.h:24
const QDateTime & sentTime() const
sentTime of CAP
const std::vector< AlertInfo > & infoVec() const
the parsed info entries in CAP see
Definition: alertentry.cpp:68
Status status() const
status enum, initilized to Unknown
Definition: alertentry.cpp:52
Scope scope() const
scope enum, initilized to Unknown
Definition: alertentry.cpp:60
const QString & identifier() const
identifier of CAP
const QString & sender() const
CAP file sender.
MsgType msgType() const
msgType enum, initilized to Unknown
Definition: alertentry.cpp:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Oct 21 2021 23:05:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.