/usr/include/kholidays/holidayregion.h is in kdepimlibs5-dev 4:4.14.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | /*
This file is part of the kholidays library.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
Copyright (c) 2004 Allen Winter <winter@kde.org>
Copyright (c) 2008 David Jarvie <djarvie@kde.org>
Copyright 2010 John Layt <john@layt.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KHOLIDAYS_HOLIDAYREGION_H
#define KHOLIDAYS_HOLIDAYREGION_H
#include "kholidays_export.h"
#include <QtCore/QList>
#include <QtCore/QSharedDataPointer>
#include <QtCore/QString>
#include "holiday.h"
class QDate;
class QStringList;
class QFileInfo;
namespace KHolidays {
class KHOLIDAYS_EXPORT HolidayRegion
{
public:
/**
* Creates a new Holiday Region object for a given standard Region Code.
*
* From 4.5 onwards this constructor requires the new Region Code not the
* deprecated Location Code. If a Location Code is provided the first
* match will be created.
*
* @param regionCode The code for the Holiday Region.
* If null or unknown, an empty instance will be created.
*/
explicit HolidayRegion( const QString ®ionCode = QString() );
/**
* Creates a new Holiday Region object from a given holiday file.
* If file doesn't exist, an empty instance will be created.
*
* @param regionFile The code for the Holiday Region.
*/
explicit HolidayRegion( const QFileInfo ®ionFile );
/**
* Destroys the holidays object.
*/
~HolidayRegion();
/**
* @deprecated use regions() instead
*
* Return a list of all available location codes which have a holiday definition.
*
* One of these can then be passed to the constructor for a new HolidayRegion
* object.
*
* @see regions()
*/
static QStringList locations();
/**
* @deprecated use regionCode() or countryCode() instead
*
* Returns the holiday location.
*
* The holiday location is a code representing the holiday region.
*
* @return region code, or null if the instance was constructed with
* an unknown region
*
* @see regionCode()
* @see languageCode()
*/
QString location() const;
/**
* @since 4.5
*
* 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.
*
* @see name()
* @see languageCode()
*/
static QStringList regionCodes();
/**
* @since 4.6
*
* Return a reasonable default Holiday Region code
*
* If a required country/language is not provided then the current KDE
* country/lanaguage is used.
*
* @param country The country to find a default Holiday Region for
* @param language The lanaguage to find a default Holiday Region for
* @return the full region code of the default file
*/
static QString defaultRegionCode( const QString &country = QString(),
const QString &language = QString() );
/**
* @since 4.5
*
* Returns the unique Holiday Region code.
*
* Clients should not infer any meaning from the format of the code.
*
* @return region code, or null if the instance was constructed with
* an unknown region
*/
QString regionCode() const;
/**
* @since 4.5
*
* 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 http://en.wikipedia.org/wiki/ISO_3166-2
*
* @return the full region code of the file
*/
QString countryCode() const;
/**
* @since 4.5
*
* 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 http://en.wikipedia.org/wiki/ISO_3166-2
*
* @param regionCode The code for the Holiday Region.
* @return the full region code of the file
*/
static QString countryCode( const QString ®ionCode );
/**
* @since 4.5
*
* 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).
*
* @return the language code of the file
*/
QString languageCode() const;
/**
* @since 4.5
*
* 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).
*
* @param regionCode The code for the Holiday Region.
* @return the language code of the file
*/
static QString languageCode( const QString ®ionCode );
/**
* @since 4.5
*
* Return the name of the Holiday Region.
* This may be a country, region, or type.
*
* @return the short name code of the file
*/
QString name() const;
/**
* @since 4.5
*
* Return the name of a given Holiday Region
*
* @param regionCode The code for the Holiday Region.
* @return the name of the Holiday Region
*/
static QString name( const QString ®ionCode );
/**
* @since 4.5
*
* Return the description of the Holiday Region if available
*
* @return the description of the Holiday Region
*/
QString description() const;
/**
* @since 4.5
*
* Return the description of a given Holiday Region if available
*
* @return the description of the Holiday Region
*/
static QString description( const QString ®ionCode );
/**
* @since 4.5
*
* Returns the list of holidays that occur between @p startDate and @p endDate.
*/
Holiday::List holidays( const QDate &startDate, const QDate &endDate ) const;
//KDE5: merge with default multidayMode
/**
* @since 4.6
*
* Returns the list of holidays that occur between @p startDate and @p endDate.
*/
Holiday::List holidays( const QDate &startDate, const QDate &endDate,
Holiday::MultidayMode multidayMode ) const;
/**
* Returns the list of holidays that occur on a @p date.
*/
Holiday::List holidays( const QDate &date ) const;
//KDE5: merge with default multidayMode
/**
* @since 4.6
*
* Returns the list of holidays that occur on a @p date.
*/
Holiday::List holidays( const QDate &date, Holiday::MultidayMode multidayMode ) const;
/**
* @since 4.5
*
* Returns the list of holidays that occur in a calendar year @p calendarYear.
*/
Holiday::List holidays( int calendarYear, const QString &calendarType ) const;
//KDE5: merge with default multidayMode
/**
* @since 4.6
*
* Returns the list of holidays that occur in a calendar year @p calendarYear.
*/
Holiday::List holidays( int calendarYear, const QString &calendarType,
Holiday::MultidayMode multidayMode ) const;
/**
* Checks whether there is any holiday defined for a @p date.
*/
bool isHoliday( const QDate &date ) const;
/**
* Returns whether the instance contains any holiday data.
*/
bool isValid() const;
/**
* @since 4.5
*
* Returns whether the Region Code is valid.
*/
static bool isValid( const QString ®ionCode );
private:
Q_DISABLE_COPY( HolidayRegion )
class Private;
Private *const d;
};
}
#endif // KHOLIDAYS_HOLIDAYREGION_H
|