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 OString 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...
 
- Public Member Functions inherited from formula::IFunctionDescription
 IFunctionDescription ()
 

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...
 
OString 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 41 of file funcdesc.hxx.

Constructor & Destructor Documentation

ScFuncDesc::ScFuncDesc ( )

Definition at line 102 of file funcdesc.cxx.

ScFuncDesc::~ScFuncDesc ( )
virtual

Definition at line 113 of file funcdesc.cxx.

References Clear().

Member Function Documentation

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

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 393 of file funcdesc.cxx.

References ScGlobal::GetCaseCollator(), and mxFuncName.

Referenced by ScFunctionMgr::ScFunctionMgr().

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
_rArgumensVector, which the indices are written to

Implements formula::IFunctionDescription.

Definition at line 309 of file funcdesc.cxx.

References argument, i, nArgCount, PAIRED_VAR_ARGS, value, and VAR_ARGS.

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 291 of file funcdesc.cxx.

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

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 296 of file funcdesc.cxx.

References mxFuncDesc.

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 247 of file funcdesc.cxx.

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

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 283 of file funcdesc.cxx.

References mxFuncName.

OString ScFuncDesc::getHelpId ( ) const
overridevirtual

Returns the help id of the function.

Returns
help id of the function

Implements formula::IFunctionDescription.

Definition at line 353 of file funcdesc.cxx.

References sHelpId.

sal_uInt32 ScFuncDesc::getParameterCount ( ) const
overridevirtual

Returns number of arguments.

Returns
number of arguments

Implements formula::IFunctionDescription.

Definition at line 363 of file funcdesc.cxx.

References nArgCount.

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 383 of file funcdesc.cxx.

References maDefArgDescs.

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 378 of file funcdesc.cxx.

References maDefArgNames.

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

OUString ScFuncDesc::getSignature ( ) const
overridevirtual

Returns the full function signature.

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

Implements formula::IFunctionDescription.

Definition at line 224 of file funcdesc.cxx.

References GetParamList(), mxFuncName, and u.

Referenced by ScInputHandler::GetFormulaData().

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 278 of file funcdesc.cxx.

References nArgCount.

Referenced by getSuppressedArgumentCount(), and lcl_FillSequence().

sal_Int32 ScFuncDesc::getSuppressedArgumentCount ( ) const
overridevirtual

Implements formula::IFunctionDescription.

Definition at line 304 of file funcdesc.cxx.

References GetSuppressedArgCount().

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 373 of file funcdesc.cxx.

References nVarArgsLimit.

sal_uInt32 ScFuncDesc::getVarArgsStart ( ) const
overridevirtual

Returns start of variable arguments.

Returns
start of variable arguments

Implements formula::IFunctionDescription.

Definition at line 368 of file funcdesc.cxx.

References nVarArgsStart.

void ScFuncDesc::initArgumentInfo ( ) const
overridevirtual

Requests function data from AddInCollection.

Logs error message on failure for debugging purposes

Implements formula::IFunctionDescription.

Definition at line 327 of file funcdesc.cxx.

References bIncomplete, ScUnoAddInCollection::FindFunction(), ScGlobal::GetAddInCollection(), ScUnoAddInCollection::GetFuncData(), and mxFuncName.

Referenced by ScInputHandler::GetFormulaData(), lcl_FillSequence(), and ScFunctionWin::SetDescription().

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 358 of file funcdesc.cxx.

References mbHidden.

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 388 of file funcdesc.cxx.

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

Member Data Documentation

bool ScFuncDesc::bIncomplete

Incomplete argument info (set for add-in info from configuration)

Definition at line 228 of file funcdesc.hxx.

Referenced by Clear(), ScUnoAddInCollection::FillFunctionDescFromData(), and initArgumentInfo().

std::vector<OUString> ScFuncDesc::maDefArgDescs
std::vector<OUString> ScFuncDesc::maDefArgNames
bool ScFuncDesc::mbHidden

Whether function is hidden.

Definition at line 229 of file funcdesc.hxx.

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

std::optional<OUString> ScFuncDesc::mxFuncDesc
std::optional<OUString> ScFuncDesc::mxFuncName
sal_uInt16 ScFuncDesc::nArgCount
sal_uInt16 ScFuncDesc::nCategory
sal_uInt16 ScFuncDesc::nFIndex
sal_uInt16 ScFuncDesc::nVarArgsLimit

Limit maximum of (variable) arguments, for numbering.

Definition at line 226 of file funcdesc.hxx.

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

sal_uInt16 ScFuncDesc::nVarArgsStart

Start of variable arguments, for numbering.

Definition at line 225 of file funcdesc.hxx.

Referenced by Clear(), GetParamList(), getVarArgsStart(), and ScFuncRes().

ParameterFlags* ScFuncDesc::pDefArgFlags
OString ScFuncDesc::sHelpId

HelpId of function.

Definition at line 227 of file funcdesc.hxx.

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


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