• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • date
kcalendarsystemcoptic.cpp
Go to the documentation of this file.
1/*
2 Copyright 2009, 2010 John Layt <john@layt.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#include "kcalendarsystemcoptic_p.h"
21#include "kcalendarsystemprivate_p.h"
22#include "kcalendarsystemcopticprivate_p.h"
23
24#include "kdebug.h"
25#include "klocale.h"
26
27#include <QtCore/QDate>
28#include <QtCore/QCharRef>
29
30// Shared d pointer implementations
31
32KCalendarSystemCopticPrivate::KCalendarSystemCopticPrivate(KCalendarSystemCoptic *q)
33 : KCalendarSystemPrivate(q)
34{
35}
36
37KCalendarSystemCopticPrivate::~KCalendarSystemCopticPrivate()
38{
39}
40
41KLocale::CalendarSystem KCalendarSystemCopticPrivate::calendarSystem() const
42{
43 return KLocale::CopticCalendar;
44}
45
46void KCalendarSystemCopticPrivate::loadDefaultEraList()
47{
48 QString name, shortName, format;
49 // AM for Anno Martyrum or "Year of the Martyrs"
50 name = i18nc("Calendar Era: Coptic Era of Martyrs, years > 0, LongFormat", "Anno Martyrum");
51 shortName = i18nc("Calendar Era: Coptic Era of Martyrs, years > 0, ShortFormat", "AM");
52 format = i18nc("(kdedt-format) Coptic, AM, full era year format used for %EY, e.g. 2000 AM", "%Ey %EC");
53 addEra('+', 1, q->epoch(), 1, q->latestValidDate(), name, shortName, format);
54}
55
56int KCalendarSystemCopticPrivate::monthsInYear(int year) const
57{
58 Q_UNUSED(year)
59 return 13;
60}
61
62int KCalendarSystemCopticPrivate::daysInMonth(int year, int month) const
63{
64 if (month == 13) {
65 if (isLeapYear(year)) {
66 return 6;
67 } else {
68 return 5;
69 }
70 }
71
72 return 30;
73}
74
75int KCalendarSystemCopticPrivate::daysInYear(int year) const
76{
77 if (isLeapYear(year)) {
78 return 366;
79 } else {
80 return 365;
81 }
82}
83
84int KCalendarSystemCopticPrivate::daysInWeek() const
85{
86 return 7;
87}
88
89bool KCalendarSystemCopticPrivate::isLeapYear(int year) const
90{
91 //Uses same rule as Julian but offset by 1 year with year 3 being first leap year
92 if (year < 1) {
93 year = year + 2;
94 } else {
95 year = year + 1;
96 }
97
98 if (year % 4 == 0) {
99 return true;
100 }
101 return false;
102}
103
104bool KCalendarSystemCopticPrivate::hasLeapMonths() const
105{
106 return false;
107}
108
109bool KCalendarSystemCopticPrivate::hasYearZero() const
110{
111 return false;
112}
113
114int KCalendarSystemCopticPrivate::maxDaysInWeek() const
115{
116 return 7;
117}
118
119int KCalendarSystemCopticPrivate::maxMonthsInYear() const
120{
121 return 13;
122}
123
124int KCalendarSystemCopticPrivate::earliestValidYear() const
125{
126 return 1;
127}
128
129int KCalendarSystemCopticPrivate::latestValidYear() const
130{
131 return 9999;
132}
133
134// Names taken from Bohairic dialect transliterations in http://www.copticheritage.org/parameters/copticheritage/calendar/The_Coptic_Calendar.pdf
135// These differ from the transliterations found on Wikipedia http://en.wikipedia.org/wiki/Coptic_calendar
136// These differ from the Sahidic dialect transliterations used in Dershowitz & Reingold which went out of use in the 11th centuary
137// These differ from the Arabic transliterations found on Wikipedia
138// These differ from the transliterations used in Mac OSX 10.6 Snow Leopard
139// The Boharic was initially chosen as this is the dialect apparantly in 'common' use in the Coptic Church.
140// But it could be argued the Arabic forms should be used as they are in 'common' usage in Eqypt
141// And where did the rest come from?
142//
143// Boharic Wikipedia Copt D&R Sahidic Wikipedia Arab Mac OSX
144// -------------- --------------- -------------- -------------- --------------
145// * Thoout Thout Thoout Tout Tout
146// * Paope Paopi Paope Baba Baba
147// * Hathor Hathor Athōr Hatour Hatour
148// * Kiahk Koiak Koiak Kiahk Kiahk
149// * Tobe Tobi Tōbe Touba Toba
150// * Meshir Meshir Meshir Amshir Amshir
151// * Paremhotep Paremhat Paremotep Baramhat Baramhat
152// * Parmoute Paremoude Paremoute Baramouda Baramouda
153// * Pashons Pashons Pashons Bashans Bashans
154// * Paone Paoni Paōne Ba'ouna Paona
155// * Epep Epip Epēp Abib Epep
156// * Mesore Mesori Mesorē Mesra Mesra
157// * Kouji nabot Pi Kogi Enavot Epagomenē Nasie
158// *
159QString KCalendarSystemCopticPrivate::monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive) const
160{
161 Q_UNUSED(year);
162
163 if (format == KLocale::NarrowName) {
164 switch (month) {
165 case 1:
166 return ki18nc("Coptic month 1 - KLocale::NarrowName", "T").toString(locale());
167 case 2:
168 return ki18nc("Coptic month 2 - KLocale::NarrowName", "P").toString(locale());
169 case 3:
170 return ki18nc("Coptic month 3 - KLocale::NarrowName", "H").toString(locale());
171 case 4:
172 return ki18nc("Coptic month 4 - KLocale::NarrowName", "K").toString(locale());
173 case 5:
174 return ki18nc("Coptic month 5 - KLocale::NarrowName", "T").toString(locale());
175 case 6:
176 return ki18nc("Coptic month 6 - KLocale::NarrowName", "M").toString(locale());
177 case 7:
178 return ki18nc("Coptic month 7 - KLocale::NarrowName", "P").toString(locale());
179 case 8:
180 return ki18nc("Coptic month 8 - KLocale::NarrowName", "P").toString(locale());
181 case 9:
182 return ki18nc("Coptic month 9 - KLocale::NarrowName", "P").toString(locale());
183 case 10:
184 return ki18nc("Coptic month 10 - KLocale::NarrowName", "P").toString(locale());
185 case 11:
186 return ki18nc("Coptic month 11 - KLocale::NarrowName", "E").toString(locale());
187 case 12:
188 return ki18nc("Coptic month 12 - KLocale::NarrowName", "M").toString(locale());
189 case 13:
190 return ki18nc("Coptic month 13 - KLocale::NarrowName", "K").toString(locale());
191 default:
192 return QString();
193 }
194 }
195
196 if (format == KLocale::ShortName && possessive) {
197 switch (month) {
198 case 1:
199 return ki18nc("Coptic month 1 - KLocale::ShortName Possessive", "of Tho").toString(locale());
200 case 2:
201 return ki18nc("Coptic month 2 - KLocale::ShortName Possessive", "of Pao").toString(locale());
202 case 3:
203 return ki18nc("Coptic month 3 - KLocale::ShortName Possessive", "of Hat").toString(locale());
204 case 4:
205 return ki18nc("Coptic month 4 - KLocale::ShortName Possessive", "of Kia").toString(locale());
206 case 5:
207 return ki18nc("Coptic month 5 - KLocale::ShortName Possessive", "of Tob").toString(locale());
208 case 6:
209 return ki18nc("Coptic month 6 - KLocale::ShortName Possessive", "of Mes").toString(locale());
210 case 7:
211 return ki18nc("Coptic month 7 - KLocale::ShortName Possessive", "of Par").toString(locale());
212 case 8:
213 return ki18nc("Coptic month 8 - KLocale::ShortName Possessive", "of Pam").toString(locale());
214 case 9:
215 return ki18nc("Coptic month 9 - KLocale::ShortName Possessive", "of Pas").toString(locale());
216 case 10:
217 return ki18nc("Coptic month 10 - KLocale::ShortName Possessive", "of Pan").toString(locale());
218 case 11:
219 return ki18nc("Coptic month 11 - KLocale::ShortName Possessive", "of Epe").toString(locale());
220 case 12:
221 return ki18nc("Coptic month 12 - KLocale::ShortName Possessive", "of Meo").toString(locale());
222 case 13:
223 return ki18nc("Coptic month 13 - KLocale::ShortName Possessive", "of Kou").toString(locale());
224 default:
225 return QString();
226 }
227 }
228
229 if (format == KLocale::ShortName && !possessive) {
230 switch (month) {
231 case 1:
232 return ki18nc("Coptic month 1 - KLocale::ShortName", "Tho").toString(locale());
233 case 2:
234 return ki18nc("Coptic month 2 - KLocale::ShortName", "Pao").toString(locale());
235 case 3:
236 return ki18nc("Coptic month 3 - KLocale::ShortName", "Hat").toString(locale());
237 case 4:
238 return ki18nc("Coptic month 4 - KLocale::ShortName", "Kia").toString(locale());
239 case 5:
240 return ki18nc("Coptic month 5 - KLocale::ShortName", "Tob").toString(locale());
241 case 6:
242 return ki18nc("Coptic month 6 - KLocale::ShortName", "Mes").toString(locale());
243 case 7:
244 return ki18nc("Coptic month 7 - KLocale::ShortName", "Par").toString(locale());
245 case 8:
246 return ki18nc("Coptic month 8 - KLocale::ShortName", "Pam").toString(locale());
247 case 9:
248 return ki18nc("Coptic month 9 - KLocale::ShortName", "Pas").toString(locale());
249 case 10:
250 return ki18nc("Coptic month 10 - KLocale::ShortName", "Pan").toString(locale());
251 case 11:
252 return ki18nc("Coptic month 11 - KLocale::ShortName", "Epe").toString(locale());
253 case 12:
254 return ki18nc("Coptic month 12 - KLocale::ShortName", "Meo").toString(locale());
255 case 13:
256 return ki18nc("Coptic month 12 - KLocale::ShortName", "Kou").toString(locale());
257 default:
258 return QString();
259 }
260 }
261
262 if (format == KLocale::LongName && possessive) {
263 switch (month) {
264 case 1:
265 return ki18nc("Coptic month 1 - KLocale::LongName Possessive", "of Thoout").toString(locale());
266 case 2:
267 return ki18nc("Coptic month 2 - KLocale::LongName Possessive", "of Paope").toString(locale());
268 case 3:
269 return ki18nc("Coptic month 3 - KLocale::LongName Possessive", "of Hathor").toString(locale());
270 case 4:
271 return ki18nc("Coptic month 4 - KLocale::LongName Possessive", "of Kiahk").toString(locale());
272 case 5:
273 return ki18nc("Coptic month 5 - KLocale::LongName Possessive", "of Tobe").toString(locale());
274 case 6:
275 return ki18nc("Coptic month 6 - KLocale::LongName Possessive", "of Meshir").toString(locale());
276 case 7:
277 return ki18nc("Coptic month 7 - KLocale::LongName Possessive", "of Paremhotep").toString(locale());
278 case 8:
279 return ki18nc("Coptic month 8 - KLocale::LongName Possessive", "of Parmoute").toString(locale());
280 case 9:
281 return ki18nc("Coptic month 9 - KLocale::LongName Possessive", "of Pashons").toString(locale());
282 case 10:
283 return ki18nc("Coptic month 10 - KLocale::LongName Possessive", "of Paone").toString(locale());
284 case 11:
285 return ki18nc("Coptic month 11 - KLocale::LongName Possessive", "of Epep").toString(locale());
286 case 12:
287 return ki18nc("Coptic month 12 - KLocale::LongName Possessive", "of Mesore").toString(locale());
288 case 13:
289 return ki18nc("Coptic month 12 - KLocale::LongName Possessive", "of Kouji nabot").toString(locale());
290 default:
291 return QString();
292 }
293 }
294
295 // Default to LongName
296 switch (month) {
297 case 1:
298 return ki18nc("Coptic month 1 - KLocale::LongName", "Thoout").toString(locale());
299 case 2:
300 return ki18nc("Coptic month 2 - KLocale::LongName", "Paope").toString(locale());
301 case 3:
302 return ki18nc("Coptic month 3 - KLocale::LongName", "Hathor").toString(locale());
303 case 4:
304 return ki18nc("Coptic month 4 - KLocale::LongName", "Kiahk").toString(locale());
305 case 5:
306 return ki18nc("Coptic month 5 - KLocale::LongName", "Tobe").toString(locale());
307 case 6:
308 return ki18nc("Coptic month 6 - KLocale::LongName", "Meshir").toString(locale());
309 case 7:
310 return ki18nc("Coptic month 7 - KLocale::LongName", "Paremhotep").toString(locale());
311 case 8:
312 return ki18nc("Coptic month 8 - KLocale::LongName", "Parmoute").toString(locale());
313 case 9:
314 return ki18nc("Coptic month 9 - KLocale::LongName", "Pashons").toString(locale());
315 case 10:
316 return ki18nc("Coptic month 10 - KLocale::LongName", "Paone").toString(locale());
317 case 11:
318 return ki18nc("Coptic month 11 - KLocale::LongName", "Epep").toString(locale());
319 case 12:
320 return ki18nc("Coptic month 12 - KLocale::LongName", "Mesore").toString(locale());
321 case 13:
322 return ki18nc("Coptic month 12 - KLocale::LongName", "Kouji nabot").toString(locale());
323 default:
324 return QString();
325 }
326}
327
328// Names taken from from the Sahidic dialect transliterations used in Dershowitz & Reingold which went out of use in the 11th centuary
329// Boharic or Arabic transliterations would be preferred but none could be found
330QString KCalendarSystemCopticPrivate::weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const
331{
332 if (format == KLocale::NarrowName) {
333 switch (weekDay) {
334 case 1:
335 return ki18nc("Coptic weekday 1 - KLocale::NarrowName", "P").toString(locale());
336 case 2:
337 return ki18nc("Coptic weekday 2 - KLocale::NarrowName", "P").toString(locale());
338 case 3:
339 return ki18nc("Coptic weekday 3 - KLocale::NarrowName", "P").toString(locale());
340 case 4:
341 return ki18nc("Coptic weekday 4 - KLocale::NarrowName", "P").toString(locale());
342 case 5:
343 return ki18nc("Coptic weekday 5 - KLocale::NarrowName", "P").toString(locale());
344 case 6:
345 return ki18nc("Coptic weekday 6 - KLocale::NarrowName", "P").toString(locale());
346 case 7:
347 return ki18nc("Coptic weekday 7 - KLocale::NarrowName", "T").toString(locale());
348 default:
349 return QString();
350 }
351 }
352
353 if (format == KLocale::ShortName || format == KLocale:: ShortNumber) {
354 switch (weekDay) {
355 case 1:
356 return ki18nc("Coptic weekday 1 - KLocale::ShortName", "Pes").toString(locale());
357 case 2:
358 return ki18nc("Coptic weekday 2 - KLocale::ShortName", "Psh").toString(locale());
359 case 3:
360 return ki18nc("Coptic weekday 3 - KLocale::ShortName", "Pef").toString(locale());
361 case 4:
362 return ki18nc("Coptic weekday 4 - KLocale::ShortName", "Pti").toString(locale());
363 case 5:
364 return ki18nc("Coptic weekday 5 - KLocale::ShortName", "Pso").toString(locale());
365 case 6:
366 return ki18nc("Coptic weekday 6 - KLocale::ShortName", "Psa").toString(locale());
367 case 7:
368 return ki18nc("Coptic weekday 7 - KLocale::ShortName", "Tky").toString(locale());
369 default:
370 return QString();
371 }
372 }
373
374 switch (weekDay) {
375 case 1:
376 return ki18nc("Coptic weekday 1 - KLocale::LongName", "Pesnau").toString(locale());
377 case 2:
378 return ki18nc("Coptic weekday 2 - KLocale::LongName", "Pshoment").toString(locale());
379 case 3:
380 return ki18nc("Coptic weekday 3 - KLocale::LongName", "Peftoou").toString(locale());
381 case 4:
382 return ki18nc("Coptic weekday 4 - KLocale::LongName", "Ptiou").toString(locale());
383 case 5:
384 return ki18nc("Coptic weekday 5 - KLocale::LongName", "Psoou").toString(locale());
385 case 6:
386 return ki18nc("Coptic weekday 6 - KLocale::LongName", "Psabbaton").toString(locale());
387 case 7:
388 return ki18nc("Coptic weekday 7 - KLocale::LongName", "Tkyriakē").toString(locale());
389 default:
390 return QString();
391 }
392}
393
394
395KCalendarSystemCoptic::KCalendarSystemCoptic(const KLocale *locale)
396 : KCalendarSystem(*new KCalendarSystemCopticPrivate(this), KSharedConfig::Ptr(), locale)
397{
398 d_ptr->loadConfig(calendarType());
399}
400
401KCalendarSystemCoptic::KCalendarSystemCoptic(const KSharedConfig::Ptr config, const KLocale *locale)
402 : KCalendarSystem(*new KCalendarSystemCopticPrivate(this), config, locale)
403{
404 d_ptr->loadConfig(calendarType());
405}
406
407KCalendarSystemCoptic::KCalendarSystemCoptic(KCalendarSystemCopticPrivate &dd,
408 const KSharedConfig::Ptr config, const KLocale *locale)
409 : KCalendarSystem(dd, config, locale)
410{
411 d_ptr->loadConfig(calendarType());
412}
413
414KCalendarSystemCoptic::~KCalendarSystemCoptic()
415{
416}
417
418QString KCalendarSystemCoptic::calendarType() const
419{
420 return QLatin1String("coptic");
421}
422
423QDate KCalendarSystemCoptic::epoch() const
424{
425 //0001-01-01, no Year 0.
426 //0284-08-29 AD Julian
427 return QDate::fromJulianDay(1825030);
428}
429
430QDate KCalendarSystemCoptic::earliestValidDate() const
431{
432 //0001-01-01, no Year 0.
433 //0284-08-29 AD Julian
434 return QDate::fromJulianDay(1825030);
435}
436
437QDate KCalendarSystemCoptic::latestValidDate() const
438{
439 // Set to last day of year 9999 until confirm date formats & widgets support > 9999
440 //9999-12-30
441 //10283-08-29 AD Julian
442 return QDate::fromJulianDay(5477164);
443}
444
445bool KCalendarSystemCoptic::isValid(int year, int month, int day) const
446{
447 return KCalendarSystem::isValid(year, month, day);
448}
449
450bool KCalendarSystemCoptic::isValid(const QDate &date) const
451{
452 return KCalendarSystem::isValid(date);
453}
454
455bool KCalendarSystemCoptic::isLeapYear(int year) const
456{
457 return KCalendarSystem::isLeapYear(year);
458}
459
460bool KCalendarSystemCoptic::isLeapYear(const QDate &date) const
461{
462 return KCalendarSystem::isLeapYear(date);
463}
464
465QString KCalendarSystemCoptic::monthName(int month, int year, MonthNameFormat format) const
466{
467 return KCalendarSystem::monthName(month, year, format);
468}
469
470QString KCalendarSystemCoptic::monthName(const QDate &date, MonthNameFormat format) const
471{
472 return KCalendarSystem::monthName(date, format);
473}
474
475QString KCalendarSystemCoptic::weekDayName(int weekDay, WeekDayNameFormat format) const
476{
477 return KCalendarSystem::weekDayName(weekDay, format);
478}
479
480QString KCalendarSystemCoptic::weekDayName(const QDate &date, WeekDayNameFormat format) const
481{
482 return KCalendarSystem::weekDayName(date, format);
483}
484
485int KCalendarSystemCoptic::weekDayOfPray() const
486{
487 return 7;
488}
489
490bool KCalendarSystemCoptic::isLunar() const
491{
492 return false;
493}
494
495bool KCalendarSystemCoptic::isLunisolar() const
496{
497 return false;
498}
499
500bool KCalendarSystemCoptic::isSolar() const
501{
502 return true;
503}
504
505bool KCalendarSystemCoptic::isProleptic() const
506{
507 return false;
508}
509
510bool KCalendarSystemCoptic::julianDayToDate(int jd, int &year, int &month, int &day) const
511{
512 //The Coptic calendar has 12 months of 30 days, a 13th month of 5 or 6 days,
513 //and a leap year every 4th year without fail that falls on the last day of
514 //the year, starting from year 3.
515
516 //Use a fake year 0 for our epoch instead of the real epoch in year 1. This is because year 3
517 //is the first leap year and a pattern of 365/365/366/365 is hard to calculate, instead a
518 //pattern of 365/365/365/366 with the leap day the very last day makes the maths easier.
519
520 //Day number in the fake epoch, 0 indexed
521 int dayInEpoch = jd - (epoch().toJulianDay() - 365);
522 //How many full 4 year leap cycles have been completed, 1461 = (365*3)+366
523 int leapCyclesCompleted = dayInEpoch / 1461;
524 //Which year are we in the current 4 year leap cycle, 0 indexed
525 //Need the qMin as day 366 of 4th year of cycle returns following year (max 3 as 0 index)
526 int yearInCurrentLeapCycle = qMin(3, (dayInEpoch % 1461) / 365);
527 //Calculate the year
528 year = (leapCyclesCompleted * 4) + yearInCurrentLeapCycle;
529 //Days since the fake epoch up to 1st day of this year
530 int daysBeforeThisYear = (year * 365) + (year / 4);
531 //Gives the day number in this year, 0 indexed
532 int dayOfThisYear = dayInEpoch - daysBeforeThisYear;
533 //Then just calculate month and day from that based on regular 30 day months
534 month = ((dayOfThisYear) / 30) + 1;
535 day = dayOfThisYear - ((month - 1) * 30) + 1;
536
537 // If year is -ve then is BC. In Coptic there is no year 0, but the maths
538 // is easier if we pretend there is, so internally year of 0 = 1BC = -1 outside
539 if (year < 1) {
540 year = year - 1;
541 }
542
543 return true;
544}
545
546bool KCalendarSystemCoptic::dateToJulianDay(int year, int month, int day, int &jd) const
547{
548 //The Coptic calendar has 12 months of 30 days, a 13th month of 5 or 6 days,
549 //and a leap year every 4th year without fail that falls on the last day of
550 //the year, starting from year 3. This simple repeating pattern makes calculating
551 // a jd the simple process taking the epoch jd and adding on the years months and
552 //days required.
553
554 // If year is -ve then is 'BC'. In Coptic there is no year 0, but the maths
555 // is easier if we pretend there is, so internally year of -1 = 1BC = 0 internally
556 int y;
557 if (year < 1) {
558 y = year + 1;
559 } else {
560 y = year;
561 }
562
563 jd = epoch().toJulianDay() - 1 // jd of day before Epoch
564 + ((y - 1) * 365) // Add all normal days in years preceding
565 + (y / 4) // Add all leap days in years preceding
566 + ((month - 1) * 30) // Add days this year in months preceding
567 + day; // Add days in this month
568
569 return true;
570}
KCalendarSystemCopticPrivate
Definition: kcalendarsystemcopticprivate_p.h:26
KCalendarSystemCopticPrivate::loadDefaultEraList
virtual void loadDefaultEraList()
Definition: kcalendarsystemcoptic.cpp:46
KCalendarSystemCopticPrivate::~KCalendarSystemCopticPrivate
virtual ~KCalendarSystemCopticPrivate()
Definition: kcalendarsystemcoptic.cpp:37
KCalendarSystemCopticPrivate::maxDaysInWeek
virtual int maxDaysInWeek() const
Definition: kcalendarsystemcoptic.cpp:114
KCalendarSystemCopticPrivate::daysInMonth
virtual int daysInMonth(int year, int month) const
Definition: kcalendarsystemcoptic.cpp:62
KCalendarSystemCopticPrivate::hasLeapMonths
virtual bool hasLeapMonths() const
Definition: kcalendarsystemcoptic.cpp:104
KCalendarSystemCopticPrivate::calendarSystem
virtual KLocale::CalendarSystem calendarSystem() const
Definition: kcalendarsystemcoptic.cpp:41
KCalendarSystemCopticPrivate::maxMonthsInYear
virtual int maxMonthsInYear() const
Definition: kcalendarsystemcoptic.cpp:119
KCalendarSystemCopticPrivate::hasYearZero
virtual bool hasYearZero() const
Definition: kcalendarsystemcoptic.cpp:109
KCalendarSystemCopticPrivate::earliestValidYear
virtual int earliestValidYear() const
Definition: kcalendarsystemcoptic.cpp:124
KCalendarSystemCopticPrivate::daysInYear
virtual int daysInYear(int year) const
Definition: kcalendarsystemcoptic.cpp:75
KCalendarSystemCopticPrivate::daysInWeek
virtual int daysInWeek() const
Definition: kcalendarsystemcoptic.cpp:84
KCalendarSystemCopticPrivate::monthName
virtual QString monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive) const
Definition: kcalendarsystemcoptic.cpp:159
KCalendarSystemCopticPrivate::monthsInYear
virtual int monthsInYear(int year) const
Definition: kcalendarsystemcoptic.cpp:56
KCalendarSystemCopticPrivate::isLeapYear
virtual bool isLeapYear(int year) const
Definition: kcalendarsystemcoptic.cpp:89
KCalendarSystemCopticPrivate::latestValidYear
virtual int latestValidYear() const
Definition: kcalendarsystemcoptic.cpp:129
KCalendarSystemCopticPrivate::weekDayName
virtual QString weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const
Definition: kcalendarsystemcoptic.cpp:330
KCalendarSystemCopticPrivate::KCalendarSystemCopticPrivate
KCalendarSystemCopticPrivate(KCalendarSystemCoptic *q)
Definition: kcalendarsystemcoptic.cpp:32
KCalendarSystemCoptic
Definition: kcalendarsystemcoptic_p.h:38
KCalendarSystemCoptic::~KCalendarSystemCoptic
virtual ~KCalendarSystemCoptic()
Definition: kcalendarsystemcoptic.cpp:414
KCalendarSystemCoptic::isLeapYear
virtual bool isLeapYear(int year) const
Returns whether a given year is a leap year.
Definition: kcalendarsystemcoptic.cpp:455
KCalendarSystemCoptic::julianDayToDate
virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const
Internal method to convert a Julian Day number into the YMD values for this calendar system.
Definition: kcalendarsystemcoptic.cpp:510
KCalendarSystemCoptic::isProleptic
virtual bool isProleptic() const
Returns whether the calendar system is proleptic, i.e.
Definition: kcalendarsystemcoptic.cpp:505
KCalendarSystemCoptic::isLunar
virtual bool isLunar() const
Returns whether the calendar is lunar based.
Definition: kcalendarsystemcoptic.cpp:490
KCalendarSystemCoptic::epoch
virtual QDate epoch() const
Returns a QDate holding the epoch of the calendar system.
Definition: kcalendarsystemcoptic.cpp:423
KCalendarSystemCoptic::weekDayOfPray
virtual int weekDayOfPray() const
Definition: kcalendarsystemcoptic.cpp:485
KCalendarSystemCoptic::weekDayName
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const
Gets specific calendar type week day name.
Definition: kcalendarsystemcoptic.cpp:475
KCalendarSystemCoptic::earliestValidDate
virtual QDate earliestValidDate() const
Returns the earliest date valid in this calendar system implementation.
Definition: kcalendarsystemcoptic.cpp:430
KCalendarSystemCoptic::isSolar
virtual bool isSolar() const
Returns whether the calendar is solar based.
Definition: kcalendarsystemcoptic.cpp:500
KCalendarSystemCoptic::dateToJulianDay
virtual bool dateToJulianDay(int year, int month, int day, int &jd) const
Internal method to convert YMD values for this calendar system into a Julian Day number.
Definition: kcalendarsystemcoptic.cpp:546
KCalendarSystemCoptic::isLunisolar
virtual bool isLunisolar() const
Returns whether the calendar is lunisolar based.
Definition: kcalendarsystemcoptic.cpp:495
KCalendarSystemCoptic::latestValidDate
virtual QDate latestValidDate() const
Returns the latest date valid in this calendar system implementation.
Definition: kcalendarsystemcoptic.cpp:437
KCalendarSystemCoptic::isValid
virtual bool isValid(int year, int month, int day) const
Returns whether a given date is valid in this calendar system.
Definition: kcalendarsystemcoptic.cpp:445
KCalendarSystemCoptic::calendarType
virtual QString calendarType() const
Definition: kcalendarsystemcoptic.cpp:418
KCalendarSystemCoptic::monthName
virtual QString monthName(int month, int year, MonthNameFormat format=LongName) const
Gets specific calendar type month name for a given month number If an invalid month is specified,...
Definition: kcalendarsystemcoptic.cpp:465
KCalendarSystemPrivate
Definition: kcalendarsystemprivate_p.h:32
KCalendarSystemPrivate::q
const KCalendarSystem * q
Definition: kcalendarsystemprivate_p.h:104
KCalendarSystemPrivate::locale
const KLocale * locale() const
Definition: kcalendarsystem.cpp:908
KCalendarSystemPrivate::addEra
void addEra(char direction, int offset, const QDate &startDate, int startYear, const QDate &endDate, const QString &name, const QString &shortName, const QString &format)
Definition: kcalendarsystem.cpp:1000
KCalendarSystem
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
Definition: kcalendarsystem.h:41
KCalendarSystem::day
virtual int day(const QDate &date) const
Returns the day portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1357
KCalendarSystem::monthName
virtual QString monthName(int month, int year, MonthNameFormat format=LongName) const =0
Gets specific calendar type month name for a given month number If an invalid month is specified,...
Definition: kcalendarsystem.cpp:1842
KCalendarSystem::year
virtual int year(const QDate &date) const
Returns the year portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1331
KCalendarSystem::KCalendarSystemCoptic
friend class KCalendarSystemCoptic
Definition: kcalendarsystem.h:1665
KCalendarSystem::isLeapYear
virtual bool isLeapYear(int year) const =0
Returns whether a given year is a leap year.
Definition: kcalendarsystem.cpp:1720
KCalendarSystem::MonthNameFormat
MonthNameFormat
Format for returned month / day name.
Definition: kcalendarsystem.h:55
KCalendarSystem::WeekDayNameFormat
WeekDayNameFormat
Format for returned month / day name.
Definition: kcalendarsystem.h:66
KCalendarSystem::latestValidDate
virtual QDate latestValidDate() const
Returns the latest date valid in this calendar system implementation.
Definition: kcalendarsystem.cpp:1127
KCalendarSystem::isValid
virtual bool isValid(int year, int month, int day) const =0
Returns whether a given date is valid in this calendar system.
Definition: kcalendarsystem.cpp:1133
KCalendarSystem::weekDayName
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const =0
Gets specific calendar type week day name.
Definition: kcalendarsystem.cpp:1881
KCalendarSystem::epoch
virtual QDate epoch() const
Returns a QDate holding the epoch of the calendar system.
Definition: kcalendarsystem.cpp:1115
KCalendarSystem::month
virtual int month(const QDate &date) const
Returns the month portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1344
KLocale
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:70
KLocale::CalendarSystem
CalendarSystem
Definition: klocale.h:780
KLocale::CopticCalendar
@ CopticCalendar
Coptic Calendar as used Coptic Church and some parts of Egypt.
Definition: klocale.h:785
KLocale::DateTimeComponentFormat
DateTimeComponentFormat
Definition: klocale.h:908
KLocale::LongName
@ LongName
Long text format, e.g.
Definition: klocale.h:915
KLocale::ShortName
@ ShortName
Short text format, e.g.
Definition: klocale.h:914
KLocale::NarrowName
@ NarrowName
Narrow text format, may not be unique, e.g.
Definition: klocale.h:913
KLocale::ShortNumber
@ ShortNumber
Number at its natural width, e.g.
Definition: klocale.h:910
KLocalizedString::toString
QString toString() const
Finalizes the translation, creates QString with placeholders substituted.
Definition: klocalizedstring.cpp:192
KSharedConfig
KConfig variant using shared memory.
Definition: ksharedconfig.h:41
KSharedPtr< KSharedConfig >
QString
kcalendarsystemcoptic_p.h
kcalendarsystemcopticprivate_p.h
kcalendarsystemprivate_p.h
kdebug.h
klocale.h
ki18nc
KLocalizedString ki18nc(const char *ctxt, const char *msg)
Creates localized string from a given message, with added context.
Definition: klocalizedstring.cpp:929
i18nc
QString i18nc(const char *ctxt, const char *text)
Returns a localized version of a string and a context.
Definition: klocalizedstring.h:797
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal