LibreOffice Module unotools (master) 1
|
#include <calendarwrapper.hxx>
Public Member Functions | |
CalendarWrapper (const css::uno::Reference< css::uno::XComponentContext > &rxContext) | |
~CalendarWrapper () | |
void | loadDefaultCalendar (const css::lang::Locale &rLocale, bool bTimeZoneUTC=true) |
Load the default calendar of a locale. More... | |
void | loadCalendar (const OUString &rUniqueID, const css::lang::Locale &rLocale, bool bTimeZoneUTC=true) |
This adds a bTimeZoneUTC parameter which is not part of the API. More... | |
css::uno::Sequence< OUString > | getAllCalendars (const css::lang::Locale &rLocale) const |
OUString | getUniqueID () const |
void | setDateTime (double fTimeInDays) |
set UTC date/time More... | |
double | getDateTime () const |
get UTC date/time More... | |
void | setValue (sal_Int16 nFieldIndex, sal_Int16 nValue) |
bool | isValid () const |
sal_Int16 | getValue (sal_Int16 nFieldIndex) const |
sal_Int16 | getFirstDayOfWeek () const |
sal_Int16 | getNumberOfMonthsInYear () const |
sal_Int16 | getNumberOfDaysInWeek () const |
OUString | getDisplayName (sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType) const |
OUString | getDisplayString (sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode) const |
css::i18n::Calendar2 | getLoadedCalendar () const |
css::uno::Sequence< css::i18n::CalendarItem2 > | getDays () const |
css::uno::Sequence< css::i18n::CalendarItem2 > | getMonths () const |
css::uno::Sequence< css::i18n::CalendarItem2 > | getGenitiveMonths () const |
css::uno::Sequence< css::i18n::CalendarItem2 > | getPartitiveMonths () const |
void | setLocalDateTime (double fTimeInDays) |
set local date/time More... | |
double | getLocalDateTime () const |
get local date/time More... | |
const DateTime & | getEpochStart () const |
get epoch start (should be 01Jan1970) More... | |
void | setGregorianDateTime (const DateTime &rDateTime) |
set a local (!) Gregorian DateTime More... | |
Private Attributes | |
css::uno::Reference< css::i18n::XCalendar4 > | xC |
const DateTime | aEpochStart |
Definition at line 33 of file calendarwrapper.hxx.
CalendarWrapper::CalendarWrapper | ( | const css::uno::Reference< css::uno::XComponentContext > & | rxContext | ) |
Definition at line 30 of file calendarwrapper.cxx.
References xC.
CalendarWrapper::~CalendarWrapper | ( | ) |
Definition at line 39 of file calendarwrapper.cxx.
css::uno::Sequence< OUString > CalendarWrapper::getAllCalendars | ( | const css::lang::Locale & | rLocale | ) | const |
Definition at line 70 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
double CalendarWrapper::getDateTime | ( | ) | const |
get UTC date/time
Definition at line 112 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getDays | ( | ) | const |
Definition at line 254 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
OUString CalendarWrapper::getDisplayName | ( | sal_Int16 | nCalendarDisplayIndex, |
sal_Int16 | nIdx, | ||
sal_Int16 | nNameType | ||
) | const |
Definition at line 268 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
OUString CalendarWrapper::getDisplayString | ( | sal_Int32 | nCalendarDisplayCode, |
sal_Int16 | nNativeNumberMode | ||
) | const |
Definition at line 284 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
|
inline |
get epoch start (should be 01Jan1970)
Definition at line 113 of file calendarwrapper.hxx.
sal_Int16 CalendarWrapper::getFirstDayOfWeek | ( | ) | const |
Definition at line 198 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getGenitiveMonths | ( | ) | const |
Definition at line 314 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
css::i18n::Calendar2 CalendarWrapper::getLoadedCalendar | ( | ) | const |
Definition at line 300 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
double CalendarWrapper::getLocalDateTime | ( | ) | const |
get local date/time
Definition at line 141 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getMonths | ( | ) | const |
Definition at line 240 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
sal_Int16 CalendarWrapper::getNumberOfDaysInWeek | ( | ) | const |
Definition at line 226 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
sal_Int16 CalendarWrapper::getNumberOfMonthsInYear | ( | ) | const |
Definition at line 212 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getPartitiveMonths | ( | ) | const |
Definition at line 328 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
OUString CalendarWrapper::getUniqueID | ( | ) | const |
Definition at line 85 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
sal_Int16 CalendarWrapper::getValue | ( | sal_Int16 | nFieldIndex | ) | const |
Definition at line 184 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
bool CalendarWrapper::isValid | ( | ) | const |
Definition at line 170 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
void CalendarWrapper::loadCalendar | ( | const OUString & | rUniqueID, |
const css::lang::Locale & | rLocale, | ||
bool | bTimeZoneUTC = true |
||
) |
This adds a bTimeZoneUTC parameter which is not part of the API.
Definition at line 56 of file calendarwrapper.cxx.
References LanguageTag::convertToBcp47(), Exception, TOOLS_WARN_EXCEPTION, and xC.
void CalendarWrapper::loadDefaultCalendar | ( | const css::lang::Locale & | rLocale, |
bool | bTimeZoneUTC = true |
||
) |
Load the default calendar of a locale.
This adds a bool bTimeZoneUTC parameter which is not part of the UNO API to facilitate handling of non time zone aware data.
bTimeZoneUTC | Default <TRUE>. If <FALSE>, the system's timezone is assigned to the calendar, including all DST quirks like not existing times on DST transition dates when switching to/from DST. As current implementations and number parser/formatter don't store or convert or calculate with time zones it is safer to use UTC, which is not DST afflicted, otherwise surprises are lurking (for example tdf#92503). |
Definition at line 43 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
void CalendarWrapper::setDateTime | ( | double | fTimeInDays | ) |
set UTC date/time
Definition at line 99 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
|
inline |
set a local (!) Gregorian DateTime
Definition at line 117 of file calendarwrapper.hxx.
References DateTime::Sub().
void CalendarWrapper::setLocalDateTime | ( | double | fTimeInDays | ) |
set local date/time
Definition at line 126 of file calendarwrapper.cxx.
References Exception, TOOLS_WARN_EXCEPTION, and xC.
void CalendarWrapper::setValue | ( | sal_Int16 | nFieldIndex, |
sal_Int16 | nValue | ||
) |
Definition at line 157 of file calendarwrapper.cxx.
References Exception, nValue, TOOLS_WARN_EXCEPTION, and xC.
|
private |
Definition at line 37 of file calendarwrapper.hxx.
|
private |
Definition at line 35 of file calendarwrapper.hxx.
Referenced by CalendarWrapper(), getAllCalendars(), getDateTime(), getDays(), getDisplayName(), getDisplayString(), getFirstDayOfWeek(), getGenitiveMonths(), getLoadedCalendar(), getLocalDateTime(), getMonths(), getNumberOfDaysInWeek(), getNumberOfMonthsInYear(), getPartitiveMonths(), getUniqueID(), getValue(), isValid(), loadCalendar(), loadDefaultCalendar(), setDateTime(), setLocalDateTime(), and setValue().