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

tdecore

Public Member Functions | Protected Member Functions | List of all members
KCalendarSystem Class Referenceabstract

#include <kcalendarsystem.h>

Inheritance diagram for KCalendarSystem:
KCalendarSystemJalali

Public Member Functions

 KCalendarSystem (const TDELocale *locale=0)
 
virtual ~KCalendarSystem ()
 
virtual int year (const TQDate &date) const =0
 
virtual TQString yearString (const TQDate &pDate, bool bShort) const
 
virtual int yearStringToInteger (const TQString &sNum, int &iLength) const
 
virtual int month (const TQDate &date) const =0
 
virtual TQString monthString (const TQDate &pDate, bool bShort) const
 
virtual int monthStringToInteger (const TQString &sNum, int &iLength) const
 
virtual int day (const TQDate &date) const =0
 
virtual TQString dayString (const TQDate &pDate, bool bShort) const
 
virtual int dayStringToInteger (const TQString &sNum, int &iLength) const
 
virtual int dayOfWeek (const TQDate &date) const =0
 
virtual int dayOfYear (const TQDate &date) const =0
 
virtual bool setYMD (TQDate &date, int y, int m, int d) const =0
 
virtual TQDate addYears (const TQDate &date, int nyears) const =0
 
virtual TQDate addMonths (const TQDate &date, int nmonths) const =0
 
virtual TQDate addDays (const TQDate &date, int ndays) const =0
 
virtual int monthsInYear (const TQDate &date) const =0
 
virtual int daysInYear (const TQDate &date) const =0
 
virtual int daysInMonth (const TQDate &date) const =0
 
virtual int weeksInYear (int year) const =0
 
virtual int weekNumber (const TQDate &date, int *yearNum=0) const =0
 
virtual TQString monthName (int month, int year, bool shortName=false) const =0
 
virtual TQString monthName (const TQDate &date, bool shortName=false) const =0
 
virtual TQString monthNamePossessive (int month, int year, bool shortName=false) const =0
 
virtual TQString monthNamePossessive (const TQDate &date, bool shortName=false) const =0
 
virtual TQString weekDayName (int weekDay, bool shortName=false) const =0
 
virtual TQString weekDayName (const TQDate &date, bool shortName=false) const =0
 
virtual int minValidYear () const =0
 
virtual int maxValidYear () const =0
 
virtual int weekDayOfPray () const =0
 
virtual TQString calendarName () const =0
 
virtual bool isLunar () const =0
 
virtual bool isLunisolar () const =0
 
virtual bool isSolar () const =0
 

Protected Member Functions

const TDELocale * locale () const
 

Detailed Description

CalendarSystem abstract class, default derived kde gregorian class and factory class.

Provides support for different calendar types for kde calendar widget and related stuff.

Derived classes must be created through KCalendarFactory class

Author
Carlos Moro cfmor.nosp@m.o@co.nosp@m.rreo..nosp@m.unio.nosp@m.vi.es
Since
3.2

Definition at line 42 of file kcalendarsystem.h.

Constructor & Destructor Documentation

◆ KCalendarSystem()

KCalendarSystem::KCalendarSystem ( const TDELocale *  locale = 0)

Constructor of abstract calendar class.

This will be called by the derived classes.

Parameters
localeIt will use this locale for translations, 0 means global.

Definition at line 36 of file kcalendarsystem.cpp.

◆ ~KCalendarSystem()

KCalendarSystem::~KCalendarSystem ( )
virtual

Descructor.

Definition at line 42 of file kcalendarsystem.cpp.

Member Function Documentation

◆ addDays()

virtual TQDate KCalendarSystem::addDays ( const TQDate &  date,
int  ndays 
) const
pure virtual

Returns a TQDate object containing a date ndays later.

Parameters
dateThe old date
ndaysThe number of days to add
Returns
The new date

Implemented in KCalendarSystemJalali.

◆ addMonths()

virtual TQDate KCalendarSystem::addMonths ( const TQDate &  date,
int  nmonths 
) const
pure virtual

Returns a TQDate object containing a date nmonths later.

Parameters
dateThe old date
nmonthsThe number of months to add
Returns
The new date

Implemented in KCalendarSystemJalali.

◆ addYears()

virtual TQDate KCalendarSystem::addYears ( const TQDate &  date,
int  nyears 
) const
pure virtual

Returns a TQDate object containing a date nyears later.

Parameters
dateThe old date
nyearsThe number of years to add
Returns
The new date

Implemented in KCalendarSystemJalali.

◆ calendarName()

virtual TQString KCalendarSystem::calendarName ( ) const
pure virtual

Gets the string representing the calendar.

Implemented in KCalendarSystemJalali.

◆ day()

virtual int KCalendarSystem::day ( const TQDate &  date) const
pure virtual

