KHolidays

holidayregion.h
1 /*
2  This file is part of the kholidays library.
3 
4  SPDX-FileCopyrightText: 2001 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2004 Allen Winter <[email protected]>
6  SPDX-FileCopyrightText: 2008 David Jarvie <[email protected]>
7  SPDX-FileCopyrightText: 2010 John Layt <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11 
12 #ifndef KHOLIDAYS_HOLIDAYREGION_H
13 #define KHOLIDAYS_HOLIDAYREGION_H
14 
15 #include "kholidays_export.h"
16 
17 #include <QSharedDataPointer>
18 #include <QString>
19 
20 #include "holiday.h"
21 
22 class QDate;
23 class QStringList;
24 class QFileInfo;
25 
26 namespace KHolidays
27 {
28 
30 class KHOLIDAYS_EXPORT HolidayRegion
31 {
32 public:
39  explicit HolidayRegion(const QString &regionCode = QString());
40 
47  explicit HolidayRegion(const QFileInfo &regionFile);
48 
52  ~HolidayRegion();
53 
65  static QStringList regionCodes();
66 
79  static QString defaultRegionCode(const QString &country = QString(),
80  const QString &language = QString());
81 
92  QString regionCode() const;
93 
106  QString countryCode() const;
107 
121  static QString countryCode(const QString &regionCode);
122 
133  QString languageCode() const;
134 
146  static QString languageCode(const QString &regionCode);
147 
156  QString name() const;
157 
166  static QString name(const QString &regionCode);
167 
175  QString description() const;
176 
184  static QString description(const QString &regionCode);
185 
191  Holiday::List holidays(const QDate &startDate, const QDate &endDate) const;
192 
198  Holiday::List holidays(const QDate &date) const;
199 
205  Holiday::List holidays(int calendarYear) const;
206 
210  bool isHoliday(const QDate &date) const;
211 
215  bool isValid() const;
216 
222  static bool isValid(const QString &regionCode);
223 
224 private:
225  Q_DISABLE_COPY(HolidayRegion)
226 
227  class HolidayRegionPrivate;
228  HolidayRegionPrivate *const d;
229 };
230 
231 }
232 
233 #endif // KHOLIDAYS_HOLIDAYREGION_H
Represents a holiday region.
Definition: holidayregion.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Oct 19 2020 23:03:13 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.