KWeatherCore

caparea.cpp
1/*
2 * SPDX-FileCopyrightText: 2021 Han Young <hanyoung@protonmail.com>
3 * SPDX-FileCopyrightText: 2021 Anjani Kumar <anjanik012@gmail.com>
4 * SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#include "caparea.h"
9
10using namespace KWeatherCore;
11
12namespace KWeatherCore
13{
14class CAPAreaPrivate : public QSharedData
15{
16public:
17 QString description;
18 std::vector<CAPPolygon> polygons;
19 std::vector<CAPCircle> circles;
20 std::vector<CAPNamedValue> geoCodes;
21 float altitude = NAN;
22 float ceiling = NAN;
23};
24}
25
26CAPArea::CAPArea()
27 : d(new CAPAreaPrivate)
28{
29}
30
31CAPArea::CAPArea(const CAPArea &other) = default;
32CAPArea::CAPArea(CAPArea &&other) noexcept = default;
33CAPArea::~CAPArea() = default;
34CAPArea &CAPArea::operator=(const CAPArea &other) = default;
35CAPArea &CAPArea::operator=(CAPArea &&other) noexcept = default;
36
37QString CAPArea::description() const
38{
39 return d->description;
40}
41
42void CAPArea::setDescription(const QString &areaDesc)
43{
44 d->description = areaDesc;
45}
46
47const std::vector<CAPPolygon> &CAPArea::polygons() const
48{
49 return d->polygons;
50}
51
52void CAPArea::addPolygon(CAPPolygon &&polygon)
53{
54 d->polygons.push_back(std::move(polygon));
55}
56
57const std::vector<CAPCircle> &CAPArea::circles() const
58{
59 return d->circles;
60}
61
62void CAPArea::addCircle(CAPCircle &&circle)
63{
64 d->circles.push_back(std::move(circle));
65}
66
67const std::vector<CAPNamedValue> &CAPArea::geoCodes() const
68{
69 return d->geoCodes;
70}
71
72void CAPArea::addGeoCode(CAPNamedValue &&geoCode)
73{
74 d->geoCodes.push_back(std::move(geoCode));
75}
76
77float CAPArea::altitude() const
78{
79 return d->altitude;
80}
81
82void CAPArea::setAltitude(float altitude)
83{
84 d->altitude = altitude;
85}
86
87float CAPArea::ceiling() const
88{
89 return d->ceiling;
90}
91
92void CAPArea::setCeiling(float ceiling)
93{
94 d->ceiling = ceiling;
95}
96
97#include "moc_caparea.cpp"
Affected area of a CAP alert message.
Definition caparea.h:53
const std::vector< CAPCircle > & circles() const
Geographic circles(s) enclosing the message target area.
Definition caparea.cpp:57
const std::vector< CAPPolygon > & polygons() const
Geographic polygon(s) enclosing the message target area.
Definition caparea.cpp:47
const std::vector< CAPNamedValue > & geoCodes() const
Any geographically-based code to describe a message target area, as key/value pair.
Definition caparea.cpp:67
Geographic circle describing the target area of a CAP alert message.
Definition caparea.h:35
CAP key/value pairs as found in area geo codes, alert event codes or alert parameters.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.