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 css::uno::Sequence< OUString > SAL_CALL getAllCalendars (const css::lang::Locale &rLocale) 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
 

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 48 of file calendar_gregorian.hxx.

Constructor & Destructor Documentation

i18npool::Calendar_gregorian::Calendar_gregorian ( )

Definition at line 146 of file calendar_gregorian.cxx.

References init().

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

Definition at line 151 of file calendar_gregorian.cxx.

References init().

i18npool::Calendar_gregorian::~Calendar_gregorian ( )
overridevirtual

Destructor.

Definition at line 195 of file calendar_gregorian.cxx.

Member Function Documentation

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 648 of file calendar_gregorian.cxx.

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

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 504 of file calendar_gregorian.cxx.

References fieldSet, and fieldValue.

Referenced by getDSTOffset(), and getZoneOffset().

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 355 of file calendar_gregorian.cxx.

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 800 of file calendar_gregorian.cxx.

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 814 of file calendar_gregorian.cxx.

References aCalendar.

OUString SAL_CALL i18npool::Calendar_gregorian::getDisplayName ( sal_Int16  nCalendarDisplayIndex,
sal_Int16  nIdx,
sal_Int16  nNameType 
)
overridevirtual
OUString SAL_CALL i18npool::Calendar_gregorian::getDisplayString ( sal_Int32  nCalendarDisplayCode,
sal_Int16  nNativeNumberMode 
)
overridevirtual
OUString i18npool::Calendar_gregorian::getDisplayStringImpl ( sal_Int32  nCalendarDisplayCode,
sal_Int16  nNativeNumberMode,
bool  bEraMode 
)
protected
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 531 of file calendar_gregorian.cxx.

References getCombinedOffset().

Referenced by submitFields().

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 756 of file calendar_gregorian.cxx.

References body.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 828 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 1046 of file calendar_gregorian.cxx.

References cCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 323 of file calendar_gregorian.cxx.

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 317 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 387 of file calendar_gregorian.cxx.

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 780 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 807 of file calendar_gregorian.cxx.

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 821 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 793 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 786 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 835 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 1058 of file calendar_gregorian.cxx.

References cCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 329 of file calendar_gregorian.cxx.

References aCalendar.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 634 of file calendar_gregorian.cxx.

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

void i18npool::Calendar_gregorian::getValue ( )
protected
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 525 of file calendar_gregorian.cxx.

References getCombinedOffset().

Referenced by submitFields().

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

Definition at line 157 of file calendar_gregorian.cxx.

References body, cCalendar, eraArray, and fieldSet.

Referenced by Calendar_gregorian().

sal_Bool SAL_CALL i18npool::Calendar_gregorian::isValid ( )
overridevirtual
void SAL_CALL i18npool::Calendar_gregorian::loadCalendar ( const OUString &  uniqueID,
const css::lang::Locale &  rLocale 
)
overridevirtual
void i18npool::Calendar_gregorian::mapFromGregorian ( )
protectedvirtual
Exceptions
css::uno::RuntimeException

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

Definition at line 423 of file calendar_gregorian.cxx.

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

Referenced by getValue().

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

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

Definition at line 453 of file calendar_gregorian.cxx.

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

Referenced by setValue().

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 335 of file calendar_gregorian.cxx.

References body, getValue(), and SAL_INFO_IF.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 766 of file calendar_gregorian.cxx.

References body.

Referenced by loadCalendar().

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 368 of file calendar_gregorian.cxx.

References body, getValue(), and SAL_INFO_IF.

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 773 of file calendar_gregorian.cxx.

References aCalendar, and body.

Referenced by loadCalendar().

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

Definition at line 405 of file calendar_gregorian.cxx.

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

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

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 496 of file calendar_gregorian.cxx.

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

void i18npool::Calendar_gregorian::setValue ( )
private

Set fields internally.

Exceptions
css::uno::RuntimeException

Definition at line 563 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().

void i18npool::Calendar_gregorian::submitFields ( )
private

Submit fieldSetValue array according to fieldSet.

Exceptions
css::uno::RuntimeException

Definition at line 537 of file calendar_gregorian.cxx.

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

Referenced by setValue().

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

Reimplemented from i18npool::CalendarImpl.

Definition at line 1052 of file calendar_gregorian.cxx.

References cppu::supportsService().

Member Data Documentation

css::i18n::Calendar2 i18npool::Calendar_gregorian::aCalendar
private
css::lang::Locale i18npool::Calendar_gregorian::aLocale
protected
std::unique_ptr<icu::Calendar> i18npool::Calendar_gregorian::body
protected
const char* i18npool::Calendar_gregorian::cCalendar
protected
const Era* i18npool::Calendar_gregorian::eraArray
protected
sal_uInt32 i18npool::Calendar_gregorian::fieldSet
protected
sal_Int16 i18npool::Calendar_gregorian::fieldSetValue[FIELD_INDEX_COUNT]
protected
sal_Int16 i18npool::Calendar_gregorian::fieldValue[FIELD_INDEX_COUNT]
protected
rtl::Reference<NativeNumberSupplierService> i18npool::Calendar_gregorian::mxNatNum
protected

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