LibreOffice: XCalendar Interface Reference

LibreOffice LibreOffice 25.8 SDK API Reference

Loading...
Searching...
No Matches
XCalendar Interface Referencepublished

Access to locale specific calendar systems. More...

`import "XCalendar.idl";`

Inheritance diagram for XCalendar:

## Public Member Functions
void | loadDefaultCalendar ([in] ::com::sun::star::lang::Locale rLocale)
| Load the default calendar for the given locale.
void | loadCalendar ([in] string uniqueID, [in] ::com::sun::star::lang::Locale rLocale)
| Load a specific calendar for the given locale.
Calendar | getLoadedCalendar ()
| Get the currently loaded Calendar.
sequence< string > | getAllCalendars ([in] ::com::sun::star::lang::Locale rLocale)
| Returns all available calendars for the given locale.
string | getUniqueID ()
| Returns the ID string of the loaded calendar, for example, "Gregorian".
void | setDateTime ([in] double nTimeInDays)
| Set the UTC date/time as an offset to the start of the calendar at 1-Jan-1970 00:00.
double | getDateTime ()
| Get the UTC date/time as an offset to the start of the calendar at 1-Jan-1970 00:00.
void | setValue ([in] short nCalendarFieldIndex, [in] short nValue)
| Set the value of a field.
short | getValue ([in] short nCalendarFieldIndex)
| Get the value of a field.
boolean | isValid ()
| Verify if the date fields set by a combination of XCalendar::setValue() calls is valid.
void | addValue ([in] short nCalendarFieldIndex, [in] long nAmount)
| Add an amount to a field.
short | getFirstDayOfWeek ()
| returns the first day of a week, one of Weekdays values.
void | setFirstDayOfWeek ([in] short nDay)
| Set the first day of a week, one of Weekdays values.
void | setMinimumNumberOfDaysForFirstWeek ([in] short nDays)
| Set how many days of a week must reside in the first week of a year.
short | getMinimumNumberOfDaysForFirstWeek ()
| returns how many days of a week must reside in the first week of a year.
short | getNumberOfMonthsInYear ()
| returns the number of months in a year, e.g. 12
short | getNumberOfDaysInWeek ()
| returns the number of days in a week, e.g. 7
sequence< CalendarItem > | getMonths ()
| returns a sequence of CalendarItem describing the month names.
sequence< CalendarItem > | getDays ()
| returns a sequence of CalendarItem describing the day names.
string | getDisplayName ([in] short nCalendarDisplayIndex, [in] short nIdx, [in] short nNameType)
| Returns a string (name to display) matching the given parameters.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

Access to locale specific calendar systems.

Developers Guide
  Office Development - Implementing a New Locale - XCalendar
  Office Development - Overview and Using the API - XCalendar

## Member Function Documentation

## ◆ addValue()

void addValue | ( | [in] short | nCalendarFieldIndex,
|  | [in] long | nAmount )

Add an amount to a field.

Parameters

  nCalendarFieldIndex | One of CalendarFieldIndex values.
  nAmount | The amount to add.

## ◆ getAllCalendars()

sequence< string > getAllCalendars | ( | [in] ::com::sun::star::lang::Locale | rLocale | ) |

Returns all available calendars for the given locale.

## ◆ getDateTime()

double getDateTime | ( |  | ) |

Get the UTC date/time as an offset to the start of the calendar at 1-Jan-1970 00:00.

The integer part represents the number of days passed since start date. The fractional part represents fractions of a day, thus 0.5 means 12 hours.

## ◆ getDays()

sequence< CalendarItem > getDays | ( |  | ) |

returns a sequence of CalendarItem describing the day names.

## ◆ getDisplayName()

string getDisplayName | ( | [in] short | nCalendarDisplayIndex,
|  | [in] short | nIdx,
|  | [in] short | nNameType )

Returns a string (name to display) matching the given parameters.

