KHolidays

lunarphase.h
1 /*
2  This file is part of the kholidays library.
3 
4  SPDX-FileCopyrightText: 2004, 2007, 2009 Allen Winter <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KHOLIDAYS_LUNARPHASE_H
10 #define KHOLIDAYS_LUNARPHASE_H
11 
12 #include "kholidays_export.h"
13 
14 class QDate;
15 class QString;
16 
17 namespace KHolidays
18 {
19 /**
20  Represents and manages a Lunar Phase
21 
22  A Lunar Phase can be one of the following:
23 
24  + "new": the moon is not visible; or traditionally: first visible
25  crescent of the Moon. For religious purposes, the new
26  month begins when the first crescent moon can be seen.
27  Thus, it is impossible to be certain in advance of when
28  months will begin; in particular, the exact date on which
29  Ramadan will begin is not known in advance. In Saudi Arabia,
30  observers are sent up in airplanes if the weather is cloudy
31  when the new moon is expected.
32  + "first quarter": the right 50% of the moon is visible.
33  + "full": the moon is fully visible.
34  + "last quarter": the left 50% of the moon is visible.
35 
36  A very good description of the lunar phases can be read at the Wikipedia,
37  https://en.wikipedia.org/wiki/Lunar_phase
38 
39  Note that crescent and gibbous phases are not currently supported.
40 */
41 class KHOLIDAYS_EXPORT LunarPhase // krazy:exclude=dpointer
42 {
43 public:
44  /**
45  Phases of the moon, in traditional English notation. The
46  phase @c None is used only as an error indicator, for instance
47  in phase().
48  */
49  enum Phase {
50  NewMoon, ///< New moon phase
51  FirstQuarter, ///< First quarter of moon phase
52  LastQuarter, ///< Last quarter of moon phase
53  FullMoon, ///< Full moon phase
54  None, ///< Indication for error
55  };
56 
57  /**
58  Return the lunar phase for the specified Gregorian date.
59  The enum 'None' is returned if one of the supported phases
60  does not occur on the date.
61 
62  @param date compute the lunar phase for the specified Gregorian date.
63  */
64  static Phase phaseAtDate(const QDate &date);
65 
66  /**
67  Return the lunar phase as a text string for the specified date.
68  A null string is returned if one of the supported phases does
69  not occur on the date.
70 
71  @param date compute the lunar phase for the specified Gregorian date.
72  */
73  static QString phaseNameAtDate(const QDate &date);
74 
75  /**
76  Return the string representation of phase.
77 
78  @param phase the lunar phase.
79  */
80  static QString phaseName(Phase phase);
81 };
82 
83 }
84 
85 #endif
Last quarter of moon phase.
Definition: lunarphase.h:52
First quarter of moon phase.
Definition: lunarphase.h:51
Indication for error.
Definition: lunarphase.h:54
Phase
Phases of the moon, in traditional English notation.
Definition: lunarphase.h:49
Represents and manages a Lunar Phase.
Definition: lunarphase.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue May 11 2021 22:56:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.