Gets specific calendar type day number of month for a given date.

Parameters
dategregorian date equivalent to the specific one
Returns
day of the month

Implemented in KCalendarSystemJalali.

◆ dayOfWeek()

virtual int KCalendarSystem::dayOfWeek ( const TQDate &  date) const
pure virtual

Gets specific calendar type number of day of week number for a given date.

Parameters
dategregorian date
Returns
day of week

Implemented in KCalendarSystemJalali.

◆ dayOfYear()

virtual int KCalendarSystem::dayOfYear ( const TQDate &  date) const
pure virtual

Gets specific calendar type day number of year for a given date.

Parameters
dategregorian date equivalent to the specific one
Returns
day number

Implemented in KCalendarSystemJalali.

◆ daysInMonth()

virtual int KCalendarSystem::daysInMonth ( const TQDate &  date) const
pure virtual

Gets specific calendar type number of days in month for a given date.

Parameters
dategregorian date
Returns
number of days for month in date

Implemented in KCalendarSystemJalali.

◆ daysInYear()

virtual int KCalendarSystem::daysInYear ( const TQDate &  date) const
pure virtual

Gets the number of days in date whose years specified.

Parameters
dateGregorian date equivalent to the specific one
Returns
The number of days in year

Implemented in KCalendarSystemJalali.

◆ dayString()

TQString KCalendarSystem::dayString ( const TQDate &  pDate,
bool  bShort 
) const
virtual

Converts a date into a day literal.

Parameters
pDateThe date to convert
bShortIf the short version of should be used
Returns
The day literal of the date

Definition at line 55 of file kcalendarsystem.cpp.

◆ dayStringToInteger()

int KCalendarSystem::dayStringToInteger ( const TQString &  sNum,
int &  iLength 
) const
virtual

Converts a day literal of a part of a string into a integer starting at the beginning of the string.

Parameters
sNumThe string to parse
iLengthThe number of QChars used, and 0 if no valid symbols was found in the string
Returns
An integer corresponding to the day

Definition at line 104 of file kcalendarsystem.cpp.

◆ isLunar()

virtual bool KCalendarSystem::isLunar ( ) const
pure virtual

Gets if the calendar is lunar based.

Returns
if the calendar is lunar based

Implemented in KCalendarSystemJalali.

◆ isLunisolar()

virtual bool KCalendarSystem::isLunisolar ( ) const
pure virtual

Gets if the calendar is lunisolar based.

Returns
if the calendar is lunisolar based

Implemented in KCalendarSystemJalali.

◆ isSolar()

virtual bool KCalendarSystem::isSolar ( ) const
pure virtual

Gets if the calendar is solar based.

Returns
if the calendar is solar based

Implemented in KCalendarSystemJalali.

◆ locale()

const TDELocale * KCalendarSystem::locale ( ) const
protected

Gets the locale the calendar uses for translations.

Set in the constructor.

Definition at line 47 of file kcalendarsystem.cpp.

◆ maxValidYear()

virtual int KCalendarSystem::maxValidYear ( ) const
pure virtual

Gets the maximum year value supported by specific calendar type algorithms (TQDate, 8000)

Returns
maximum year supported

Implemented in KCalendarSystemJalali.

◆ minValidYear()

virtual int KCalendarSystem::minValidYear ( ) const
pure virtual

Gets the first year value supported by specific calendar type algorithms.

Returns
first year supported

Implemented in KCalendarSystemJalali.

◆ month()

virtual int KCalendarSystem::month ( const TQDate &  date) const
pure virtual

Gets specific calendar type month for a given gregorian date.

Parameters
dategregorian date
Returns
month number

Implemented in KCalendarSystemJalali.

◆ monthName() [1/2]

virtual TQString KCalendarSystem::monthName ( const TQDate &  date,
bool  shortName = false 
) const
pure virtual

Gets specific calendar type month name for a given gregorian date.

Parameters
dateGregorian date
shortNameSpecifies if the short month name should be used
Returns
The name of the month

Implemented in KCalendarSystemJalali.

◆ monthName() [2/2]

virtual TQString KCalendarSystem::monthName ( int  month,
int  year,
bool  shortName = false 
) const
pure virtual

Gets specific calendar type month name for a given month number If an invalid month is specified, TQString::null is returned.

Parameters
monthThe month number
yearThe year the month belongs to
shortNameSpecifies if the short month name should be used
Returns
The name of the month

Implemented in KCalendarSystemJalali.

◆ monthNamePossessive() [1/2]

virtual TQString KCalendarSystem::monthNamePossessive ( const TQDate &  date,
bool  shortName = false 
) const
pure virtual

Returns a string containing the possessive form of the month name.

("of January", "of February", etc.) It's needed in long format dates in some languages.

