LibreOffice: XNumberFormats Interface Reference

LibreOffice LibreOffice 24.2 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XNumberFormats Interface Referencepublished

provides access to multiple NumberFormats. More...

`import <XNumberFormats.idl;`

Inheritance diagram for XNumberFormats:

## Public Member Functions
com::sun::star::beans::XPropertySet | getByKey ([in] long nKey)
sequence< long > | queryKeys ([in] short nType, [in] com::sun::star::lang::Locale nLocale, [in] boolean bCreate)
long | queryKey ([in] string aFormat, [in] com::sun::star::lang::Locale nLocale, [in] boolean bScan)
| finds a number format by its format string and returns its key.
long | addNew ([in] string aFormat, [in] com::sun::star::lang::Locale nLocale) raises ( com::sun::star::util::MalformedNumberFormatException )
| adds a new number format to the list, using a format string.
long | addNewConverted ([in] string aFormat, [in] com::sun::star::lang::Locale nLocale, [in] com::sun::star::lang::Locale nNewLocale) raises ( com::sun::star::util::MalformedNumberFormatException )
| adds a new number format to the list, using a format string in a different locale than the desired locale of the resulting number format.
void | removeByKey ([in] long nKey)
| removes a number format from the list.
string | generateFormat ([in] long nBaseKey, [in] com::sun::star::lang::Locale nLocale, [in] boolean bThousands, [in] boolean bRed, [in] short nDecimals, [in] short nLeading)
| generates a format string from several parameters without creating an actual number format.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

provides access to multiple NumberFormats.

The number formats are managed by their unique key in the document.

Developers Guide
  Office Development - Number Formats

## Member Function Documentation

## ◆ addNew()

long addNew | ( | [in] string | aFormat,
|  | [in] com::sun::star::lang::Locale | nLocale )
raises | ( | com::sun::star::util::MalformedNumberFormatException ) |  |  |

adds a new number format to the list, using a format string.

Returns
  the key for new number format

Parameters

  aFormat | the string representation of the number format
  nLocale | the locale for the number format

Exceptions

  com::sun::star::util::MalformedNumberFormatException | if incorrect number format is specified

## ◆ addNewConverted()

long addNewConverted | ( | [in] string | aFormat,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] com::sun::star::lang::Locale | nNewLocale )
raises | ( | com::sun::star::util::MalformedNumberFormatException ) |  |  |

adds a new number format to the list, using a format string in a different locale than the desired locale of the resulting number format.

Returns
  the key for added number format

Parameters

  aFormat | the key for the number format
  nLocale | the original locale for the number format
  nNewLocale | the new locale for the number format to be converted

Exceptions

  com::sun::star::util::MalformedNumberFormatException | if incorrect number format is specified

## ◆ generateFormat()

string generateFormat | ( | [in] long | nBaseKey,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] boolean | bThousands,
|  | [in] boolean | bRed,
|  | [in] short | nDecimals,
|  | [in] short | nLeading )

generates a format string from several parameters without creating an actual number format.

Returns
  the string representation for the number format

Parameters

  nBaseKey | the key for the number format to be used as base format
  nLocale | the locale for the number format
  bThousands | the thousands separator is shown or not
  bRed | show negative number in red colored if `TRUE`
  nDecimals | how many digits are shown after the decimal point
  nLeading | how many number of leading zeros are shown

## ◆ getByKey()

com::sun::star::beans::XPropertySet getByKey | ( | [in] long | nKey | ) |

Returns
  a readonly NumberFormatProperties.

Parameters

  nKey | the key for the format

## ◆ queryKey()

long queryKey | ( | [in] string | aFormat,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] boolean | bScan )

finds a number format by its format string and returns its key.

Returns
  the key for the format if found, otherwise -1.

Parameters

  aFormat | the string representation of the number format
  nLocale | the locale for number formats to find
  bScan | reserved for future use and should be set to false

## ◆ queryKeys()

sequence< long > queryKeys | ( | [in] short | nType,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] boolean | bCreate )

Returns
  a sequence of the keys of all number formats with the specified type and language.

Parameters

  nType | the type of number formats to return. Must be one of the NumberFormat constants.
  nLocale | the locale of number formats to return.
  bCreate | `TRUE`: create new entries if no formats for the selected language exist `FALSE`: return an empty list if no formats for the selected language exist

## ◆ removeByKey()

void removeByKey | ( | [in] long | nKey | ) |

removes a number format from the list.

Parameters

  nKey | the key for the numberformat

The documentation for this interface was generated from the following file:

- com/sun/star/util/XNumberFormats.idl