• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
kcalendarsystemworld.h
1 #ifndef KCALENDARSYSTEMWORLD_H
2 #define KCALENDARSYSTEMWORLD_H
3 
4 /*
5  Copyright (C) 2023 by Roman Savochenko, <roman@oscada.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; version 2 of the License.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the
18  Free Software Foundation, Inc.,
19  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #include <tqdatetime.h>
23 #include <tqstring.h>
24 
25 #include "kcalendarsystem.h"
26 
30 class TDECORE_EXPORT KCalendarSystemWorld : public KCalendarSystem
31 {
32  public:
33  KCalendarSystemWorld( const TDELocale* locale = 0 ) : KCalendarSystem(locale) { }
34 
35  int year( const TQDate& date ) const;
36  int month( const TQDate& date ) const;
37  int day( const TQDate& date ) const { return date.day(); }
38  int dayOfWeek( const TQDate& date ) const { return date.dayOfWeek(); }
39  int dayOfYear( const TQDate& date ) const { return date.dayOfYear(); }
40 
41  bool setYMD( TQDate& date, int y, int m, int d ) const;
42 
43  TQDate addYears( const TQDate& date, int nyears ) const { return date.addYears(nyears); }
44  TQDate addMonths( const TQDate& date, int nmonths) const { return date.addMonths(nmonths); }
45  TQDate addDays( const TQDate& date, int ndays ) const { return date.addDays(ndays); }
46 
47  int monthsInYear( const TQDate& date ) const{ return 12; }
48 
49  int daysInYear( const TQDate& date ) const { return date.daysInYear(); }
50  int daysInMonth( const TQDate& date ) const { return date.daysInMonth(); }
51  int weeksInYear( int year ) const { return 52; }
52  int weekNumber( const TQDate& date, int* yearNum = 0 ) const { return date.weekNumber(yearNum); }
53 
54  TQString monthName( const TQDate& date, bool shortName = false ) const { return monthName(month(date), 0, shortName); }
55  TQString monthName( int month, int year, bool shortName = false ) const;
56  TQString monthNamePossessive( const TQDate& date, bool shortName = false ) const { return monthName(date, shortName); }
57  TQString monthNamePossessive( int month, int year, bool shortName = false ) const { return monthName(month, year, shortName); }
58  TQString weekDayName( const TQDate& date, bool shortName = false ) const { return weekDayName(dayOfWeek(date), shortName); }
59  TQString weekDayName( int weekDay, bool shortName = false ) const;
60 
61  int minValidYear( ) const { return 0; }
62  int maxValidYear( ) const { return 10000; }
63  int weekDayOfPray( ) const { return 7; } // sunday
64 
65  TQString calendarName( ) const { return TQString::fromLatin1("world"); }
66 
67  bool isLunar( ) const { return false; }
68  bool isLunisolar( ) const { return false; }
69  bool isSolar( ) const { return true; }
70 };
71 
72 #endif

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.