digiKam
DigikamGenericCalendarPlugin::CalSystem Class Reference

Public Types

enum  CalendarSystem {
  DefaultCalendar = 0 , GregorianCalendar = 1 , ChineseCalendar = 2 , CopticCalendar = 3 ,
  EthiopicCalendar = 4 , EthiopicAmeteAlemCalendar = 5 , HebrewCalendar = 6 , IndianNationalCalendar = 7 ,
  IslamicCalendar = 8 , IslamicCivilCalendar = 9 , ISO8601Calendar = 10 , JapaneseCalendar = 11 ,
  JulianCalendar = 12 , PersianCalendar = 13 , ROCCalendar = 14 , ThaiCalendar = 15 ,
  LastCalendar = ThaiCalendar
}
 

Public Member Functions

QDate addDays (const QDate &date, int days) const
 
QDate addMonths (const QDate &date, int months) const
 
QDate addYears (const QDate &date, int years) const
 
CalSystem::CalendarSystem calendarSystem () const
 
 CalSystem (CalSystem::CalendarSystem calendar=CalSystem::DefaultCalendar)
 
QDate date (int year, int dayOfYear) const
 
QDate date (int year, int month, int day) const
 
bool dateDifference (const QDate &fromDate, const QDate &toDate, int *years, int *months, int *days, int *direction) const
 
int day (const QDate &date) const
 
int dayOfWeek (const QDate &date) const
 
int dayOfWeek (int year, int month, int day) const
 
int dayOfYear (const QDate &date) const
 
int dayOfYear (int year, int month, int day) const
 
qint64 daysDifference (const QDate &fromDate, const QDate &toDate) const
 
int daysInMonth (const QDate &date) const
 
int daysInMonth (int year, int month) const
 
int daysInWeek () const
 
int daysInYear (const QDate &date) const
 
int daysInYear (int year) const
 
QDate earliestValidDate () const
 
QDate epoch () const
 
QDate firstDayOfMonth (const QDate &date) const
 
QDate firstDayOfMonth (int year, int month) const
 
QDate firstDayOfYear (const QDate &date) const
 
QDate firstDayOfYear (int year) const
 
void getDate (const QDate &date, int *year, int *month, int *day) const
 
bool isLeapYear (const QDate &date) const
 
bool isLeapYear (int year) const
 
bool isValid (const QDate &date) const
 
bool isValid (int year, int dayOfYear) const
 
bool isValid (int year, int month, int day) const
 
QDate lastDayOfMonth (const QDate &date) const
 
QDate lastDayOfMonth (int year, int month) const
 
QDate lastDayOfYear (const QDate &date) const
 
QDate lastDayOfYear (int year) const
 
QDate latestValidDate () const
 
int maximumDaysInMonth () const
 
int maximumDaysInYear () const
 
int maximumMonthsInYear () const
 
int month (const QDate &date) const
 
int monthsDifference (const QDate &fromDate, const QDate &toDate) const
 
int monthsInYear (const QDate &date) const
 
int monthsInYear (int year) const
 
CalSystemoperator= (const CalSystem &other)
 
int quarter (const QDate &date) const
 
int quarter (int year, int month, int day) const
 
int weekNumber (const QDate &date, int *yearNum=nullptr) const
 
int weekNumber (int year, int month, int day, int *yearNum=nullptr) const
 
int weeksInYear (const QDate &date) const
 
int weeksInYear (int year) const
 
int year (const QDate &date) const
 
int yearsDifference (const QDate &fromDate, const QDate &toDate) const
 
 ~CalSystem ()
 

Member Enumeration Documentation

◆ CalendarSystem

Enumerator
DefaultCalendar 
GregorianCalendar 
ChineseCalendar 
CopticCalendar 
EthiopicCalendar 
EthiopicAmeteAlemCalendar 
HebrewCalendar 
IndianNationalCalendar 
IslamicCalendar 
IslamicCivilCalendar 
ISO8601Calendar 
JapaneseCalendar 
JulianCalendar 
PersianCalendar 
ROCCalendar 
ThaiCalendar 
LastCalendar 

Constructor & Destructor Documentation

◆ CalSystem()

DigikamGenericCalendarPlugin::CalSystem::CalSystem ( CalSystem::CalendarSystem  calendar = CalSystem::DefaultCalendar)
explicit

