KHolidays 5.109.0
holiday.h
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#ifndef KHOLIDAYS_HOLIDAY_H
13#define KHOLIDAYS_HOLIDAY_H
14
15#include "kholidays_export.h"
16
17#include <QList>
18#include <QSharedDataPointer>
19
20class QDate;
21class QString;
22
23namespace KHolidays
24{
25class HolidayPrivate;
26class HolidayRegion;
27
29class KHOLIDAYS_EXPORT Holiday
30{
31 friend class HolidayRegion;
32 friend class HolidayParserDriver;
33 friend class HolidayParserDriverPlan;
34 friend class HolidayParserDriverPlanOld;
35
36public:
40 typedef QList<Holiday> List;
41
46 enum DayType {
49 };
50
55
59 Holiday(const Holiday &other);
60
65
69 Holiday &operator=(const Holiday &other);
70
74 bool operator<(const Holiday &rhs) const;
75
79 bool operator>(const Holiday &rhs) const;
80
86 QDate observedStartDate() const;
87
93 QDate observedEndDate() const;
94
100 int duration() const;
101
109 QString name() const;
110
118 QString description() const;
119
124
131 QStringList categoryList() const;
132
133private:
134 QSharedDataPointer<HolidayPrivate> d;
135};
136
137}
138
139#endif // KHOLIDAYS_HOLIDAY_H
Represents a holiday region.
Definition holidayregion.h:32
Represents a holiday event.
Definition holiday.h:30
int duration() const
QDate observedStartDate() const
Holiday(const Holiday &other)
Creates a holiday from an other holiday.
~Holiday()
Destroys the holiday object.
QDate observedEndDate() const
DayType dayType() const
Returns the day type of the holiday.
QStringList categoryList() const
Holiday()
Creates an empty holiday.
QList< Holiday > List
A list of holiday descriptions.
Definition holiday.h:40
QString description() const
QString name() const
DayType
Describes the date type of the holiday.
Definition holiday.h:46
@ NonWorkday
The holiday is a real holiday.
Definition holiday.h:48
@ Workday
The holiday is a workday.
Definition holiday.h:47