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

KDECore

  • kdecore
  • date
kcalendarsystemindiannational.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 "kcalendarsystemindiannational_p.h"
21#include "kcalendarsystemprivate_p.h"
22
23#include "kdebug.h"
24#include "klocale.h"
25
26#include <QtCore/QDate>
27#include <QtCore/QCharRef>
28
29class KCalendarSystemIndianNationalPrivate : public KCalendarSystemPrivate
30{
31public:
32 explicit KCalendarSystemIndianNationalPrivate(KCalendarSystemIndianNational *q);
33
34 virtual ~KCalendarSystemIndianNationalPrivate();
35
36 // Virtual methods each calendar system must re-implement
37 virtual KLocale::CalendarSystem calendarSystem() const;
38 virtual void loadDefaultEraList();
39 virtual int monthsInYear(int year) const;
40 virtual int daysInMonth(int year, int month) const;
41 virtual int daysInYear(int year) const;
42 virtual int daysInWeek() const;
43 virtual bool isLeapYear(int year) const;
44 virtual bool hasLeapMonths() const;
45 virtual bool hasYearZero() const;
46 virtual int maxDaysInWeek() const;
47 virtual int maxMonthsInYear() const;
48 virtual int earliestValidYear() const;
49 virtual int latestValidYear() const;
50 virtual QString monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive) const;
51 virtual QString weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const;
52};
53
54// Shared d pointer base class definitions
55
56KCalendarSystemIndianNationalPrivate::KCalendarSystemIndianNationalPrivate(KCalendarSystemIndianNational *q)
57 : KCalendarSystemPrivate(q)
58{
59}
60
61KCalendarSystemIndianNationalPrivate::~KCalendarSystemIndianNationalPrivate()
62{
63}
64
65KLocale::CalendarSystem KCalendarSystemIndianNationalPrivate::calendarSystem() const
66{
67 return KLocale::IndianNationalCalendar;
68}
69
70void KCalendarSystemIndianNationalPrivate::loadDefaultEraList()
71{
72 QString name, shortName, format;
73 // Saka Era
74 name = i18nc("Calendar Era: Indian National Saka Era, years > 0, LongFormat", "Saka Era");
75 shortName = i18nc("Calendar Era: Indian National Saka Era, years > 0, ShortFormat", "SE");
76 format = i18nc("(kdedt-format) Indian National, SE, full era year format used for %EY, e.g. 2000 SE", "%Ey %EC");
77 addEra('+', 1, q->epoch(), 1, q->latestValidDate(), name, shortName, format);
78}
79
80int KCalendarSystemIndianNationalPrivate::monthsInYear(int year) const
81{
82 Q_UNUSED(year)
83 return 12;
84}
85
86int KCalendarSystemIndianNationalPrivate::daysInMonth(int year, int month) const
87{
88 if (month == 1) {
89 if (isLeapYear(year)) {
90 return 31;
91 } else {
92 return 30;
93 }
94 }
95
96 if (month >= 2 && month <= 6) {
97 return 31;
98 }
99
100 return 30;
101}
102
103int KCalendarSystemIndianNationalPrivate::daysInYear(int year) const
104{
105 if (isLeapYear(year)) {
106 return 366;
107 } else {
108 return 365;
109 }
110}
111
112int KCalendarSystemIndianNationalPrivate::daysInWeek() const
113{
114 return 7;
115}
116
117bool KCalendarSystemIndianNationalPrivate::isLeapYear(int year) const
118{
119 //Uses same rule as Gregorian, and is explicitly synchronized to Gregorian
120 //so add 78 years to get Gregorian year and apply Gregorian calculation
121 year = year + 78;
122 if (!hasYearZero() && year < 1) {
123 year = year + 1;
124 }
125
126 if (year % 4 == 0) {
127 if (year % 100 != 0) {
128 return true;
129 } else if (year % 400 == 0) {
130 return true;
131 }
132 }
133
134 return false;
135}
136
137bool KCalendarSystemIndianNationalPrivate::hasLeapMonths() const
138{
139 return false;
140}
141
142bool KCalendarSystemIndianNationalPrivate::hasYearZero() const
143{
144 return true;
145}
146
147int KCalendarSystemIndianNationalPrivate::maxDaysInWeek() const
148{
149 return 7;
150}
151
152int KCalendarSystemIndianNationalPrivate::maxMonthsInYear() const
153{
154 return 12;
155}
156
157int KCalendarSystemIndianNationalPrivate::earliestValidYear() const
158{
159 return 0;
160}
161
162int KCalendarSystemIndianNationalPrivate::latestValidYear() const
163{
164 return 9999;
165}
166
167QString KCalendarSystemIndianNationalPrivate::monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive) const
168{
169 Q_UNUSED(year);
170
171 if (format == KLocale::NarrowName) {
172 switch (month) {
173 case 1:
174 return ki18nc("Indian National month 1 - KLocale::NarrowName", "C").toString(locale());
175 case 2:
176 return ki18nc("Indian National month 2 - KLocale::NarrowName", "V").toString(locale());
177 case 3:
178 return ki18nc("Indian National month 3 - KLocale::NarrowName", "J").toString(locale());
179 case 4:
180 return ki18nc("Indian National month 4 - KLocale::NarrowName", "Ā").toString(locale());
181 case 5:
182 return ki18nc("Indian National month 5 - KLocale::NarrowName", "S").toString(locale());
183 case 6:
184 return ki18nc("Indian National month 6 - KLocale::NarrowName", "B").toString(locale());
185 case 7:
186 return ki18nc("Indian National month 7 - KLocale::NarrowName", "Ā").toString(locale());
187 case 8:
188 return ki18nc("Indian National month 8 - KLocale::NarrowName", "K").toString(locale());
189 case 9:
190 return ki18nc("Indian National month 9 - KLocale::NarrowName", "A").toString(locale());
191 case 10:
192 return ki18nc("Indian National month 10 - KLocale::NarrowName", "P").toString(locale());
193 case 11:
194 return ki18nc("Indian National month 11 - KLocale::NarrowName", "M").toString(locale());
195 case 12:
196 return ki18nc("Indian National month 12 - KLocale::NarrowName", "P").toString(locale());
197 default:
198 return QString();
199 }
200 }
201
202 if (format == KLocale::ShortName && possessive) {
203 switch (month) {
204 case 1:
205 return ki18nc("Indian National month 1 - KLocale::ShortName Possessive", "of Cha").toString(locale());
206 case 2:
207 return ki18nc("Indian National month 2 - KLocale::ShortName Possessive", "of Vai").toString(locale());
208 case 3:
209 return ki18nc("Indian National month 3 - KLocale::ShortName Possessive", "of Jya").toString(locale());
210 case 4:
211 return ki18nc("Indian National month 4 - KLocale::ShortName Possessive", "of Āsh").toString(locale());
212 case 5:
213 return ki18nc("Indian National month 5 - KLocale::ShortName Possessive", "of Shr").toString(locale());
214 case 6:
215 return ki18nc("Indian National month 6 - KLocale::ShortName Possessive", "of Bhā").toString(locale());
216 case 7:
217 return ki18nc("Indian National month 7 - KLocale::ShortName Possessive", "of Āsw").toString(locale());
218 case 8:
219 return ki18nc("Indian National month 8 - KLocale::ShortName Possessive", "of Kār").toString(locale());
220 case 9:
221 return ki18nc("Indian National month 9 - KLocale::ShortName Possessive", "of Agr").toString(locale());
222 case 10:
223 return ki18nc("Indian National month 10 - KLocale::ShortName Possessive", "of Pau").toString(locale());
224 case 11:
225 return ki18nc("Indian National month 11 - KLocale::ShortName Possessive", "of Māg").toString(locale());
226 case 12:
227 return ki18nc("Indian National month 12 - KLocale::ShortName Possessive", "of Phā").toString(locale());
228 default:
229 return QString();
230 }
231 }
232
233 if (format == KLocale::ShortName && !possessive) {
234 switch (month) {
235 case 1:
236 return ki18nc("Indian National month 1 - KLocale::ShortName", "Cha").toString(locale());
237 case 2:
238 return ki18nc("Indian National month 2 - KLocale::ShortName", "Vai").toString(locale());
239 case 3:
240 return ki18nc("Indian National month 3 - KLocale::ShortName", "Jya").toString(locale());
241 case 4:
242 return ki18nc("Indian National month 4 - KLocale::ShortName", "Āsh").toString(locale());
243 case 5:
244 return ki18nc("Indian National month 5 - KLocale::ShortName", "Shr").toString(locale());
245 case 6:
246 return ki18nc("Indian National month 6 - KLocale::ShortName", "Bhā").toString(locale());
247 case 7:
248 return ki18nc("Indian National month 7 - KLocale::ShortName", "Āsw").toString(locale());
249 case 8:
250 return ki18nc("Indian National month 8 - KLocale::ShortName", "Kār").toString(locale());
251 case 9:
252 return ki18nc("Indian National month 9 - KLocale::ShortName", "Agr").toString(locale());
253 case 10:
254 return ki18nc("Indian National month 10 - KLocale::ShortName", "Pau").toString(locale());
255 case 11:
256 return ki18nc("Indian National month 11 - KLocale::ShortName", "Māg").toString(locale());
257 case 12:
258 return ki18nc("Indian National month 12 - KLocale::ShortName", "Phā").toString(locale());
259 default:
260 return QString();
261 }
262 }
263
264 if (format == KLocale::LongName && possessive) {
265 switch (month) {
266 case 1:
267 return ki18nc("Indian National month 1 - KLocale::LongName Possessive", "of Chaitra").toString(locale());
268 case 2:
269 return ki18nc("Indian National month 2 - KLocale::LongName Possessive", "of Vaishākh").toString(locale());
270 case 3:
271 return ki18nc("Indian National month 3 - KLocale::LongName Possessive", "of Jyaishtha").toString(locale());
272 case 4:
273 return ki18nc("Indian National month 4 - KLocale::LongName Possessive", "of Āshādha").toString(locale());
274 case 5:
275 return ki18nc("Indian National month 5 - KLocale::LongName Possessive", "of Shrāvana").toString(locale());
276 case 6:
277 return ki18nc("Indian National month 6 - KLocale::LongName Possessive", "of Bhādrapad").toString(locale());
278 case 7:
279 return ki18nc("Indian National month 7 - KLocale::LongName Possessive", "of Āshwin").toString(locale());
280 case 8:
281 return ki18nc("Indian National month 8 - KLocale::LongName Possessive", "of Kārtik").toString(locale());
282 case 9:
283 return ki18nc("Indian National month 9 - KLocale::LongName Possessive", "of Agrahayana").toString(locale());
284 case 10:
285 return ki18nc("Indian National month 10 - KLocale::LongName Possessive", "of Paush").toString(locale());
286 case 11:
287 return ki18nc("Indian National month 11 - KLocale::LongName Possessive", "of Māgh").toString(locale());
288 case 12:
289 return ki18nc("Indian National month 12 - KLocale::LongName Possessive", "of Phālgun").toString(locale());
290 default:
291 return QString();
292 }
293 }
294
295 // Default to LongName
296 switch (month) {
297 case 1:
298 return ki18nc("Indian National month 1 - KLocale::LongName", "Chaitra").toString(locale());
299 case 2:
300 return ki18nc("Indian National month 2 - KLocale::LongName", "Vaishākh").toString(locale());
301 case 3:
302 return ki18nc("Indian National month 3 - KLocale::LongName", "Jyaishtha").toString(locale());
303 case 4:
304 return ki18nc("Indian National month 4 - KLocale::LongName", "Āshādha").toString(locale());
305 case 5:
306 return ki18nc("Indian National month 5 - KLocale::LongName", "Shrāvana").toString(locale());
307 case 6:
308 return ki18nc("Indian National month 6 - KLocale::LongName", "Bhādrapad").toString(locale());
309 case 7:
310 return ki18nc("Indian National month 7 - KLocale::LongName", "Āshwin").toString(locale());
311 case 8:
312 return ki18nc("Indian National month 8 - KLocale::LongName", "Kārtik").toString(locale());
313 case 9:
314 return ki18nc("Indian National month 9 - KLocale::LongName", "Agrahayana").toString(locale());
315 case 10:
316 return ki18nc("Indian National month 10 - KLocale::LongName", "Paush").toString(locale());
317 case 11:
318 return ki18nc("Indian National month 11 - KLocale::LongName", "Māgh").toString(locale());
319 case 12:
320 return ki18nc("Indian National month 12 - KLocale::LongName", "Phālgun").toString(locale());
321 default:
322 return QString();
323 }
324}
325
326QString KCalendarSystemIndianNationalPrivate::weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const
327{
328 if (format == KLocale::NarrowName) {
329 switch (weekDay) {
330 case 1:
331 return ki18nc("Indian National weekday 1 - KLocale::NarrowName ", "S").toString(locale());
332 case 2:
333 return ki18nc("Indian National weekday 2 - KLocale::NarrowName ", "M").toString(locale());
334 case 3:
335 return ki18nc("Indian National weekday 3 - KLocale::NarrowName ", "B").toString(locale());
336 case 4:
337 return ki18nc("Indian National weekday 4 - KLocale::NarrowName ", "G").toString(locale());
338 case 5:
339 return ki18nc("Indian National weekday 5 - KLocale::NarrowName ", "S").toString(locale());
340 case 6:
341 return ki18nc("Indian National weekday 6 - KLocale::NarrowName ", "S").toString(locale());
342 case 7:
343 return ki18nc("Indian National weekday 7 - KLocale::NarrowName ", "R").toString(locale());
344 default:
345 return QString();
346 }
347 }
348
349 if (format == KLocale::ShortName || format == KLocale:: ShortNumber) {
350 switch (weekDay) {
351 case 1:
352 return ki18nc("Indian National weekday 1 - KLocale::ShortName", "Som").toString(locale());
353 case 2:
354 return ki18nc("Indian National weekday 2 - KLocale::ShortName", "Mañ").toString(locale());
355 case 3:
356 return ki18nc("Indian National weekday 3 - KLocale::ShortName", "Bud").toString(locale());
357 case 4:
358 return ki18nc("Indian National weekday 4 - KLocale::ShortName", "Gur").toString(locale());
359 case 5:
360 return ki18nc("Indian National weekday 5 - KLocale::ShortName", "Suk").toString(locale());
361 case 6:
362 return ki18nc("Indian National weekday 6 - KLocale::ShortName", "San").toString(locale());
363 case 7:
364 return ki18nc("Indian National weekday 7 - KLocale::ShortName", "Rav").toString(locale());
365 default: return QString();
366 }
367 }
368
369 switch (weekDay) {
370 case 1:
371 return ki18nc("Indian National weekday 1 - KLocale::LongName", "Somavãra").toString(locale());
372 case 2:
373 return ki18nc("Indian National weekday 2 - KLocale::LongName", "Mañgalvã").toString(locale());
374 case 3:
375 return ki18nc("Indian National weekday 3 - KLocale::LongName", "Budhavãra").toString(locale());
376 case 4:
377 return ki18nc("Indian National weekday 4 - KLocale::LongName", "Guruvãra").toString(locale());
378 case 5:
379 return ki18nc("Indian National weekday 5 - KLocale::LongName", "Sukravãra").toString(locale());
380 case 6:
381 return ki18nc("Indian National weekday 6 - KLocale::LongName", "Sanivãra").toString(locale());
382 case 7:
383 return ki18nc("Indian National weekday 7 - KLocale::LongName", "Raviãra").toString(locale());
384 default:
385 return QString();
386 }
387}
388
389
390KCalendarSystemIndianNational::KCalendarSystemIndianNational(const KLocale *locale)
391 : KCalendarSystem(*new KCalendarSystemIndianNationalPrivate(this), KSharedConfig::Ptr(), locale)
392{
393 d_ptr->loadConfig(calendarType());
394}
395
396KCalendarSystemIndianNational::KCalendarSystemIndianNational(const KSharedConfig::Ptr config, const KLocale *locale)
397 : KCalendarSystem(*new KCalendarSystemIndianNationalPrivate(this), config, locale)
398{
399 d_ptr->loadConfig(calendarType());
400}
401
402KCalendarSystemIndianNational::KCalendarSystemIndianNational(KCalendarSystemIndianNationalPrivate &dd,
403 const KSharedConfig::Ptr config,
404 const KLocale *locale)
405 : KCalendarSystem(dd, config, locale)
406{
407 d_ptr->loadConfig(calendarType());
408}
409
410KCalendarSystemIndianNational::~KCalendarSystemIndianNational()
411{
412}
413
414QString KCalendarSystemIndianNational::calendarType() const
415{
416 return QLatin1String("indian-national");
417}
418
419QDate KCalendarSystemIndianNational::epoch() const
420{
421 //0000-01-01, has Year 0.
422 //0078-03-22 AD Gregorian / 0078-03-24 AD Julian
423 return QDate::fromJulianDay(1749994);
424}
425
426QDate KCalendarSystemIndianNational::earliestValidDate() const
427{
428 //0000-01-01, has Year 0.
429 //0078-03-22 AD Gregorian / 0078-03-24 AD Julian
430 //Don't do proleptic yet, need to check
431 return QDate::fromJulianDay(1749630);
432}
433
434QDate KCalendarSystemIndianNational::latestValidDate() const
435{
436 // Set to last day of year 9999 until confirm date formats & widgets support > 9999
437 //9999-12-30
438 //10078-03-21 AD Gregorian
439 return QDate::fromJulianDay(5402054);
440}
441
442bool KCalendarSystemIndianNational::isValid(int year, int month, int day) const
443{
444 return KCalendarSystem::isValid(year, month, day);
445}
446
447bool KCalendarSystemIndianNational::isValid(const QDate &date) const
448{
449 return KCalendarSystem::isValid(date);
450}
451
452bool KCalendarSystemIndianNational::isLeapYear(int year) const
453{
454 return KCalendarSystem::isLeapYear(year);
455}
456
457bool KCalendarSystemIndianNational::isLeapYear(const QDate &date) const
458{
459 return KCalendarSystem::isLeapYear(date);
460}
461
462QString KCalendarSystemIndianNational::monthName(int month, int year, MonthNameFormat format) const
463{
464 return KCalendarSystem::monthName(month, year, format);
465}
466
467QString KCalendarSystemIndianNational::monthName(const QDate &date, MonthNameFormat format) const
468{
469 return KCalendarSystem::monthName(date, format);
470}
471
472QString KCalendarSystemIndianNational::weekDayName(int weekDay, WeekDayNameFormat format) const
473{
474 return KCalendarSystem::weekDayName(weekDay, format);
475}
476
477QString KCalendarSystemIndianNational::weekDayName(const QDate &date, WeekDayNameFormat format) const
478{
479 return KCalendarSystem::weekDayName(date, format);
480}
481
482int KCalendarSystemIndianNational::weekDayOfPray() const
483{
484 return 7; // JPL ???
485}
486
487bool KCalendarSystemIndianNational::isLunar() const
488{
489 return false;
490}
491
492bool KCalendarSystemIndianNational::isLunisolar() const
493{
494 return true;
495}
496
497bool KCalendarSystemIndianNational::isSolar() const
498{
499 return false;
500}
501
502bool KCalendarSystemIndianNational::isProleptic() const
503{
504 return false;
505}
506
507bool KCalendarSystemIndianNational::julianDayToDate(int jd, int &year, int &month, int &day) const
508{
509 int L, N, I, J, D, M, Y;
510
511 // "Explanatory Supplement to the Astronomical Almanac" 2006 section 12.94 pp 605-606
512 // Originally from "Report of the Calendar Reform Committee" 1955
513 L = jd + 68518;
514 N = (4 * L) / 146097;
515 L = L - (146097 * N + 3) / 4;
516 I = (4000 * (L + 1)) / 1461001;
517 L = L - (1461 * I) / 4 + 1;
518 J = ((L - 1) / 31) * (1 - L / 185) + (L / 185) * ((L - 156) / 30 + 5) - L / 366;
519 D = L - 31 * J + ((J + 2) / 8) * (J - 5);
520 L = J / 11;
521 M = J + 2 - 12 * L;
522 Y = 100 * (N - 49) + L + I - 78;
523
524 day = D;
525 month = M;
526 year = Y;
527
528 return true;
529}
530
531bool KCalendarSystemIndianNational::dateToJulianDay(int year, int month, int day, int &jd) const
532{
533 int Y = year;
534 int M = month;
535 int D = day;
536
537 // "Explanatory Supplement to the Astronomical Almanac" 2006 section 12.94 pp 605-606
538 // Originally from "Report of the Calendar Reform Committee" 1955
539 jd = 365 * Y
540 + (Y + 78 - 1 / M) / 4
541 + 31 * M
542 - (M + 9) / 11
543 - (M / 7) * (M - 7)
544 - (3 * ((Y + 78 - 1 / M) / 100 + 1)) / 4
545 + D
546 + 1749579;
547
548 return true;
549}
KCalendarSystemIndianNational
Definition: kcalendarsystemindiannational_p.h:42
KCalendarSystemIndianNational::isLunisolar
virtual bool isLunisolar() const
Returns whether the calendar is lunisolar based.
Definition: kcalendarsystemindiannational.cpp:492
KCalendarSystemIndianNational::isValid
virtual bool isValid(int year, int month, int day) const
Returns whether a given date is valid in this calendar system.
Definition: kcalendarsystemindiannational.cpp:442
KCalendarSystemIndianNational::isSolar
virtual bool isSolar() const
Returns whether the calendar is solar based.
Definition: kcalendarsystemindiannational.cpp:497
KCalendarSystemIndianNational::weekDayName
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const
Gets specific calendar type week day name.
Definition: kcalendarsystemindiannational.cpp:472
KCalendarSystemIndianNational::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: kcalendarsystemindiannational.cpp:507
KCalendarSystemIndianNational::isLeapYear
virtual bool isLeapYear(int year) const
Returns whether a given year is a leap year.
Definition: kcalendarsystemindiannational.cpp:452
KCalendarSystemIndianNational::latestValidDate
virtual QDate latestValidDate() const
Returns the latest date valid in this calendar system implementation.
Definition: kcalendarsystemindiannational.cpp:434
KCalendarSystemIndianNational::earliestValidDate
virtual QDate earliestValidDate() const
Returns the earliest date valid in this calendar system implementation.
Definition: kcalendarsystemindiannational.cpp:426
KCalendarSystemIndianNational::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: kcalendarsystemindiannational.cpp:462
KCalendarSystemIndianNational::calendarType
virtual QString calendarType() const
Definition: kcalendarsystemindiannational.cpp:414
KCalendarSystemIndianNational::isLunar
virtual bool isLunar() const
Returns whether the calendar is lunar based.
Definition: kcalendarsystemindiannational.cpp:487
KCalendarSystemIndianNational::isProleptic
virtual bool isProleptic() const
Returns whether the calendar system is proleptic, i.e.
Definition: kcalendarsystemindiannational.cpp:502
KCalendarSystemIndianNational::~KCalendarSystemIndianNational
virtual ~KCalendarSystemIndianNational()
Definition: kcalendarsystemindiannational.cpp:410
KCalendarSystemIndianNational::epoch
virtual QDate epoch() const
Returns a QDate holding the epoch of the calendar system.
Definition: kcalendarsystemindiannational.cpp:419
KCalendarSystemIndianNational::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: kcalendarsystemindiannational.cpp:531
KCalendarSystemIndianNational::weekDayOfPray
virtual int weekDayOfPray() const
Definition: kcalendarsystemindiannational.cpp:482
KCalendarSystemPrivate
Definition: kcalendarsystemprivate_p.h:32
KCalendarSystemPrivate::latestValidYear
virtual int latestValidYear() const
Definition: kcalendarsystem.cpp:380
KCalendarSystemPrivate::monthName
virtual QString monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive=false) const
Definition: kcalendarsystem.cpp:387
KCalendarSystemPrivate::isLeapYear
virtual bool isLeapYear(int year) const
Definition: kcalendarsystem.cpp:322
KCalendarSystemPrivate::calendarSystem
virtual KLocale::CalendarSystem calendarSystem() const
Definition: kcalendarsystem.cpp:261
KCalendarSystemPrivate::q
const KCalendarSystem * q
Definition: kcalendarsystemprivate_p.h:104
KCalendarSystemPrivate::daysInYear
virtual int daysInYear(int year) const
Definition: kcalendarsystem.cpp:304
KCalendarSystemPrivate::weekDayName
virtual QString weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const
Definition: kcalendarsystem.cpp:398
KCalendarSystemPrivate::earliestValidYear
virtual int earliestValidYear() const
Definition: kcalendarsystem.cpp:371
KCalendarSystemPrivate::loadDefaultEraList
virtual void loadDefaultEraList()
Definition: kcalendarsystem.cpp:269
KCalendarSystemPrivate::hasYearZero
virtual bool hasYearZero() const
Definition: kcalendarsystem.cpp:348
KCalendarSystemPrivate::daysInMonth
virtual int daysInMonth(int year, int month) const
Definition: kcalendarsystem.cpp:285
KCalendarSystemPrivate::hasLeapMonths
virtual bool hasLeapMonths() const
Definition: kcalendarsystem.cpp:341
KCalendarSystemPrivate::monthsInYear
virtual int monthsInYear(int year) const
Definition: kcalendarsystem.cpp:277
KCalendarSystemPrivate::maxDaysInWeek
virtual int maxDaysInWeek() const
Definition: kcalendarsystem.cpp:355
KCalendarSystemPrivate::daysInWeek
virtual int daysInWeek() const
Definition: kcalendarsystem.cpp:315
KCalendarSystemPrivate::maxMonthsInYear
virtual int maxMonthsInYear() const
Definition: kcalendarsystem.cpp:362
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::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::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::KCalendarSystemIndianNational
friend class KCalendarSystemIndianNational
Definition: kcalendarsystem.h:1669
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::IndianNationalCalendar
@ IndianNationalCalendar
Indian National Calendar, not the Lunar Calendar.
Definition: klocale.h:794
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
M
#define M(h, p)
Definition: kcalendarsystemhebrew.cpp:156
kcalendarsystemindiannational_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
I
#define I
KGlobal::locale
KLocale * locale()
Returns the global locale object.
Definition: kglobal.cpp:170
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