ooodev.adapter.sheet.formula_op_code_mapper_partial module
- class ooodev.adapter.sheet.formula_op_code_mapper_partial.FormulaOpCodeMapperPartial(component, interface=com.sun.star.sheet.XFormulaOpCodeMapper)[source]
Bases:
object
Partial Class for XFormulaOpCodeMapper.
- Parameters:
component (XFormulaOpCodeMapper) –
interface (UnoInterface | None) –
- __init__(component, interface=com.sun.star.sheet.XFormulaOpCodeMapper)[source]
Constructor
- Parameters:
component (XFormulaOpCodeMapper) – UNO Component that implements
com.sun.star.sheet.XFormulaOpCodeMapper
.interface (UnoInterface, optional) – The interface to be validated. Defaults to
XFormulaOpCodeMapper
.
- Return type:
None
- get_available_mappings(language, groups)[source]
Returns a sequence of map entries for all available elements of a given formula language.
Each element of the formula language in parameter Language is mapped to a FormulaToken containing the internal OpCode used by the spreadsheet application in FormulaToken.OpCode and by contract maybe additional information in FormulaToken.Data. See getMappings() for more details.
- Parameters:
language (FormulaLanguageEnum) – The formula language.
groups (int) – Group of mappings to be returned, a bit mask of
FormulaMapGroup
constants.
- Raises:
com.sun.star.lang.IllegalArgumentException –
IllegalArgumentException
- Returns:
A sequence of map entries for all available elements of a given formula language.
- Return type:
Tuple[FormulaOpCodeMapEntry, …]
Note
FormulaLanguageEnum
can be imported fromooo.dyn.sheet.formula_language
.FormulaMapGroup
can be imported fromcom.sun.star.sheet
.
- get_mappings(language, *names)[source]
Returns a sequence of tokens matching the input sequence of strings in order.
Each string element in parameter Names according to the formula language in parameter Language is mapped to a FormulaToken containing the internal OpCode used by the spreadsheet application in FormulaToken. OpCode and by contract maybe additional information in FormulaToken Data.
The order of the FormulaToken sequence returned matches the input order of the string sequence.
An unknown Name string gets the OpCode value of OpCodeUnknown assigned.
Additional information in FormulaToken. Data is returned for:
- Raises:
com.sun.star.lang.IllegalArgumentException –
IllegalArgumentException
- Returns:
A sequence of tokens matching the input sequence of strings in order.
- Return type:
Tuple[FormulaToken, …]
- Parameters:
language (FormulaLanguageEnum) –
names (str) –
Note
FormulaLanguageEnum
can be imported fromooo.dyn.sheet.formula_language
.
- property op_code_external: int
Gets - OpCode value used for external Add-In functions.
Needed to be able to identify which of the function names map to an Add-In implementation where this OpCode is used in the returned mapping and the programmatic name is available as additional information.
- Return type:
int
- property op_code_unknown: int
Gets - OpCode value used for unknown functions.
Used to identify which of the function names queried with getMappings() are unknown to the implementation.
- Return type:
int