◆ ~CalSystem()

DigikamGenericCalendarPlugin::CalSystem::~CalSystem ( )

Member Function Documentation

◆ addDays()

QDate DigikamGenericCalendarPlugin::CalSystem::addDays ( const QDate &  date,
int  days 
) const

References date().

Referenced by weeksInYear().

◆ addMonths()

QDate DigikamGenericCalendarPlugin::CalSystem::addMonths ( const QDate &  date,
int  months 
) const

References date(), day(), isValid(), month(), and year().

Referenced by dateDifference().

◆ addYears()

QDate DigikamGenericCalendarPlugin::CalSystem::addYears ( const QDate &  date,
int  years 
) const

References date(), day(), isValid(), month(), and year().

◆ calendarSystem()

CalSystem::CalendarSystem DigikamGenericCalendarPlugin::CalSystem::calendarSystem ( ) const

◆ date() [1/2]

QDate DigikamGenericCalendarPlugin::CalSystem::date ( int  year,
int  dayOfYear 
) const

References dayOfYear(), isValid(), and year().

◆ date() [2/2]

◆ dateDifference()

bool DigikamGenericCalendarPlugin::CalSystem::dateDifference ( const QDate &  fromDate,
const QDate &  toDate,
int *  years,
int *  months,
int *  days,
int *  direction 
) const

Caters for Leap Months, but possibly not for Hebrew

References addMonths(), daysInMonth(), isValid(), month(), and yearsDifference().

◆ day()

int DigikamGenericCalendarPlugin::CalSystem::day ( const QDate &  date) const

◆ dayOfWeek() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::dayOfWeek ( const QDate &  date) const

References date(), daysInWeek(), and isValid().

Referenced by dayOfWeek(), and weekNumber().

◆ dayOfWeek() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::dayOfWeek ( int  year,
int  month,
int  day 
) const

References date(), day(), dayOfWeek(), month(), and year().

◆ dayOfYear() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::dayOfYear ( const QDate &  date) const

References date(), firstDayOfYear(), and isValid().

Referenced by date(), dayOfYear(), isValid(), and weekNumber().

◆ dayOfYear() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::dayOfYear ( int  year,
int  month,
int  day 
) const

References date(), day(), dayOfYear(), month(), and year().

◆ daysDifference()

qint64 DigikamGenericCalendarPlugin::CalSystem::daysDifference ( const QDate &  fromDate,
const QDate &  toDate 
) const

References isValid().

◆ daysInMonth() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::daysInMonth ( const QDate &  date) const

◆ daysInMonth() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::daysInMonth ( int  year,
int  month 
) const

References month(), and year().

◆ daysInWeek()

int DigikamGenericCalendarPlugin::CalSystem::daysInWeek ( ) const

Referenced by dayOfWeek().

◆ daysInYear() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::daysInYear ( const QDate &  date) const

References date(), isValid(), and year().

Referenced by isValid().

◆ daysInYear() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::daysInYear ( int  year) const

References year().

◆ earliestValidDate()

QDate DigikamGenericCalendarPlugin::CalSystem::earliestValidDate ( ) const

Referenced by isValid().

◆ epoch()

QDate DigikamGenericCalendarPlugin::CalSystem::epoch ( ) const

◆ firstDayOfMonth() [1/2]

QDate DigikamGenericCalendarPlugin::CalSystem::firstDayOfMonth ( const QDate &  date) const

References date(), getDate(), month(), and year().

◆ firstDayOfMonth() [2/2]

QDate DigikamGenericCalendarPlugin::CalSystem::firstDayOfMonth ( int  year,
int  month 
) const

References date(), month(), and year().

◆ firstDayOfYear() [1/2]

QDate DigikamGenericCalendarPlugin::CalSystem::firstDayOfYear ( const QDate &  date) const

References date(), isValid(), and year().

Referenced by dayOfYear().

◆ firstDayOfYear() [2/2]

QDate DigikamGenericCalendarPlugin::CalSystem::firstDayOfYear ( int  year) const

References date(), and year().

◆ getDate()

void DigikamGenericCalendarPlugin::CalSystem::getDate ( const QDate &  date,
int *  year,
int *  month,
int *  day 
) const

