20#ifndef INCLUDED_UNOTOOLS_CALENDARWRAPPER_HXX
21#define INCLUDED_UNOTOOLS_CALENDARWRAPPER_HXX
23#include <tools/datetime.hxx>
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/uno/Sequence.hxx>
26#include <com/sun/star/i18n/Calendar2.hpp>
35 css::uno::Reference< css::i18n::XCalendar4 >
xC;
41 const css::uno::Reference< css::uno::XComponentContext > & rxContext
61 void loadDefaultCalendar(
const css::lang::Locale& rLocale,
bool bTimeZoneUTC =
true );
63 void loadCalendar(
const OUString& rUniqueID,
const css::lang::Locale& rLocale,
bool bTimeZoneUTC =
true );
71 css::uno::Sequence< OUString > getAllCalendars(
const css::lang::Locale& rLocale )
const;
72 OUString getUniqueID()
const;
74 void setDateTime(
double fTimeInDays );
76 double getDateTime()
const;
83 void setValue( sal_Int16 nFieldIndex, sal_Int16 nValue );
85 sal_Int16
getValue( sal_Int16 nFieldIndex )
const;
86 sal_Int16 getFirstDayOfWeek()
const;
87 sal_Int16 getNumberOfMonthsInYear()
const;
88 sal_Int16 getNumberOfDaysInWeek()
const;
89 OUString getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType )
const;
93 OUString getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativeNumberMode )
const;
97 css::i18n::Calendar2 getLoadedCalendar()
const;
98 css::uno::Sequence< css::i18n::CalendarItem2 > getDays()
const;
99 css::uno::Sequence< css::i18n::CalendarItem2 > getMonths()
const;
100 css::uno::Sequence< css::i18n::CalendarItem2 > getGenitiveMonths()
const;
101 css::uno::Sequence< css::i18n::CalendarItem2 > getPartitiveMonths()
const;
106 void setLocalDateTime(
double fTimeInDays );
108 double getLocalDateTime()
const;
114 {
return aEpochStart; }
118 { setLocalDateTime(
DateTime::Sub( rDateTime, aEpochStart)); }
css::uno::Reference< css::i18n::XCalendar4 > xC
const DateTime aEpochStart
void setGregorianDateTime(const DateTime &rDateTime)
set a local (!) Gregorian DateTime
const DateTime & getEpochStart() const
get epoch start (should be 01Jan1970)
static double Sub(const DateTime &rDateTime1, const DateTime &rDateTime2)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)