LibreOffice Module scaddins (master) 1
|
#include <datefunc.hxx>
Public Member Functions | |
ScaDateAddIn () | |
OUString | ScaResId (TranslateId aId) |
virtual OUString SAL_CALL | getProgrammaticFuntionName (const OUString &aDisplayName) override |
virtual OUString SAL_CALL | getDisplayFunctionName (const OUString &aProgrammaticName) override |
virtual OUString SAL_CALL | getFunctionDescription (const OUString &aProgrammaticName) override |
virtual OUString SAL_CALL | getDisplayArgumentName (const OUString &aProgrammaticName, sal_Int32 nArgument) override |
virtual OUString SAL_CALL | getArgumentDescription (const OUString &aProgrammaticName, sal_Int32 nArgument) override |
virtual OUString SAL_CALL | getProgrammaticCategoryName (const OUString &aProgrammaticName) override |
virtual OUString SAL_CALL | getDisplayCategoryName (const OUString &aProgrammaticName) override |
virtual css::uno::Sequence< css::sheet::LocalizedName > SAL_CALL | getCompatibilityNames (const OUString &aProgrammaticName) override |
virtual void SAL_CALL | setLocale (const css::lang::Locale &eLocale) override |
virtual css::lang::Locale SAL_CALL | getLocale () override |
virtual OUString SAL_CALL | getServiceName () 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 |
virtual sal_Int32 SAL_CALL | getDiffWeeks (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nEndDate, sal_Int32 nStartDate, sal_Int32 nMode) override |
Get week difference between 2 dates. More... | |
virtual sal_Int32 SAL_CALL | getDiffMonths (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nEndDate, sal_Int32 nStartDate, sal_Int32 nMode) override |
Get month difference between 2 dates =Month(start, end, mode) Function for StarCalc. More... | |
virtual sal_Int32 SAL_CALL | getDiffYears (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nEndDate, sal_Int32 nStartDate, sal_Int32 nMode) override |
Get Year difference between 2 dates. More... | |
virtual sal_Int32 SAL_CALL | getIsLeapYear (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nDate) override |
Check if a Date is in a leap year in the Gregorian calendar. More... | |
virtual sal_Int32 SAL_CALL | getDaysInMonth (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nDate) override |
Get the Number of Days in the month for a date. More... | |
virtual sal_Int32 SAL_CALL | getDaysInYear (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nDate) override |
Get number of days in the year of a date specified. More... | |
virtual sal_Int32 SAL_CALL | getWeeksInYear (const css::uno::Reference< css::beans::XPropertySet > &xOptions, sal_Int32 nDate) override |
Get number of weeks in the year for a date. More... | |
virtual OUString SAL_CALL | getRot13 (const OUString &aSrcText) override |
Encrypt or decrypt a string using ROT13 algorithm. More... | |
Private Member Functions | |
void | InitDefLocales () |
const css::lang::Locale & | GetLocale (sal_uInt32 nIndex) |
void | InitData () |
OUString | GetFuncDescrStr (const TranslateId *pResId, sal_uInt16 nStrIndex) |
Private Attributes | |
css::lang::Locale | aFuncLoc |
std::unique_ptr< css::lang::Locale[] > | pDefLocales |
std::locale | aResLocale |
std::unique_ptr< ScaFuncDataList > | pFuncDataList |
Definition at line 99 of file datefunc.hxx.
ScaDateAddIn::ScaDateAddIn | ( | ) |
Definition at line 99 of file datefunc.cxx.
|
overridevirtual |
Definition at line 238 of file datefunc.cxx.
References GetFuncDescrStr(), and pFuncDataList.
|
overridevirtual |
Definition at line 289 of file datefunc.cxx.
References GetLocale(), nCount, nIndex, and pFuncDataList.
|
overridevirtual |
Get the Number of Days in the month for a date.
Definition at line 587 of file datefunc.cxx.
References DaysInMonth, DaysToDate, and GetNullDate.
|
overridevirtual |
Get number of days in the year of a date specified.
Definition at line 603 of file datefunc.cxx.
References DaysToDate, GetNullDate, and IsLeapYear.
|
overridevirtual |
Get month difference between 2 dates =Month(start, end, mode) Function for StarCalc.
two modes are provided
mode 0 is the interval between the dates in month
mode 1 is the difference in calendar month
Definition at line 496 of file datefunc.cxx.
References DaysToDate, and GetNullDate.
Referenced by getDiffYears().
|
overridevirtual |
Get week difference between 2 dates.
new Weeks(date1,date2,mode) function for StarCalc
Two modes of operation are provided. mode 0 is just a simple division by 7 calculation.
mode 1 calculates the difference by week adhering to ISO8601.
The International Standard IS-8601 states that Monday is the first day of the week. The Gregorian Calendar is used for all dates, proleptic in case of dates before 1582-10-15.
The (consecutive) week number of a date is std::floor( (date + NullDate - 1), 7.0 ), with weeks starting on Monday, and week 0 starting on Monday, 0001-01-01 Gregorian.
Weeks(d2,d1,m) is defined as -Weeks(d1,d2,m).
Definition at line 465 of file datefunc.cxx.
References GetNullDate.
|
overridevirtual |
Get Year difference between 2 dates.
two modes are provided
mode 0 is the interval between the dates in years
mode 1 is the difference in calendar years
Definition at line 544 of file datefunc.cxx.
References DaysToDate, getDiffMonths(), and GetNullDate.
|
overridevirtual |
Definition at line 219 of file datefunc.cxx.
References GetFuncDescrStr(), and pFuncDataList.
|
overridevirtual |
Definition at line 282 of file datefunc.cxx.
References getProgrammaticCategoryName().
|
overridevirtual |
Definition at line 187 of file datefunc.cxx.
References pFuncDataList, and ScaResId().
|
private |
css::uno::RuntimeException |
Definition at line 140 of file datefunc.cxx.
References ScaResId().
Referenced by getArgumentDescription(), getDisplayArgumentName(), and getFunctionDescription().
|
overridevirtual |
Definition at line 207 of file datefunc.cxx.
References GetFuncDescrStr(), and pFuncDataList.
|
overridevirtual |
Definition at line 153 of file datefunc.cxx.
References MY_IMPLNAME.
|
overridevirtual |
Check if a Date is in a leap year in the Gregorian calendar.
Definition at line 571 of file datefunc.cxx.
References DaysToDate, GetNullDate, and IsLeapYear.
|
overridevirtual |
Definition at line 175 of file datefunc.cxx.
References aFuncLoc.
|
private |
Definition at line 118 of file datefunc.cxx.
References aFuncLoc, InitDefLocales(), nIndex, nNumOfLoc, and pDefLocales.
Referenced by getCompatibilityNames().
|
overridevirtual |
Definition at line 257 of file datefunc.cxx.
References DateTime, Finance, Inf, Math, pFuncDataList, Tech, and Text.
Referenced by getDisplayCategoryName().
|
overridevirtual |
Definition at line 180 of file datefunc.cxx.
|
overridevirtual |
Encrypt or decrypt a string using ROT13 algorithm.
This function rotates each character by 13 in the alphabet. Only the characters 'a' ... 'z' and 'A' ... 'Z' are modified.
Definition at line 660 of file datefunc.cxx.
|
overridevirtual |
Definition at line 146 of file datefunc.cxx.
References MY_SERVICE.
|
overridevirtual |
Definition at line 163 of file datefunc.cxx.
References ADDIN_SERVICE, and MY_SERVICE.
|
overridevirtual |
Get number of weeks in the year for a date.
Most years have 52 weeks, but years that start on a Thursday and leap years that start on a Wednesday have 53 weeks
The International Standard IS-8601 has decreed that Monday shall be the first day of the week.
A WeekDay can be calculated by subtracting 1 and calculating the rest of a division by 7 from the internal date representation which gives a 0 - 6 value for Monday - Sunday
Definition at line 631 of file datefunc.cxx.
References DateToDays, DaysToDate, GetNullDate, and IsLeapYear.
|
private |
Definition at line 126 of file datefunc.cxx.
References aFuncLoc, aResLocale, Translate::Create(), InitScaFuncDataList(), pDefLocales, and pFuncDataList.
Referenced by setLocale().
|
private |
Definition at line 107 of file datefunc.cxx.
References nIndex, nNumOfLoc, pCoun, pDefLocales, and pLang.
Referenced by GetLocale().
OUString ScaDateAddIn::ScaResId | ( | TranslateId | aId | ) |
Definition at line 683 of file datefunc.cxx.
References aResLocale, and Translate::get().
Referenced by getDisplayFunctionName(), and GetFuncDescrStr().
|
overridevirtual |
Definition at line 169 of file datefunc.cxx.
References aFuncLoc, and InitData().
|
overridevirtual |
Definition at line 158 of file datefunc.cxx.
References cppu::supportsService().
|
private |
Definition at line 108 of file datefunc.hxx.
Referenced by getLocale(), GetLocale(), InitData(), and setLocale().
|
private |
Definition at line 110 of file datefunc.hxx.
Referenced by InitData(), and ScaResId().
|
private |
Definition at line 109 of file datefunc.hxx.
Referenced by GetLocale(), InitData(), and InitDefLocales().
|
private |
Definition at line 111 of file datefunc.hxx.
Referenced by getArgumentDescription(), getCompatibilityNames(), getDisplayArgumentName(), getDisplayFunctionName(), getFunctionDescription(), getProgrammaticCategoryName(), and InitData().