References date(), day(), isValid(), month(), and year().

Referenced by firstDayOfMonth(), and lastDayOfMonth().

◆ isLeapYear() [1/2]

bool DigikamGenericCalendarPlugin::CalSystem::isLeapYear ( const QDate &  date) const

References date(), isValid(), and year().

◆ isLeapYear() [2/2]

bool DigikamGenericCalendarPlugin::CalSystem::isLeapYear ( int  year) const

References year().

◆ isValid() [1/3]

◆ isValid() [2/3]

bool DigikamGenericCalendarPlugin::CalSystem::isValid ( int  year,
int  dayOfYear 
) const

References dayOfYear(), daysInYear(), and year().

◆ isValid() [3/3]

bool DigikamGenericCalendarPlugin::CalSystem::isValid ( int  year,
int  month,
int  day 
) const

References day(), daysInMonth(), month(), and year().

◆ lastDayOfMonth() [1/2]

QDate DigikamGenericCalendarPlugin::CalSystem::lastDayOfMonth ( const QDate &  date) const

◆ lastDayOfMonth() [2/2]

QDate DigikamGenericCalendarPlugin::CalSystem::lastDayOfMonth ( int  year,
int  month 
) const

References date(), daysInMonth(), month(), and year().

◆ lastDayOfYear() [1/2]

QDate DigikamGenericCalendarPlugin::CalSystem::lastDayOfYear ( const QDate &  date) const

References date(), isValid(), and year().

Referenced by weeksInYear().

◆ lastDayOfYear() [2/2]

QDate DigikamGenericCalendarPlugin::CalSystem::lastDayOfYear ( int  year) const

References date(), and year().

◆ latestValidDate()

QDate DigikamGenericCalendarPlugin::CalSystem::latestValidDate ( ) const

Referenced by isValid().

◆ maximumDaysInMonth()

int DigikamGenericCalendarPlugin::CalSystem::maximumDaysInMonth ( ) const

◆ maximumDaysInYear()

int DigikamGenericCalendarPlugin::CalSystem::maximumDaysInYear ( ) const

◆ maximumMonthsInYear()

int DigikamGenericCalendarPlugin::CalSystem::maximumMonthsInYear ( ) const

◆ month()

int DigikamGenericCalendarPlugin::CalSystem::month ( const QDate &  date) const

◆ monthsDifference()

int DigikamGenericCalendarPlugin::CalSystem::monthsDifference ( const QDate &  fromDate,
const QDate &  toDate 
) const

Caters for Leap Months, but possibly not for Hebrew

References isValid(), and monthsInYear().

◆ monthsInYear() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::monthsInYear ( const QDate &  date) const

◆ monthsInYear() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::monthsInYear ( int  year) const

References year().

◆ operator=()

CalSystem & DigikamGenericCalendarPlugin::CalSystem::operator= ( const CalSystem other)

◆ quarter() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::quarter ( const QDate &  date) const

References date(), isValid(), and month().

◆ quarter() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::quarter ( int  year,
int  month,
int  day 
) const

References day(), isValid(), month(), and year().

◆ weekNumber() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::weekNumber ( const QDate &  date,
int *  yearNum = nullptr 
) const

References date(), day(), isValid(), month(), and year().

Referenced by weeksInYear().

◆ weekNumber() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::weekNumber ( int  year,
int  month,
int  day,
int *  yearNum = nullptr 
) const

TODO: These are ISO weeks, may need to localise

References day(), dayOfWeek(), dayOfYear(), isValid(), month(), and year().

◆ weeksInYear() [1/2]

int DigikamGenericCalendarPlugin::CalSystem::weeksInYear ( const QDate &  date) const

References date(), isValid(), and year().

◆ weeksInYear() [2/2]

int DigikamGenericCalendarPlugin::CalSystem::weeksInYear ( int  year) const

TODO: This is ISO weeks, may need to localise

References addDays(), lastDayOfYear(), weekNumber(), and year().

◆ year()

◆ yearsDifference()

int DigikamGenericCalendarPlugin::CalSystem::yearsDifference ( const QDate &  fromDate,
const QDate &  toDate 
) const

Caters for Leap Months, but possibly not for Hebrew

References isValid().

Referenced by dateDifference().


The documentation for this class was generated from the following files: