KHolidays

astroseasons.h
1/*
2 This file is part of the kholidays library.
3
4 SPDX-FileCopyrightText: 2004, 2006-2007 Allen Winter <winter@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KHOLIDAYS_ASTROSEASONS_H
10#define KHOLIDAYS_ASTROSEASONS_H
11
12#include "kholidays_export.h"
13
14class QDate;
15class QString;
16
17namespace KHolidays
18{
19/**
20 Represents and manages the Astronomical Seasons (solstices and equinoxes).
21 For the purposes of this class, we sometimes use the shorthand of "Season"
22 where we really mean "Astronomical Season".
23
24 An Astronomical Season can be one of the following:
25
26 - June solstice
27 - December solstice
28 - March equinox
29 - September equinox
30
31 A very good description of the astronomical seasons can be read at the
32 Wikipedia,
33 https://en.wikipedia.org/wiki/Seasons
34
35 Note that this class represents the "Astronomical Seasons" and not
36 the traditional "Seasons" which vary widely by culture.
37*/
38class KHOLIDAYS_EXPORT AstroSeasons // krazy:exclude=dpointer
39{
40public:
41 enum Season {
42 JuneSolstice,
43 DecemberSolstice,
44 MarchEquinox,
45 SeptemberEquinox,
46 None,
47 };
48
49 /**
50 * Return the Gregorian date on which the season occurs in given year.
51 *
52 * @param season Season to return a date for
53 * @param year Year for which to return the date
54 * @since 5.50
55 */
56 static QDate seasonDate(Season season, int year);
57
58 /**
59 Return the season for the specified Gregorian date.
60 The enum 'None' is returned if one of the supported seasons
61 does not occur on the date.
62
63 @param date compute the season for the specified Gregorian date.
64 */
65 static Season seasonAtDate(const QDate &date);
66
67 /**
68 Return the season as a text string for the specified date.
69 A null string is returned if one of the supported seasons does
70 not occur on the date.
71
72 @param date compute the season for the specified Gregorian date.
73 */
74 static QString seasonNameAtDate(const QDate &date);
75
76 /**
77 Return the string representation of season.
78
79 @param season astronomical season.
80 */
81 static QString seasonName(Season season);
82};
83
84}
85
86#endif
Represents and manages the Astronomical Seasons (solstices and equinoxes).
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.