LibreOffice Module sc (master) 1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ScFuncDesc Class Referencefinal

Stores and generates human readable descriptions for spreadsheet-functions, e.g. functions used in formulas in calc. More...

#include <funcdesc.hxx>

Inheritance diagram for ScFuncDesc:
[legend]
Collaboration diagram for ScFuncDesc:
[legend]

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::IFunctionCategorygetCategory () 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 IFunctionCategorygetCategory () 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...
 
ParameterFlagspDefArgFlags
 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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ScFuncDesc()

ScFuncDesc::ScFuncDesc ( )

Definition at line 102 of file funcdesc.cxx.

◆ ~ScFuncDesc()

ScFuncDesc::~ScFuncDesc ( )
virtual

Definition at line 113 of file funcdesc.cxx.

References Clear().

Member Function Documentation

◆ 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().

◆ compareByName()

bool ScFuncDesc::compareByName ( const ScFuncDesc a,
const ScFuncDesc b 
)
static

Compares functions by name, respecting special characters.

Parameters
apointer to first function descriptor
bpointer to second function descriptor
Returns
"(a < b)"

Definition at line 376 of file funcdesc.cxx.

References a, ScGlobal::GetCaseCollator(), and mxFuncName.

Referenced by ScFunctionMgr::ScFunctionMgr().

◆ fillVisibleArgumentMapping()

void ScFuncDesc::fillVisibleArgumentMapping ( ::std::vector< sal_uInt16 > &  _rArguments) const
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.

Parameters
_rArgumentsVector, 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.

◆ getCategory()

const formula::IFunctionCategory * ScFuncDesc::getCategory ( ) const
overridevirtual

Returns the category of the function.

Returns
the category of the function

Implements formula::IFunctionDescription.

Definition at line 274 of file funcdesc.cxx.

References ScFunctionMgr::getCategory(), ScGlobal::GetStarCalcFunctionMgr(), and nCategory.

◆ getDescription()

OUString ScFuncDesc::getDescription ( ) const
overridevirtual

Returns the description of the function.

Returns
the description of the function, or an empty OUString if there is no description

Implements formula::IFunctionDescription.

Definition at line 279 of file funcdesc.cxx.

References mxFuncDesc.

◆ getFormula()

OUString ScFuncDesc::getFormula ( const ::std::vector< OUString > &  _aArguments) const
overridevirtual

Returns the function signature with parameters from the passed string array.

Returns
function signature with parameters

Implements formula::IFunctionDescription.

Definition at line 233 of file funcdesc.cxx.

References formula::FormulaCompiler::GetNativeSymbol(), mxFuncName, nArgCount, and ocSep.

◆ getFunctionName()

OUString ScFuncDesc::getFunctionName ( ) const
overridevirtual

Returns the name of the function.

Returns
the name of the function, or an empty OUString if there is no name

Implements formula::IFunctionDescription.

Definition at line 266 of file funcdesc.cxx.

References mxFuncName.

◆ getHelpId()

OUString ScFuncDesc::getHelpId ( ) const
overridevirtual

Returns the help id of the function.

Returns
help id of the function

Implements formula::IFunctionDescription.

Definition at line 336 of file funcdesc.cxx.

References sHelpId.

Referenced by ScFunctionWin::SetDescription().

◆ getParameterCount()

sal_uInt32 ScFuncDesc::getParameterCount ( ) const
overridevirtual

Returns number of arguments.

Returns
number of arguments

Implements formula::IFunctionDescription.

Definition at line 346 of file funcdesc.cxx.

References nArgCount.

◆ getParameterDescription()

OUString ScFuncDesc::getParameterDescription ( sal_uInt32  _nPos) const
overridevirtual

Returns description of parameter at given position.

Parameters
_nPosPosition of the parameter
Returns
OUString description of the parameter

Implements formula::IFunctionDescription.

Definition at line 366 of file funcdesc.cxx.

References _nPos, and maDefArgDescs.

◆ getParameterName()

OUString ScFuncDesc::getParameterName ( sal_uInt32  _nPos) const
overridevirtual

Returns name of parameter at given position.