Parameters
dateGregorian date
shortNameSpecifies if the short month name should be used
Returns
The possessive form of the name of the month

Implemented in KCalendarSystemJalali.

◆ monthNamePossessive() [2/2]

virtual TQString KCalendarSystem::monthNamePossessive ( int  month,
int  year,
bool  shortName = false 
) const
pure virtual

Returns a string containing the possessive form of the month name.

("of January", "of February", etc.) It's needed in long format dates in some languages. If an invalid month is specified, TQString::null is returned.

Parameters
monthThe month number
yearThe year the month belongs to
shortNameSpecifies if the short month name should be used
Returns
The possessive form of the name of the month

Implemented in KCalendarSystemJalali.

◆ monthsInYear()

virtual int KCalendarSystem::monthsInYear ( const TQDate &  date) const
pure virtual

Gets specific calendar type number of month for a given year.

Parameters
dateThe date whose year to use
Returns
The number of months in that year

Implemented in KCalendarSystemJalali.

◆ monthString()

TQString KCalendarSystem::monthString ( const TQDate &  pDate,
bool  bShort 
) const
virtual

Converts a date into a month literal.

Parameters
pDateThe date to convert
bShortIf the short version of should be used
Returns
The month literal of the date

Definition at line 66 of file kcalendarsystem.cpp.

◆ monthStringToInteger()

int KCalendarSystem::monthStringToInteger ( const TQString &  sNum,
int &  iLength 
) const
virtual

Converts a month literal of a part of a string into a integer starting at the beginning of the string.

Parameters
sNumThe string to parse
iLengthThe number of QChars used, and 0 if no valid symbols was found in the string
Returns
An integer corresponding to the month

Definition at line 109 of file kcalendarsystem.cpp.

◆ setYMD()

virtual bool KCalendarSystem::setYMD ( TQDate &  date,
int  y,
int  m,
int  d 
) const
pure virtual

Changes the date's year, month and day.

The range of the year, month and day depends on which calendar is being used.

Parameters
dateDate to change
yYear
mMonth number
dDay of month
Returns
true if the date is valid; otherwise returns false.

Implemented in KCalendarSystemJalali.

◆ weekDayName() [1/2]

virtual TQString KCalendarSystem::weekDayName ( const TQDate &  date,
bool  shortName = false 
) const
pure virtual

Gets specific calendar type week day name.

Parameters
datethe date
shortNameshort or complete day name
Returns
day name

Implemented in KCalendarSystemJalali.

◆ weekDayName() [2/2]

TQString KCalendarSystem::weekDayName ( int  weekDay,
bool  shortName = false 
) const
pure virtual

Gets specific calendar type week day name If an invalid week day is specified, TQString::null is returned.

Parameters
weekDaynumber of day in week (1 -> Monday)
shortNameshort or complete day name
Returns
day name

Implemented in KCalendarSystemJalali.

Definition at line 119 of file kcalendarsystem.cpp.

◆ weekDayOfPray()

virtual int KCalendarSystem::weekDayOfPray ( ) const
pure virtual

Gets the day of the week traditionaly associated with pray.

Returns
day number

Implemented in KCalendarSystemJalali.

◆ weekNumber()

virtual int KCalendarSystem::weekNumber ( const TQDate &  date,
int *  yearNum = 0 
) const
pure virtual

Gets specific calendar type week number for a given date.

Parameters
dategregorian date
yearNumThe year the date belongs to
Returns
week number

Implemented in KCalendarSystemJalali.

◆ weeksInYear()

virtual int KCalendarSystem::weeksInYear ( int  year) const
pure virtual

Gets the number of weeks in a specified year.

Parameters
yearthe year
Returns
number of weeks in year

Implemented in KCalendarSystemJalali.

◆ year()

virtual int KCalendarSystem::year ( const TQDate &  date) const
pure virtual

Gets specific calendar type year for a given gregorian date.

Parameters
dategregorian date
Returns
year

Implemented in KCalendarSystemJalali.

◆ yearString()

TQString KCalendarSystem::yearString ( const TQDate &  pDate,
bool  bShort 
) const
virtual

Converts a date into a year literal.

Parameters
pDateThe date to convert
bShortIf the short version of should be used
Returns
The year literal of the date

Definition at line 77 of file kcalendarsystem.cpp.

◆ yearStringToInteger()

int KCalendarSystem::yearStringToInteger ( const TQString &  sNum,
int &  iLength 
) const
virtual

Converts a year literal of a part of a string into a integer starting at the beginning of the string.

Parameters
sNumThe string to parse
iLengthThe number of QChars used, and 0 if no valid symbols was found in the string
Returns
An integer corresponding to the year

Definition at line 114 of file kcalendarsystem.cpp.


The documentation for this class was generated from the following files:
  • kcalendarsystem.h
  • kcalendarsystem.cpp

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.