LibreOffice Module sc (master) 1
|
Stores and generates human readable descriptions for spreadsheet-functions, e.g. functions used in formulas in calc. More...
#include <funcdesc.hxx>
Classes | |
struct | ParameterFlags |
Stores whether a parameter is optional or suppressed. More... | |
Public Member Functions | |
ScFuncDesc () | |
virtual | ~ScFuncDesc () |
void | Clear () |
Clears the object. More... | |
virtual void | fillVisibleArgumentMapping (::std::vector< sal_uInt16 > &_rArguments) const override |
Fills a mapping with indexes for non-suppressed arguments. More... | |
virtual const formula::IFunctionCategory * | getCategory () const override |
Returns the category of the function. More... | |
virtual OUString | getDescription () const override |
Returns the description of the function. More... | |
virtual OUString | getFormula (const ::std::vector< OUString > &_aArguments) const override |
Returns the function signature with parameters from the passed string array. More... | |
virtual OUString | getFunctionName () const override |
Returns the name of the function. More... | |
virtual OUString | getHelpId () const override |
Returns the help id of the function. More... | |
virtual bool | isHidden () const override |
Returns whether function is hidden and not offered in the Function Wizard unless used in an expression. More... | |
virtual sal_uInt32 | getParameterCount () const override |
Returns number of arguments. More... | |
virtual sal_uInt32 | getVarArgsStart () const override |
Returns start of variable arguments. More... | |
virtual sal_uInt32 | getVarArgsLimit () const override |
Returns maximum number of (variable) arguments. More... | |
virtual OUString | getParameterDescription (sal_uInt32 _nPos) const override |
Returns description of parameter at given position. More... | |
virtual OUString | getParameterName (sal_uInt32 _nPos) const override |
Returns name of parameter at given position. More... | |
OUString | GetParamList () const |
Returns list of all parameter names. More... | |
virtual OUString | getSignature () const override |
Returns the full function signature. More... | |
sal_uInt16 | GetSuppressedArgCount () const |
Returns the number of non-suppressed arguments. More... | |
virtual sal_Int32 | getSuppressedArgumentCount () const override |
virtual void | initArgumentInfo () const override |
Requests function data from AddInCollection. More... | |
virtual bool | isParameterOptional (sal_uInt32 _nPos) const override |
Returns true if parameter at given position is optional. More... | |
virtual OUString | getFunctionName () const=0 |
virtual const IFunctionCategory * | getCategory () const=0 |
virtual OUString | getDescription () const=0 |
virtual sal_Int32 | getSuppressedArgumentCount () const=0 |
virtual OUString | getFormula (const ::std::vector< OUString > &_aArguments) const=0 |
virtual void | fillVisibleArgumentMapping (::std::vector< sal_uInt16 > &_rArguments) const=0 |
virtual void | initArgumentInfo () const=0 |
virtual OUString | getSignature () const=0 |
virtual OUString | getHelpId () const=0 |
virtual bool | isHidden () const=0 |
virtual sal_uInt32 | getParameterCount () const=0 |
virtual sal_uInt32 | getVarArgsStart () const=0 |
virtual sal_uInt32 | getVarArgsLimit () const=0 |
virtual OUString | getParameterName (sal_uInt32 _nPos) const=0 |
virtual OUString | getParameterDescription (sal_uInt32 _nPos) const=0 |
virtual bool | isParameterOptional (sal_uInt32 _nPos) const=0 |
Static Public Member Functions | |
static bool | compareByName (const ScFuncDesc *a, const ScFuncDesc *b) |
Compares functions by name, respecting special characters. More... | |
Public Attributes | |
std::optional< OUString > | mxFuncName |
Function name. More... | |
std::optional< OUString > | mxFuncDesc |
Description of function. More... | |
std::vector< OUString > | maDefArgNames |
Parameter name(s) More... | |
std::vector< OUString > | maDefArgDescs |
Description(s) of parameter(s) More... | |
ParameterFlags * | pDefArgFlags |
Flags for each parameter. More... | |
sal_uInt16 | nFIndex |
Unique function index. More... | |
sal_uInt16 | nCategory |
Function category. More... | |
sal_uInt16 | nArgCount |
All parameter count, suppressed and unsuppressed. More... | |
sal_uInt16 | nVarArgsStart |
Start of variable arguments, for numbering. More... | |
sal_uInt16 | nVarArgsLimit |
Limit maximum of (variable) arguments, for numbering. More... | |
OUString | sHelpId |
HelpId of function. More... | |
bool | bIncomplete:1 |
Incomplete argument info (set for add-in info from configuration) More... | |
bool | mbHidden:1 |
Whether function is hidden. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from formula::IFunctionDescription | |
~IFunctionDescription () | |
Stores and generates human readable descriptions for spreadsheet-functions, e.g. functions used in formulas in calc.
Definition at line 40 of file funcdesc.hxx.
ScFuncDesc::ScFuncDesc | ( | ) |
Definition at line 102 of file funcdesc.cxx.
|
virtual |
Definition at line 113 of file funcdesc.cxx.
References Clear().
void ScFuncDesc::Clear | ( | ) |
Clears the object.
Deletes all objects referenced by the pointers in the class, sets pointers to NULL, and all numerical variables to 0
Definition at line 118 of file funcdesc.cxx.
References bIncomplete, maDefArgDescs, maDefArgNames, mbHidden, mxFuncDesc, mxFuncName, nArgCount, nCategory, nFIndex, nVarArgsLimit, nVarArgsStart, PAIRED_VAR_ARGS, pDefArgFlags, sHelpId, and VAR_ARGS.
Referenced by ScUnoAddInCollection::FillFunctionDescFromData(), and ~ScFuncDesc().
|
static |
Compares functions by name, respecting special characters.
a | pointer to first function descriptor |
b | pointer to second function descriptor |
Definition at line 376 of file funcdesc.cxx.
References a, ScGlobal::GetCaseCollator(), and mxFuncName.
Referenced by ScFunctionMgr::ScFunctionMgr().
|
overridevirtual |
Fills a mapping with indexes for non-suppressed arguments.
Fills mapping from visible arguments to real arguments, e.g. if of 4 parameters the second one is suppressed {0,2,3}. For VAR_ARGS parameters only one element is added to the end of the sequence.
_rArguments | Vector, which the indices are written to |
Implements formula::IFunctionDescription.
Definition at line 292 of file funcdesc.cxx.
References argument, i, nArgCount, PAIRED_VAR_ARGS, value, and VAR_ARGS.
|
overridevirtual |
Returns the category of the function.
Implements formula::IFunctionDescription.
Definition at line 274 of file funcdesc.cxx.
References ScFunctionMgr::getCategory(), ScGlobal::GetStarCalcFunctionMgr(), and nCategory.
|
overridevirtual |
Returns the description of the function.
Implements formula::IFunctionDescription.
Definition at line 279 of file funcdesc.cxx.
References mxFuncDesc.
|
overridevirtual |
Returns the function signature with parameters from the passed string array.
Implements formula::IFunctionDescription.
Definition at line 233 of file funcdesc.cxx.
References formula::FormulaCompiler::GetNativeSymbol(), mxFuncName, nArgCount, and ocSep.
|
overridevirtual |
Returns the name of the function.
Implements formula::IFunctionDescription.
Definition at line 266 of file funcdesc.cxx.
References mxFuncName.
|
overridevirtual |
Returns the help id of the function.
Implements formula::IFunctionDescription.
Definition at line 336 of file funcdesc.cxx.
References sHelpId.
Referenced by ScFunctionWin::SetDescription().
|
overridevirtual |
Returns number of arguments.
Implements formula::IFunctionDescription.
Definition at line 346 of file funcdesc.cxx.
References nArgCount.
|
overridevirtual |
Returns description of parameter at given position.
_nPos | Position of the parameter |
Implements formula::IFunctionDescription.
Definition at line 366 of file funcdesc.cxx.
References _nPos, and maDefArgDescs.
|
overridevirtual |
Returns name of parameter at given position.
_nPos | Position of the parameter |
Implements formula::IFunctionDescription.
Definition at line 361 of file funcdesc.cxx.
References _nPos, and maDefArgNames.
OUString ScFuncDesc::GetParamList | ( | ) | const |
Returns list of all parameter names.
Definition at line 146 of file funcdesc.cxx.
References formula::FormulaCompiler::GetNativeSymbol(), i, maDefArgNames, nArgCount, nVarArgsStart, ocSep, PAIRED_VAR_ARGS, and VAR_ARGS.
Referenced by getSignature(), and ScFunctionWin::SetDescription().
|
overridevirtual |
Returns the full function signature.
Implements formula::IFunctionDescription.
Definition at line 212 of file funcdesc.cxx.
References GetParamList(), mxFuncName, and u.
Referenced by ScGlobal::GetInputHandlerFunctionNames().
sal_uInt16 ScFuncDesc::GetSuppressedArgCount | ( | ) | const |
Returns the number of non-suppressed arguments.
In case there are variable arguments the number of fixed non-suppressed arguments plus VAR_ARGS, same as for nArgCount (variable arguments can't be suppressed). The two functions are equal apart from return type and name.
Definition at line 261 of file funcdesc.cxx.
References nArgCount.
Referenced by getSuppressedArgumentCount(), and lcl_FillSequence().
|
overridevirtual |
Implements formula::IFunctionDescription.
Definition at line 287 of file funcdesc.cxx.
References GetSuppressedArgCount().
|
overridevirtual |
Returns maximum number of (variable) arguments.
Implements formula::IFunctionDescription.
Definition at line 356 of file funcdesc.cxx.
References nVarArgsLimit.
|
overridevirtual |
Returns start of variable arguments.
Implements formula::IFunctionDescription.
Definition at line 351 of file funcdesc.cxx.
References nVarArgsStart.
|
overridevirtual |
Requests function data from AddInCollection.
Logs error message on failure for debugging purposes
Implements formula::IFunctionDescription.
Definition at line 310 of file funcdesc.cxx.
References bIncomplete, ScUnoAddInCollection::FindFunction(), ScGlobal::GetAddInCollection(), ScUnoAddInCollection::GetFuncData(), and mxFuncName.
Referenced by ScGlobal::GetInputHandlerFunctionNames(), lcl_FillSequence(), and ScFunctionWin::SetDescription().
|
overridevirtual |
Returns whether function is hidden and not offered in the Function Wizard unless used in an expression.
Implements formula::IFunctionDescription.
Definition at line 341 of file funcdesc.cxx.
References mbHidden.
|
overridevirtual |
Returns true if parameter at given position is optional.
_nPos | Position of the parameter |
Implements formula::IFunctionDescription.
Definition at line 371 of file funcdesc.cxx.
References _nPos, ScFuncDesc::ParameterFlags::bOptional, and pDefArgFlags.
bool ScFuncDesc::bIncomplete |
Incomplete argument info (set for add-in info from configuration)
Definition at line 227 of file funcdesc.hxx.
Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), and initArgumentInfo().
std::vector<OUString> ScFuncDesc::maDefArgDescs |
Description(s) of parameter(s)
Definition at line 219 of file funcdesc.hxx.
Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), getParameterDescription(), lcl_FillSequence(), ScFuncRes(), and ScFunctionList::ScFunctionList().
std::vector<OUString> ScFuncDesc::maDefArgNames |
Parameter name(s)
Definition at line 218 of file funcdesc.hxx.
Referenced by Clear(), ScFunctionWin::DoEnter(), ScUnoAddInCollection::FillFunctionDescFromData(), getParameterName(), GetParamList(), lcl_FillSequence(), ScFuncRes(), and ScFunctionList::ScFunctionList().
bool ScFuncDesc::mbHidden |
Whether function is hidden.
Definition at line 228 of file funcdesc.hxx.
Referenced by Clear(), isHidden(), and ScFuncRes().
std::optional<OUString> ScFuncDesc::mxFuncDesc |
Description of function.
Definition at line 217 of file funcdesc.hxx.
Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), getDescription(), lcl_FillSequence(), ScFuncRes(), ScFunctionList::ScFunctionList(), and ScFunctionWin::SetDescription().
std::optional<OUString> ScFuncDesc::mxFuncName |
Function name.
Definition at line 216 of file funcdesc.hxx.
Referenced by Clear(), compareByName(), ScUnoAddInCollection::FillFunctionDescFromData(), ScPosWnd::FillFunctions(), ScFunctionListObj::getByName(), ScFunctionListObj::getElementNames(), getFormula(), ScInputHandler::GetFormulaData(), getFunctionName(), ScGlobal::GetInputHandlerFunctionNames(), getSignature(), ScFunctionListObj::hasByName(), initArgumentInfo(), lcl_FillSequence(), lcl_UpdateFunctionList(), ScFuncRes(), ScFunctionList::ScFunctionList(), and ScFunctionWin::UpdateFunctionList().
sal_uInt16 ScFuncDesc::nArgCount |
All parameter count, suppressed and unsuppressed.
Definition at line 223 of file funcdesc.hxx.
Referenced by Clear(), ScFunctionWin::DoEnter(), ScUnoAddInCollection::FillFunctionDescFromData(), fillVisibleArgumentMapping(), getFormula(), getParameterCount(), GetParamList(), GetSuppressedArgCount(), lcl_FillSequence(), ScFuncRes(), and ScFunctionList::ScFunctionList().
sal_uInt16 ScFuncDesc::nCategory |
Function category.
Definition at line 222 of file funcdesc.hxx.
Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), getCategory(), lcl_FillSequence(), ScFuncRes(), and ScFunctionList::ScFunctionList().
sal_uInt16 ScFuncDesc::nFIndex |
Unique function index.
Definition at line 221 of file funcdesc.hxx.
Referenced by Clear(), ScPosWnd::FillFunctions(), ScFunctionMgr::Get(), ScFunctionListObj::getById(), ScInputHandler::GetFormulaData(), lcl_FillSequence(), lcl_FunctionKnown(), ScFormulaDlg::SaveLRUEntry(), ScFunctionList::ScFunctionList(), and ScFunctionWin::UpdateLRUList().
sal_uInt16 ScFuncDesc::nVarArgsLimit |
Limit maximum of (variable) arguments, for numbering.
Definition at line 225 of file funcdesc.hxx.
Referenced by Clear(), getVarArgsLimit(), and ScFuncRes().
sal_uInt16 ScFuncDesc::nVarArgsStart |
Start of variable arguments, for numbering.
Definition at line 224 of file funcdesc.hxx.
Referenced by Clear(), GetParamList(), getVarArgsStart(), and ScFuncRes().
ParameterFlags* ScFuncDesc::pDefArgFlags |
Flags for each parameter.
Definition at line 220 of file funcdesc.hxx.
Referenced by Clear(), ScFunctionWin::DoEnter(), ScUnoAddInCollection::FillFunctionDescFromData(), isParameterOptional(), lcl_FillSequence(), ScFuncRes(), and ScFunctionList::ScFunctionList().
OUString ScFuncDesc::sHelpId |
HelpId of function.
Definition at line 226 of file funcdesc.hxx.
Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), getHelpId(), and ScFuncRes().