KHolidays

holiday.cpp
1/*
2 This file is part of the kholidays library.
3
4 SPDX-FileCopyrightText: 2001 Cornelius Schumacher <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2004 Allen Winter <winter@kde.org>
6 SPDX-FileCopyrightText: 2008 David Jarvie <djarvie@kde.org>
7 SPDX-FileCopyrightText: 2010 John Layt <john@layt.net>
8
9 SPDX-License-Identifier: LGPL-2.0-or-later
10*/
11
12#include "holiday.h"
13#include "holiday_p.h"
14
15#include <QSharedData>
16
17using namespace KHolidays;
18
20 : d(new HolidayPrivate)
21{
22}
23
25 : d(other.d)
26{
27}
28
32
33Holiday &Holiday::operator=(const Holiday &other)
34{
35 if (&other != this) {
36 d = other.d;
37 }
38
39 return *this;
40}
41
42bool Holiday::operator<(const Holiday &rhs) const
43{
44 return d->mObservedDate < rhs.d->mObservedDate;
45}
46
47bool Holiday::operator>(const Holiday &rhs) const
48{
49 return d->mObservedDate > rhs.d->mObservedDate;
50}
51
53{
54 return d->mObservedDate;
55}
56
58{
59 return d->mObservedDate.addDays(d->mDuration - 1);
60}
61
63{
64 return d->mDuration;
65}
66
68{
69 return d->mName;
70}
71
73{
74 return d->mDescription;
75}
76
78{
79 return d->mDayType;
80}
81
83{
84 return d->mCategoryList;
85}
Represents a holiday event.
Definition holiday.h:30
int duration() const
Definition holiday.cpp:62
QDate observedStartDate() const
Definition holiday.cpp:52
QStringList categoryList() const
Definition holiday.cpp:82
DayType dayType() const
Returns the day type of the holiday.
Definition holiday.cpp:77
QDate observedEndDate() const
Definition holiday.cpp:57
QString description() const
Definition holiday.cpp:72
QString name() const
Definition holiday.cpp:67
Holiday()
Creates an empty holiday.
Definition holiday.cpp:19
~Holiday()
Destroys the holiday object.
Definition holiday.cpp:29
DayType
Describes the date type of the holiday.
Definition holiday.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:10 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.