interface XCalendar in module com::sun::star::i18n::

(Global Index)

Syntax

interface XCalendar : com::sun::star::uno::XInterface ;

Description

This interface provides access to locale specific calendar systems.

Method Summary

loadDefaultCalendar load the default calendar for the given locale

loadCalendar load a specific calendar for the given locale

getLoadedCalendar get the current loaded Calendar

getAllCalendars returns all available calendars for the given locale

getUniqueID returns the ID string of the loaded calendar, e.g. gregorian

setDateTime Set the 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.

getDateTime Get the 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.

setValue Set the value of a field.

getValue Get the value of a field.

isValid Verify if the date fields set by "setValue()" is valid. It has a side-effect because it will internally calculate the final value for the date fields

addValue Add an amount to a field.

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

setFirstDayOfWeek set the first day of a week, one of Weekdays values

setMinimumNumberOfDaysForFirstWeek set how many days of a week must reside in the first week of a year

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

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

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

getMonths returns a sequence of CalendarItem describing the month names

getDays returns a sequence of CalendarItem describing the day names

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

Known Services Which Export this Interface

com::sun::star::i18n::LocaleCalendar

Method Details



loadDefaultCalendar

Syntax

void loadDefaultCalendar (
com::sun::star::lang::Locale rLocale );

Description

load the default calendar for the given locale


loadCalendar

Syntax

void loadCalendar (
string uniqueID,
com::sun::star::lang::Locale rLocale );

Description

load a specific calendar for the given locale


getLoadedCalendar

Syntax

com::sun::star::i18n::Calendar getLoadedCalendar ();

Description

get the current loaded Calendar


getAllCalendars

Syntax

sequence< string > getAllCalendars (
com::sun::star::lang::Locale rLocale );

Description

returns all available calendars for the given locale


getUniqueID

Syntax

string getUniqueID ();

Description

returns the ID string of the loaded calendar, e.g. gregorian


setDateTime

Syntax

void setDateTime (
double nTimeInDays );

Description

Set the 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.


getDateTime

Syntax

double getDateTime ();

Description

Get the 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.


setValue

Syntax

void setValue (
short nCalendarFieldIndex,
short nValue );

Description

Set the value of a field.

Parameter nCalendarFieldIndex

one of CalendarFieldIndex values

Parameter nValue

a value of the allowed range for the field index

getValue

Syntax

short getValue (
short nCalendarFieldIndex );

Description

Get the value of a field.

Parameter nCalendarFieldIndex

one of CalendarFieldIndex values

isValid

Syntax

boolean isValid ();

Description

Verify if the date fields set by "setValue()" is valid. It has a side-effect because it will internally calculate the final value for the date fields


addValue

Syntax

void addValue (
short nCalendarFieldIndex,
long nAmount );

Description

Add an amount to a field.

Parameter nCalendarFieldIndex

one of CalendarFieldIndex values

Parameter nAmount

the amount to add

getFirstDayOfWeek

Syntax

short getFirstDayOfWeek ();

Description

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


setFirstDayOfWeek

Syntax

void setFirstDayOfWeek (
short nDay );

Description

set the first day of a week, one of Weekdays values


setMinimumNumberOfDaysForFirstWeek

Syntax

void setMinimumNumberOfDaysForFirstWeek (
short nDays );

Description

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


getMinimumNumberOfDaysForFirstWeek

Syntax

short getMinimumNumberOfDaysForFirstWeek ();

Description

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


getNumberOfMonthsInYear

Syntax

short getNumberOfMonthsInYear ();

Description

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


getNumberOfDaysInWeek

Syntax

short getNumberOfDaysInWeek ();

Description

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


getMonths

Syntax

sequence< com::sun::star::i18n::CalendarItem > getMonths ();

Description

returns a sequence of CalendarItem describing the month names


getDays

Syntax

sequence< com::sun::star::i18n::CalendarItem > getDays ();

Description

returns a sequence of CalendarItem describing the day names


getDisplayName

Syntax

string getDisplayName (
short nCalendarDisplayIndex,
short nIdx,
short nNameType );

Description

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

Parameter nCalendarDisplayIndex

one of CalendarDisplayIndex values

Parameter nIdx

A value matching the CalendarDisplayIndex type: AM_PM => one of AmPmValue DAY => one of Weekdays MONTH => one of Months YEAR => not used, empty string returned ERA => one of ??? The value should be obtained by a previous call to XCalendar::getValue() with an appropriate CalendarFieldIndex argument.

Parameter nNameType

0 => abbreviated name, e.g., Jan 1 => full name, e.g., January This parameter is not used if the nCalendarDisplayIndex argument equals CalendarDisplayIndex::AM_PM
Top of Page