LibreOffice Module i18npool (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
i18npool::Calendar_gregorian Class Reference

#include <calendar_gregorian.hxx>

Inheritance diagram for i18npool::Calendar_gregorian:
[legend]
Collaboration diagram for i18npool::Calendar_gregorian:
[legend]

Public Member Functions

 Calendar_gregorian ()
 
 Calendar_gregorian (const Era *_eraArray)
 
void init (const Era *_eraArray)
 
bool setTimeZone (const OUString &rTimeZone)
 
virtual ~Calendar_gregorian () override
 Destructor. More...
 
virtual void SAL_CALL loadCalendar (const OUString &uniqueID, const css::lang::Locale &rLocale) override
 
virtual void SAL_CALL setDateTime (double fTimeInDays) override
 
virtual double SAL_CALL getDateTime () override
 
virtual void SAL_CALL setValue (sal_Int16 nFieldIndex, sal_Int16 nValue) override
 
virtual sal_Int16 SAL_CALL getValue (sal_Int16 nFieldIndex) override
 
virtual void SAL_CALL addValue (sal_Int16 nFieldIndex, sal_Int32 nAmount) override
 
virtual sal_Bool SAL_CALL isValid () override
 
virtual css::i18n::Calendar SAL_CALL getLoadedCalendar () override
 
virtual OUString SAL_CALL getUniqueID () override
 
virtual sal_Int16 SAL_CALL getFirstDayOfWeek () override
 
virtual void SAL_CALL setFirstDayOfWeek (sal_Int16 nDay) override
 
virtual void SAL_CALL setMinimumNumberOfDaysForFirstWeek (sal_Int16 nDays) override
 
virtual sal_Int16 SAL_CALL getMinimumNumberOfDaysForFirstWeek () override
 
virtual sal_Int16 SAL_CALL getNumberOfMonthsInYear () override
 
virtual sal_Int16 SAL_CALL getNumberOfDaysInWeek () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem > SAL_CALL getMonths () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem > SAL_CALL getDays () override
 
virtual OUString SAL_CALL getDisplayName (sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) override
 
virtual OUString SAL_CALL getDisplayString (sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode) override
 
virtual css::i18n::Calendar2 SAL_CALL getLoadedCalendar2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getDays2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getMonths2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getGenitiveMonths2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getPartitiveMonths2 () override
 
virtual void SAL_CALL setLocalDateTime (double TimeInDays) override
 
virtual double SAL_CALL getLocalDateTime () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
- Public Member Functions inherited from i18npool::CalendarImpl
 CalendarImpl ()
 
 CalendarImpl (const css::uno::Reference< css::uno::XComponentContext > &rxContext)
 
virtual ~CalendarImpl () override
 Destructor. More...
 
virtual void SAL_CALL loadDefaultCalendar (const css::lang::Locale &rLocale) override
 
virtual void SAL_CALL loadCalendar (const OUString &uniqueID, const css::lang::Locale &rLocale) override
 
virtual css::i18n::Calendar SAL_CALL getLoadedCalendar () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getAllCalendars (const css::lang::Locale &rLocale) override
 
virtual OUString SAL_CALL getUniqueID () override
 
virtual void SAL_CALL setDateTime (double fTimeInDays) override
 
virtual double SAL_CALL getDateTime () override
 
virtual void SAL_CALL setValue (sal_Int16 nFieldIndex, sal_Int16 nValue) override
 
virtual sal_Int16 SAL_CALL getValue (sal_Int16 nFieldIndex) override
 
virtual sal_Bool SAL_CALL isValid () override
 
virtual void SAL_CALL addValue (sal_Int16 nFieldIndex, sal_Int32 nAmount) override
 
virtual sal_Int16 SAL_CALL getFirstDayOfWeek () override
 
virtual void SAL_CALL setFirstDayOfWeek (sal_Int16 nDay) override
 
virtual void SAL_CALL setMinimumNumberOfDaysForFirstWeek (sal_Int16 nDays) override
 
virtual sal_Int16 SAL_CALL getMinimumNumberOfDaysForFirstWeek () override
 
virtual sal_Int16 SAL_CALL getNumberOfMonthsInYear () override
 
virtual sal_Int16 SAL_CALL getNumberOfDaysInWeek () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem > SAL_CALL getMonths () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem > SAL_CALL getDays () override
 
virtual OUString SAL_CALL getDisplayName (sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) override
 
virtual OUString SAL_CALL getDisplayString (sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode) override
 
virtual css::i18n::Calendar2 SAL_CALL getLoadedCalendar2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getDays2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getMonths2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getGenitiveMonths2 () override
 
virtual css::uno::Sequence< css::i18n::CalendarItem2 > SAL_CALL getPartitiveMonths2 () override
 
virtual void SAL_CALL setLocalDateTime (double TimeInDays) override
 
virtual double SAL_CALL getLocalDateTime () override
 
virtual void SAL_CALL loadDefaultCalendarTZ (const css::lang::Locale &rLocale, const OUString &rTimeZone) override
 
virtual void SAL_CALL loadCalendarTZ (const OUString &uniqueID, const css::lang::Locale &rLocale, const OUString &rTimeZone) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Protected Member Functions

virtual void mapToGregorian ()
 
virtual void mapFromGregorian ()
 
void getValue ()
 
OUString getDisplayStringImpl (sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode, bool bEraMode)
 

Protected Attributes

const EraeraArray
 
std::unique_ptr< icu::Calendar > body
 
rtl::Reference< NativeNumberSupplierServicemxNatNum
 
const char * cCalendar
 
css::lang::Locale aLocale
 
sal_uInt32 fieldSet
 
sal_Int16 fieldValue [FIELD_INDEX_COUNT]
 
sal_Int16 fieldSetValue [FIELD_INDEX_COUNT]
 

Private Member Functions

void submitFields ()
 Submit fieldSetValue array according to fieldSet. More...
 
void setValue ()
 Set fields internally. More...
 
bool getZoneOffset (sal_Int32 &o_nOffset) const
 Obtain combined field values for timezone offset (minutes+secondmillis) in milliseconds and whether fields were set. More...
 
bool getDSTOffset (sal_Int32 &o_nOffset) const
 Obtain combined field values for DST offset (minutes+secondmillis) in milliseconds and whether fields were set. More...
 
bool getCombinedOffset (sal_Int32 &o_nOffset, sal_Int16 nParentFieldIndex, sal_Int16 nChildFieldIndex) const
 Used by getZoneOffset() and getDSTOffset(). More...
 

Private Attributes

css::i18n::Calendar2 aCalendar
 

Detailed Description

Definition at line 47 of file calendar_gregorian.hxx.

Constructor & Destructor Documentation

◆ Calendar_gregorian() [1/2]

i18npool::Calendar_gregorian::Calendar_gregorian ( )

Definition at line 147 of file calendar_gregorian.cxx.

References init().

◆ Calendar_gregorian() [2/2]

i18npool::Calendar_gregorian::Calendar_gregorian ( const Era _eraArray)

Definition at line 152 of file calendar_gregorian.cxx.

References init().

◆ ~Calendar_gregorian()

i18npool::Calendar_gregorian::~Calendar_gregorian ( )
overridevirtual

Destructor.

Definition at line 196 of file calendar_gregorian.cxx.

Member Function Documentation

◆ addValue()

void SAL_CALL i18npool::Calendar_gregorian::addValue ( sal_Int16  nFieldIndex,
sal_Int32  nAmount 
)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 650 of file calendar_gregorian.cxx.

References body, i18npool::fieldNameConverter(), getValue(), and value.

◆ getCombinedOffset()

bool i18npool::Calendar_gregorian::getCombinedOffset ( sal_Int32 &  o_nOffset,
sal_Int16  nParentFieldIndex,
sal_Int16  nChildFieldIndex 
) const
private

Used by getZoneOffset() and getDSTOffset().

Parent is CalendarFieldIndex for offset in minutes, child is CalendarFieldIndex for offset in milliseconds.

Definition at line 506 of file calendar_gregorian.cxx.

References fieldSet, and fieldValue.

Referenced by getDSTOffset(), and getZoneOffset().

◆ getDateTime()

double SAL_CALL i18npool::Calendar_gregorian::getDateTime ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 356 of file calendar_gregorian.cxx.

References body, fieldSet, getValue(), and setValue().

◆ getDays()

Sequence< CalendarItem > SAL_CALL i18npool::Calendar_gregorian::getDays ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 802 of file calendar_gregorian.cxx.

References aCalendar, and i18npool::LocaleDataImpl::downcastCalendarItems().

◆ getDays2()

Sequence< CalendarItem2 > SAL_CALL i18npool::Calendar_gregorian::getDays2 ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 816 of file calendar_gregorian.cxx.

References aCalendar.

◆ getDisplayName()

OUString SAL_CALL i18npool::Calendar_gregorian::getDisplayName ( sal_Int16  nCalendarDisplayIndex,
sal_Int16  nIdx,
sal_Int16  nNameType 
)
overridevirtual

◆ getDisplayString()

OUString SAL_CALL i18npool::Calendar_gregorian::getDisplayString ( sal_Int32  nCalendarDisplayCode,
sal_Int16  nNativeNumberMode 
)
overridevirtual

◆ getDisplayStringImpl()

OUString i18npool::Calendar_gregorian::getDisplayStringImpl ( sal_Int32  nCalendarDisplayCode,
sal_Int16  nNativeNumberMode,
bool  bEraMode 
)
protected

◆ getDSTOffset()

bool i18npool::Calendar_gregorian::getDSTOffset ( sal_Int32 &  o_nOffset) const
private

Obtain combined field values for DST offset (minutes+secondmillis) in milliseconds and whether fields were set.

Definition at line 533 of file calendar_gregorian.cxx.

References getCombinedOffset().

Referenced by submitFields().

◆ getFirstDayOfWeek()

sal_Int16 SAL_CALL i18npool::Calendar_gregorian::getFirstDayOfWeek ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 758 of file calendar_gregorian.cxx.

References body.

◆ getGenitiveMonths2()

Sequence< CalendarItem2 > SAL_CALL i18npool::Calendar_gregorian::getGenitiveMonths2 ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 830 of file calendar_gregorian.cxx.

References aCalendar.

◆ getImplementationName()

OUString SAL_CALL i18npool::Calendar_gregorian::getImplementationName ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 1062 of file calendar_gregorian.cxx.

References cCalendar.

◆ getLoadedCalendar()

css::i18n::Calendar SAL_CALL i18npool::Calendar_gregorian::getLoadedCalendar ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 324 of file calendar_gregorian.cxx.

References aCalendar, and i18npool::LocaleDataImpl::downcastCalendar().

◆ getLoadedCalendar2()

css::i18n::Calendar2 SAL_CALL i18npool::Calendar_gregorian::getLoadedCalendar2 ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 318 of file calendar_gregorian.cxx.

References aCalendar.

◆ getLocalDateTime()

double SAL_CALL i18npool::Calendar_gregorian::getLocalDateTime ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 388 of file calendar_gregorian.cxx.

References body, fieldSet, getValue(), and setValue().

◆ getMinimumNumberOfDaysForFirstWeek()

sal_Int16 SAL_CALL i18npool::Calendar_gregorian::getMinimumNumberOfDaysForFirstWeek ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 782 of file calendar_gregorian.cxx.

References aCalendar.

◆ getMonths()

Sequence< CalendarItem > SAL_CALL i18npool::Calendar_gregorian::getMonths ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 809 of file calendar_gregorian.cxx.

References aCalendar, and i18npool::LocaleDataImpl::downcastCalendarItems().

◆ getMonths2()

Sequence< CalendarItem2 > SAL_CALL i18npool::Calendar_gregorian::getMonths2 ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 823 of file calendar_gregorian.cxx.

References aCalendar.

◆ getNumberOfDaysInWeek()

sal_Int16 SAL_CALL i18npool::Calendar_gregorian::getNumberOfDaysInWeek ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 795 of file calendar_gregorian.cxx.

References aCalendar.

◆ getNumberOfMonthsInYear()

sal_Int16 SAL_CALL i18npool::Calendar_gregorian::getNumberOfMonthsInYear ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 788 of file calendar_gregorian.cxx.

References aCalendar.

◆ getPartitiveMonths2()

Sequence< CalendarItem2 > SAL_CALL i18npool::Calendar_gregorian::getPartitiveMonths2 ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 837 of file calendar_gregorian.cxx.

References aCalendar.

◆ getSupportedServiceNames()

Sequence< OUString > SAL_CALL i18npool::Calendar_gregorian::getSupportedServiceNames ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 1074 of file calendar_gregorian.cxx.

References cCalendar.

◆ getUniqueID()

OUString SAL_CALL i18npool::Calendar_gregorian::getUniqueID ( )
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 330 of file calendar_gregorian.cxx.

References aCalendar.

◆ getValue() [1/2]

void i18npool::Calendar_gregorian::getValue ( )
protected

◆ getValue() [2/2]

sal_Int16 SAL_CALL i18npool::Calendar_gregorian::getValue ( sal_Int16  nFieldIndex)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 636 of file calendar_gregorian.cxx.

References i18npool::FIELD_INDEX_COUNT, fieldSet, fieldValue, getValue(), and setValue().

◆ getZoneOffset()

bool i18npool::Calendar_gregorian::getZoneOffset ( sal_Int32 &  o_nOffset) const
private

Obtain combined field values for timezone offset (minutes+secondmillis) in milliseconds and whether fields were set.

Definition at line 527 of file calendar_gregorian.cxx.

References getCombinedOffset().

Referenced by submitFields().

◆ init()

void i18npool::Calendar_gregorian::init ( const Era _eraArray)

Definition at line 158 of file calendar_gregorian.cxx.

References body, cCalendar, eraArray, and fieldSet.

Referenced by Calendar_gregorian().

◆ isValid()

sal_Bool SAL_CALL i18npool::Calendar_gregorian::isValid ( )
overridevirtual

◆ loadCalendar()

void SAL_CALL i18npool::Calendar_gregorian::loadCalendar ( const OUString &  uniqueID,
const css::lang::Locale &  rLocale 
)
overridevirtual

◆ mapFromGregorian()

void i18npool::Calendar_gregorian::mapFromGregorian ( )
protectedvirtual
Exceptions
css::uno::RuntimeException

Reimplemented in i18npool::Calendar_hijri, and i18npool::Calendar_jewish.

Definition at line 424 of file calendar_gregorian.cxx.

References i18npool::cast16To32(), i18npool::cast32To16(), d, day, eraArray, fieldValue, m, month, y, i18npool::Era::year, and year.

Referenced by getValue().

◆ mapToGregorian()

void i18npool::Calendar_gregorian::mapToGregorian ( )
protectedvirtual
Exceptions
css::uno::RuntimeException

Reimplemented in i18npool::Calendar_hijri, and i18npool::Calendar_jewish.

Definition at line 454 of file calendar_gregorian.cxx.

References i18npool::cast16To32(), i18npool::cast32To16(), eraArray, FIELDS, fieldSet, fieldSetValue, fieldValue, y, and i18npool::Era::year.

Referenced by setValue().

◆ setDateTime()

void SAL_CALL i18npool::Calendar_gregorian::setDateTime ( double  fTimeInDays)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 336 of file calendar_gregorian.cxx.

References body, getValue(), and SAL_INFO_IF.

◆ setFirstDayOfWeek()

void SAL_CALL i18npool::Calendar_gregorian::setFirstDayOfWeek ( sal_Int16  nDay)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 768 of file calendar_gregorian.cxx.

References body, and day.

Referenced by loadCalendar().

◆ setLocalDateTime()

void SAL_CALL i18npool::Calendar_gregorian::setLocalDateTime ( double  TimeInDays)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 369 of file calendar_gregorian.cxx.

References body, getValue(), and SAL_INFO_IF.

◆ setMinimumNumberOfDaysForFirstWeek()

void SAL_CALL i18npool::Calendar_gregorian::setMinimumNumberOfDaysForFirstWeek ( sal_Int16  nDays)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 775 of file calendar_gregorian.cxx.

References aCalendar, and body.

Referenced by loadCalendar().

◆ setTimeZone()

bool i18npool::Calendar_gregorian::setTimeZone ( const OUString &  rTimeZone)

Definition at line 406 of file calendar_gregorian.cxx.

References body, fieldSet, getValue(), and setValue().

Referenced by i18npool::CalendarImpl::loadCalendarTZ().

◆ setValue() [1/2]

void i18npool::Calendar_gregorian::setValue ( )
private

Set fields internally.

Exceptions
css::uno::RuntimeException

Definition at line 565 of file calendar_gregorian.cxx.

References body, DUMP_I18N_CAL_MSG, DUMP_ICU_CAL_MSG, fieldSetValue, fieldValue, mapToGregorian(), and submitFields().

Referenced by getDateTime(), getLocalDateTime(), getValue(), isValid(), and setTimeZone().

◆ setValue() [2/2]

void SAL_CALL i18npool::Calendar_gregorian::setValue ( sal_Int16  nFieldIndex,
sal_Int16  nValue 
)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 498 of file calendar_gregorian.cxx.

References i18npool::FIELD_INDEX_COUNT, fieldSet, fieldValue, and value.

◆ submitFields()

void i18npool::Calendar_gregorian::submitFields ( )
private

Submit fieldSetValue array according to fieldSet.

Exceptions
css::uno::RuntimeException

Definition at line 539 of file calendar_gregorian.cxx.

References body, i18npool::FIELD_INDEX_COUNT, i18npool::fieldNameConverter(), fieldSet, fieldSetValue, getDSTOffset(), and getZoneOffset().

Referenced by setValue().

◆ supportsService()

sal_Bool SAL_CALL i18npool::Calendar_gregorian::supportsService ( const OUString &  ServiceName)
overridevirtual

Reimplemented from i18npool::CalendarImpl.

Definition at line 1068 of file calendar_gregorian.cxx.

References cppu::supportsService().

Member Data Documentation

◆ aCalendar

css::i18n::Calendar2 i18npool::Calendar_gregorian::aCalendar
private

◆ aLocale

css::lang::Locale i18npool::Calendar_gregorian::aLocale
protected

◆ body

std::unique_ptr<icu::Calendar> i18npool::Calendar_gregorian::body
protected

◆ cCalendar

const char* i18npool::Calendar_gregorian::cCalendar
protected

◆ eraArray

const Era* i18npool::Calendar_gregorian::eraArray
protected

◆ fieldSet

sal_uInt32 i18npool::Calendar_gregorian::fieldSet
protected

◆ fieldSetValue

sal_Int16 i18npool::Calendar_gregorian::fieldSetValue[FIELD_INDEX_COUNT]
protected

◆ fieldValue

sal_Int16 i18npool::Calendar_gregorian::fieldValue[FIELD_INDEX_COUNT]
protected

◆ mxNatNum

rtl::Reference<NativeNumberSupplierService> i18npool::Calendar_gregorian::mxNatNum
protected

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