Parameters

  nCalendarDisplayIndex | One of CalendarDisplayIndex values
  nIdx | A value matching the nCalendarDisplayIndex type: CalendarDisplayIndex::AM_PM one of AmPmValue CalendarDisplayIndex::DAY one of Weekdays or a number used as an offset into the corresponding Calendar::Days sequence CalendarDisplayIndex::MONTH one of Months or a number used as an offset into the corresponding Calendar::Months sequence CalendarDisplayIndex::YEAR not used, empty string returned CalendarDisplayIndex::ERA a number used as an offset into the corresponding Calendar:Eras sequence CalendarDisplayIndex::GENITIVE_MONTH a number used as an offset into the corresponding Calendar2:GenitiveMonth sequence

The value should be obtained by a previous call to XCalendar::getValue() with an appropriate CalendarFieldIndex argument.

Parameters

  nNameType | A value indicating whether to return the abbreviated or the full name, or the narrow name for some CalendarDisplayIndex values. 0 abbreviated name, e.g. "Jan" 1 full name, e.g. "January" 2 narrow name, e.g. "J" Valid only for CalendarDisplayIndex::DAY, CalendarDisplayIndex::MONTH and CalendarDisplayIndex::GENITIVE_MONTH

Since
  LibreOffice 3.5

This parameter is not used if the nCalendarDisplayIndex argument equals CalendarDisplayIndex::AM_PM

## ◆ getFirstDayOfWeek()

short getFirstDayOfWeek | ( |  | ) |

returns the first day of a week, one of Weekdays values.

## ◆ getLoadedCalendar()

Calendar getLoadedCalendar | ( |  | ) |

Get the currently loaded Calendar.

## ◆ getMinimumNumberOfDaysForFirstWeek()

short getMinimumNumberOfDaysForFirstWeek | ( |  | ) |

returns how many days of a week must reside in the first week of a year.

## ◆ getMonths()

sequence< CalendarItem > getMonths | ( |  | ) |

returns a sequence of CalendarItem describing the month names.

## ◆ getNumberOfDaysInWeek()

short getNumberOfDaysInWeek | ( |  | ) |

returns the number of days in a week, e.g. 7

## ◆ getNumberOfMonthsInYear()

short getNumberOfMonthsInYear | ( |  | ) |

returns the number of months in a year, e.g. 12

## ◆ getUniqueID()

string getUniqueID | ( |  | ) |

Returns the ID string of the loaded calendar, for example, "Gregorian".

## ◆ getValue()

short getValue | ( | [in] short | nCalendarFieldIndex | ) |

Get the value of a field.

Parameters

  nCalendarFieldIndex | One of CalendarFieldIndex values.

## ◆ isValid()

boolean isValid | ( |  | ) |

Verify if the date fields set by a combination of XCalendar::setValue() calls is valid.

It has a side-effect because it will internally calculate the final value for the date fields

## ◆ loadCalendar()

void loadCalendar | ( | [in] string | uniqueID,
|  | [in] ::com::sun::star::lang::Locale | rLocale )

Load a specific calendar for the given locale.

## ◆ loadDefaultCalendar()

void loadDefaultCalendar | ( | [in] ::com::sun::star::lang::Locale | rLocale | ) |

Load the default calendar for the given locale.

## ◆ setDateTime()

void setDateTime | ( | [in] double | nTimeInDays | ) |

Set the UTC date/time as an offset to the start of the calendar at 1-Jan-1970 00:00.

The integer part represents the number of days passed since start date. The fractional part represents fractions of a day, thus 0.5 means 12 hours.

## ◆ setFirstDayOfWeek()

void setFirstDayOfWeek | ( | [in] short | nDay | ) |

Set the first day of a week, one of Weekdays values.

## ◆ setMinimumNumberOfDaysForFirstWeek()

void setMinimumNumberOfDaysForFirstWeek | ( | [in] short | nDays | ) |

Set how many days of a week must reside in the first week of a year.

## ◆ setValue()

void setValue | ( | [in] short | nCalendarFieldIndex,
|  | [in] short | nValue )

Set the value of a field.

Parameters

  nCalendarFieldIndex | One of CalendarFieldIndex values.
  nValue | A value of the allowed range for the field index.

The documentation for this interface was generated from the following file:

- com/sun/star/i18n/XCalendar.idl