KHolidays

zodiac.h
1/*
2 This file is part of the kholidays library.
3
4 SPDX-FileCopyrightText: 2005-2007 Allen Winter <winter@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KHOLIDAYS_ZODIAC_H
10#define KHOLIDAYS_ZODIAC_H
11
12#include "kholidays_export.h"
13
14#include <QSharedDataPointer>
15
16class QDate;
17class QString;
18
19namespace KHolidays
20{
21class ZodiacPrivate;
22
23/**
24 Represents and manages the Zodiac calendar.
25 The Tropical and Sidereal Zodiacs are supported.
26
27 A very good description of the Zodiac calendars can be read at the
28 Wikipedia,
29 https://en.wikipedia.org/wiki/Zodiac
30
31 Disclaimer: I am by no means a Zodiac expert. I put together this software
32 based on some quick scanning of documents I found on the WWW. Feel free
33 to contact me about this code if you have improvements.
34
35 Sign Symbol Birthdates
36 Tropical Sidereal
37 Aries ram Mar 21 - Apr 19 Apr 14 - May 14
38 Taurus bull Apr 20 - May 20 May 15 - Jun 14
39 Gemini twins May 21 - Jun 20 Jun 15 - Jul 16
40 Cancer crab Jun 21 - Jul 22 Jul 17 - Aug 16
41 Leo lion Jul 23 - Aug 22 Aug 17 - Sep 16
42 Virgo virgin Aug 23 - Sep 22 Sep 17 - Oct 17
43 Libra scale Sep 23 - Oct 22 Oct 18 - Nov 16
44 Scorpio scorpion Oct 23 - Nov 21 Nov 17 - Dec 15
45 Sagittarius archer Nov 22 - Dec 21 Dec 16 - Jan 14
46 Capricorn goat Dec 22 - Jan 19 Jan 15 - Feb 12
47 Aquarius water Jan 20 - Feb 18 Feb 13 - Mar 14
48 Pisces fish Feb 19 - Mar 20 Mar 15 - Apr 13
49
50*/
51class KHOLIDAYS_EXPORT Zodiac
52{
53public:
54 enum ZodiacType {
55 Tropical,
56 Sidereal,
57 };
58
59 enum ZodiacSigns {
60 Aries,
61 Taurus,
62 Gemini,
63 Cancer,
64 Leo,
65 Virgo,
66 Libra,
67 Scorpio,
68 Sagittarius,
69 Capricorn,
70 Aquarius,
71 Pisces,
72 None,
73 };
74
75 explicit Zodiac(ZodiacType type);
76 Zodiac(const Zodiac &other);
77 ~Zodiac();
78
79 Zodiac &operator=(const Zodiac &other);
80
81 /**
82 Return the Zodiac sign for the specified Gregorian date.
83 The enum 'None' is returned if one of the supported signs
84 does not occur on the date.
85
86 @param date compute the Zodiac sign for the specified Gregorian date.
87 */
88 ZodiacSigns signAtDate(const QDate &date) const;
89
90 /**
91 Return the Zodiac sign as a text string for the specified date.
92 A null string is returned if one of the supported Zodiac signs does
93 not occur on the date.
94
95 @param date compute the Zodiac sign for the specified Gregorian date.
96 */
97 QString signNameAtDate(const QDate &date) const;
98
99 /**
100 Return the string representation of Zodiac sign.
101
102 @param sign Zodiac sign.
103 */
104 static QString signName(ZodiacSigns sign);
105
106 /**
107 Convert the Zodiac sign to a Zodiac symbol.
108 */
109 static QString signSymbol(ZodiacSigns sign);
110
111private:
113};
114
115}
116
117#endif
Represents and manages the Zodiac calendar.
Definition zodiac.h:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:57 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.