Parameters
_nPosPosition of the parameter
Returns
OUString name of the parameter

Implements formula::IFunctionDescription.

Definition at line 361 of file funcdesc.cxx.

References _nPos, and maDefArgNames.

◆ GetParamList()

OUString ScFuncDesc::GetParamList ( ) const

Returns list of all parameter names.

Returns
OUString containing separated 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().

◆ getSignature()

OUString ScFuncDesc::getSignature ( ) const
overridevirtual

Returns the full function signature.

Returns
OUString of the form "FUNCTIONNAME( parameter list )"

Implements formula::IFunctionDescription.

Definition at line 212 of file funcdesc.cxx.

References GetParamList(), mxFuncName, and u.

Referenced by ScGlobal::GetInputHandlerFunctionNames().

◆ GetSuppressedArgCount()

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.

Returns
number of non-suppressed arguments

Definition at line 261 of file funcdesc.cxx.

References nArgCount.

Referenced by getSuppressedArgumentCount(), and lcl_FillSequence().

◆ getSuppressedArgumentCount()

sal_Int32 ScFuncDesc::getSuppressedArgumentCount ( ) const
overridevirtual

Implements formula::IFunctionDescription.

Definition at line 287 of file funcdesc.cxx.

References GetSuppressedArgCount().

◆ getVarArgsLimit()

sal_uInt32 ScFuncDesc::getVarArgsLimit ( ) const
overridevirtual

Returns maximum number of (variable) arguments.

Returns
maximum number of arguments, or 0 if there is no specific limit other than the general limit

Implements formula::IFunctionDescription.

Definition at line 356 of file funcdesc.cxx.

References nVarArgsLimit.

◆ getVarArgsStart()

sal_uInt32 ScFuncDesc::getVarArgsStart ( ) const
overridevirtual

Returns start of variable arguments.

Returns
start of variable arguments

Implements formula::IFunctionDescription.

Definition at line 351 of file funcdesc.cxx.

References nVarArgsStart.

◆ initArgumentInfo()

void ScFuncDesc::initArgumentInfo ( ) const
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().

◆ isHidden()

bool ScFuncDesc::isHidden ( ) const
overridevirtual

Returns whether function is hidden and not offered in the Function Wizard unless used in an expression.

Returns
flag whether function is hidden

Implements formula::IFunctionDescription.

Definition at line 341 of file funcdesc.cxx.

References mbHidden.

◆ isParameterOptional()

bool ScFuncDesc::isParameterOptional ( sal_uInt32  _nPos) const
overridevirtual

Returns true if parameter at given position is optional.

Parameters
_nPosPosition of the parameter
Returns
true if optional, false if not optional

Implements formula::IFunctionDescription.

Definition at line 371 of file funcdesc.cxx.

References _nPos, ScFuncDesc::ParameterFlags::bOptional, and pDefArgFlags.

Member Data Documentation

◆ bIncomplete

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().

◆ maDefArgDescs

std::vector<OUString> ScFuncDesc::maDefArgDescs

◆ maDefArgNames

std::vector<OUString> ScFuncDesc::maDefArgNames

◆ mbHidden

bool ScFuncDesc::mbHidden

Whether function is hidden.

Definition at line 228 of file funcdesc.hxx.

Referenced by Clear(), isHidden(), and ScFuncRes().

◆ mxFuncDesc

std::optional<OUString> ScFuncDesc::mxFuncDesc

◆ mxFuncName

std::optional<OUString> ScFuncDesc::mxFuncName

◆ nArgCount

sal_uInt16 ScFuncDesc::nArgCount

◆ nCategory

sal_uInt16 ScFuncDesc::nCategory

◆ nFIndex

sal_uInt16 ScFuncDesc::nFIndex

◆ nVarArgsLimit

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().

◆ nVarArgsStart

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().

◆ pDefArgFlags

ParameterFlags* ScFuncDesc::pDefArgFlags

◆ sHelpId

OUString ScFuncDesc::sHelpId

HelpId of function.

Definition at line 226 of file funcdesc.hxx.

Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), getHelpId(), and ScFuncRes().


The documentation for this class was generated from the following files: