KHolidays 5.109.0
|
Represents a holiday region. More...
#include <holidayregion.h>
Public Member Functions | |
HolidayRegion (const HolidayRegion &) | |
Copy constructor. | |
HolidayRegion (const QFileInfo ®ionFile) | |
Creates a new Holiday Region object from a given holiday file. | |
HolidayRegion (const QString ®ionCode=QString()) | |
Creates a new Holiday Region object for a given standard Region Code. | |
HolidayRegion (HolidayRegion &&) | |
Move constructor. | |
~HolidayRegion () | |
Destroys the holidays object. | |
QString | countryCode () const |
QString | description () const |
bool | isHoliday (const QDate &date) const |
Checks whether there is any holiday defined for a date . | |
bool | isValid () const |
Returns whether the instance contains any holiday data. | |
QString | languageCode () const |
QString | name () const |
HolidayRegion & | operator= (const HolidayRegion &) |
Assignment operator. | |
HolidayRegion & | operator= (HolidayRegion &&) |
Move Assignment operator. | |
Holiday::List | rawHolidays (const QDate &startDate, const QDate &endDate) const |
Holiday::List | rawHolidays (const QDate &startDate, const QDate &endDate, const QString &category) const |
Holiday::List | rawHolidaysWithAstroSeasons (const QDate &date) const |
Holiday::List | rawHolidaysWithAstroSeasons (const QDate &startDate, const QDate &endDate) const |
Holiday::List | rawHolidaysWithAstroSeasons (int calendarYear) const |
QString | regionCode () const |
Static Public Member Functions | |
static QString | countryCode (const QString ®ionCode) |
static QString | defaultRegionCode (const QString &country=QString(), const QString &language=QString()) |
static QString | description (const QString ®ionCode) |
static bool | isValid (const QString ®ionCode) |
static QString | languageCode (const QString ®ionCode) |
static QString | name (const QString ®ionCode) |
static QStringList | regionCodes () |
Represents a holiday region.
|
explicit |
|
explicit |
KHolidays::HolidayRegion::HolidayRegion | ( | const HolidayRegion & | ) |
Copy constructor.
KHolidays::HolidayRegion::HolidayRegion | ( | HolidayRegion && | ) |
Move constructor.
KHolidays::HolidayRegion::~HolidayRegion | ( | ) |
Destroys the holidays object.
QString KHolidays::HolidayRegion::countryCode | ( | ) | const |
Return the ISO 3166 country code of the file
May be either just a country code ("US" = USA) or may include a regional identifier ("US-CA" = California). Returns "XX" if not a country.
See https://en.wikipedia.org/wiki/ISO_3166-2
|
static |
Return the ISO 3166 country code of a given Holiday Region
May be either just a country code ("US" = USA) or may include a regional identifier ("US-CA" = California). Returns "XX" if not a country.
See https://en.wikipedia.org/wiki/ISO_3166-2
regionCode | The code for the Holiday Region. |
|
static |
Return a reasonable default Holiday Region code
If a required country/language is not provided then the current KDE country/language is used.
country | The country or region to find a default Holiday Region for. This can be either an ISO 3166-1 or ISO 3166-2 code. |
language | The language to find a default Holiday Region for |
QString KHolidays::HolidayRegion::description | ( | ) | const |
|
static |
bool KHolidays::HolidayRegion::isHoliday | ( | const QDate & | date | ) | const |
Checks whether there is any holiday defined for a date
.
bool KHolidays::HolidayRegion::isValid | ( | ) | const |
Returns whether the instance contains any holiday data.
|
static |
Returns whether the Region Code is valid.
QString KHolidays::HolidayRegion::languageCode | ( | ) | const |
Return the ISO 639-1 language code of the file
May be either just a language code ("en" = US English) or may include a country identifier ("en_GB" = British English).
|
static |
Return the ISO 639-1 language code of a given Holiday Region
May be either just a language code ("en" = US English) or may include a country identifier ("en_GB" = British English).
regionCode | The code for the Holiday Region. |
QString KHolidays::HolidayRegion::name | ( | ) | const |
Return the name of the Holiday Region. This may be a country, region, or type.
|
static |
HolidayRegion & KHolidays::HolidayRegion::operator= | ( | const HolidayRegion & | ) |
Assignment operator.
HolidayRegion & KHolidays::HolidayRegion::operator= | ( | HolidayRegion && | ) |
Move Assignment operator.
Holiday::List KHolidays::HolidayRegion::rawHolidays | ( | const QDate & | startDate, |
const QDate & | endDate | ||
) | const |
Returns the list of holidays that occur between startDate
and endDate
.
Holiday::List KHolidays::HolidayRegion::rawHolidays | ( | const QDate & | startDate, |
const QDate & | endDate, | ||
const QString & | category | ||
) | const |
Returns the list of holidays that occur between startDate
and endDate
and with category
.
Holiday::List KHolidays::HolidayRegion::rawHolidaysWithAstroSeasons | ( | const QDate & | date | ) | const |
Returns the list of holidays that occur on a date
.
Holiday::List KHolidays::HolidayRegion::rawHolidaysWithAstroSeasons | ( | const QDate & | startDate, |
const QDate & | endDate | ||
) | const |
Returns the list of holidays that occur between startDate
and endDate
.
Holiday::List KHolidays::HolidayRegion::rawHolidaysWithAstroSeasons | ( | int | calendarYear | ) | const |
Returns the list of holidays that occur in a Gregorian calendar year calendarYear
.
QString KHolidays::HolidayRegion::regionCode | ( | ) | const |
Returns the unique Holiday Region code.
Clients should not infer any meaning from the format of the code.
|
static |
Return a list of all available Holiday Region codes.
One of these can then be passed to the constructor for a new HolidayRegion object, or to name() or language() to obtain the name and language of the region.