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

Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them accessible. More...

#include <funcdesc.hxx>

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

Public Member Functions

 ScFunctionMgr ()
 Retrieves all calc functions, generates cumulative ('All') category, and the categories. More...
 
virtual ~ScFunctionMgr ()
 
const ScFuncDescGet (sal_uInt16 nFIndex) const
 Returns function by index. More...
 
const ScFuncDescFirst (sal_uInt16 nCategory=0) const
 Returns the first function in category nCategory. More...
 
const ScFuncDescNext () const
 Returns the next function of the current category. More...
 
virtual sal_uInt32 getCount () const override
 
virtual const formula::IFunctionCategorygetCategory (sal_uInt32 nPos) const override
 Returns a category. More...
 
virtual void fillLastRecentlyUsedFunctions (::std::vector< const formula::IFunctionDescription * > &_rLastRUFunctions) const override
 Appends the last recently used functions. More...
 
virtual sal_Unicode getSingleToken (const formula::IFunctionManager::EToken _eToken) const override
 Maps Etoken to character. More...
 
virtual sal_uInt32 getCount () const=0
 
virtual const IFunctionCategorygetCategory (sal_uInt32 nPos) const=0
 
virtual void fillLastRecentlyUsedFunctions (::std::vector< const IFunctionDescription * > &_rLastRUFunctions) const=0
 
virtual sal_Unicode getSingleToken (const EToken _eToken) const=0
 

Static Public Member Functions

static OUString GetCategoryName (sal_uInt32 _nCategoryNumber)
 Returns name of category. More...
 

Private Attributes

std::vector< const ScFuncDesc * > aCatLists [MAX_FUNCCAT]
 array of all categories, 0 is the cumulative ('All') category More...
 
std::map< sal_uInt32, std::shared_ptr< ScFunctionCategory > > m_aCategories
 map of category pos to IFunctionCategory More...
 
std::vector< constScFuncDesc * >::const_iterator pCurCatListIter
 position in current category More...
 
std::vector< constScFuncDesc * >::const_iterator pCurCatListEnd
 end of current category More...
 

Additional Inherited Members

- Public Types inherited from formula::IFunctionManager
enum  EToken
 
- Public Attributes inherited from formula::IFunctionManager
 eOk
 
 eClose
 
 eSep
 
 eArrayOpen
 
 eArrayClose
 
- Protected Member Functions inherited from formula::IFunctionManager
 ~IFunctionManager ()
 

Detailed Description

Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them accessible.

Definition at line 308 of file funcdesc.hxx.

Constructor & Destructor Documentation

◆ ScFunctionMgr()

ScFunctionMgr::ScFunctionMgr ( )

Retrieves all calc functions, generates cumulative ('All') category, and the categories.

The function lists of the categories are sorted by (case insensitive) function name

< list of all calc functions

Definition at line 1029 of file funcdesc.cxx.

References aCatLists, begin, ScFuncDesc::compareByName(), end, ScFunctionList::First(), ScFunctionList::GetCount(), ScGlobal::GetStarCalcFunctionList(), i, MAX_FUNCCAT, ScFunctionList::Next(), pCurCatListEnd, and pCurCatListIter.

◆ ~ScFunctionMgr()

ScFunctionMgr::~ScFunctionMgr ( )
virtual

Definition at line 1070 of file funcdesc.cxx.

Member Function Documentation

◆ fillLastRecentlyUsedFunctions()

void ScFunctionMgr::fillLastRecentlyUsedFunctions ( ::std::vector< const formula::IFunctionDescription * > &  _rLastRUFunctions) const
overridevirtual

Appends the last recently used functions.

Takes the last recently used functions, but maximal LRU_MAX, and appends them to the given vector _rLastRUFunctions.

Parameters
_rLastRUFunctionsa vector of pointer to IFunctionDescription, by reference.

Implements formula::IFunctionManager.

Definition at line 1131 of file funcdesc.cxx.

References Get(), ScAppOptions::GetLRUFuncList(), ScAppOptions::GetLRUFuncListCount(), i, LRU_MAX, and SC_MOD.

Referenced by ScFunctionWin::InitLRUList().

◆ First()

const ScFuncDesc * ScFunctionMgr::First ( sal_uInt16  nCategory = 0) const

Returns the first function in category nCategory.

Selects nCategory as current category and returns first element of this.

Parameters
nCategoryindex of requested category
Returns
pointer to first element in current category, null if nCategory out of bounds

Definition at line 1084 of file funcdesc.cxx.

References aCatLists, MAX_FUNCCAT, pCurCatListEnd, and pCurCatListIter.

Referenced by Get(), and ScFunctionWin::UpdateFunctionList().

◆ Get()

const ScFuncDesc * ScFunctionMgr::Get ( sal_uInt16  nFIndex) const

Returns function by index.

Searches for a function with the function index nFIndex.

Parameters
nFIndexindex of the function
Returns
pointer to function with the index nFIndex, null if no such function was found.

Definition at line 1075 of file funcdesc.cxx.

References First(), Next(), and ScFuncDesc::nFIndex.

Referenced by fillLastRecentlyUsedFunctions().

◆ getCategory()

const formula::IFunctionCategory * ScFunctionMgr::getCategory ( sal_uInt32  nPos) const
overridevirtual

Returns a category.

Returns an IFunctionCategory object for a category specified by nPos.

Parameters
nPosthe index of the category, note that 0 maps to the first category not the cumulative ('All') category.
Returns
pointer to an IFunctionCategory object, null if nPos out of bounds.

Implements formula::IFunctionManager.

Definition at line 1120 of file funcdesc.cxx.

References aCatLists, m_aCategories, and MAX_FUNCCAT.

Referenced by ScFuncDesc::getCategory().

◆ GetCategoryName()

OUString ScFunctionMgr::GetCategoryName ( sal_uInt32  _nCategoryNumber)
static

Returns name of category.

Parameters
_nCategoryNumberindex of category
Returns
name of the category specified by _nCategoryNumber, empty string if _nCategoryNumber out of bounds

Definition at line 1147 of file funcdesc.cxx.

References SC_FUNCGROUP_COUNT, and ScResId().

Referenced by ScFunctionCategory::getName().

◆ getCount()

sal_uInt32 ScFunctionMgr::getCount ( ) const
overridevirtual
Returns
number of categories, not counting the cumulative category ('All')

Implements formula::IFunctionManager.

Definition at line 1115 of file funcdesc.cxx.

References MAX_FUNCCAT.

◆ getSingleToken()

sal_Unicode ScFunctionMgr::getSingleToken ( const formula::IFunctionManager::EToken  _eToken) const
overridevirtual

Maps Etoken to character.

Used for retrieving characters for parentheses and separators.

Parameters
_eTokentoken for which, the corresponding character is retrieved
Returns
character

Implements formula::IFunctionManager.

Definition at line 1158 of file funcdesc.cxx.

References formula::IFunctionManager::eArrayClose, formula::IFunctionManager::eArrayOpen, formula::IFunctionManager::eClose, formula::IFunctionManager::eOk, formula::IFunctionManager::eSep, formula::FormulaCompiler::GetNativeSymbolChar(), ocArrayClose, ocArrayOpen, ocClose, ocOpen, and ocSep.

◆ Next()

const ScFuncDesc * ScFunctionMgr::Next ( void  ) const

Returns the next function of the current category.

Returns
pointer to the next function in current category, null if current category not set.

Definition at line 1102 of file funcdesc.cxx.

References pCurCatListEnd, and pCurCatListIter.

Referenced by Get(), and ScFunctionWin::UpdateFunctionList().

Member Data Documentation

◆ aCatLists

std::vector<const ScFuncDesc*> ScFunctionMgr::aCatLists[MAX_FUNCCAT]
private

array of all categories, 0 is the cumulative ('All') category

Definition at line 400 of file funcdesc.hxx.

Referenced by First(), getCategory(), and ScFunctionMgr().

◆ m_aCategories

std::map< sal_uInt32, std::shared_ptr<ScFunctionCategory> > ScFunctionMgr::m_aCategories
mutableprivate

map of category pos to IFunctionCategory

Definition at line 401 of file funcdesc.hxx.

Referenced by getCategory().

◆ pCurCatListEnd

std::vector<constScFuncDesc*>::const_iterator ScFunctionMgr::pCurCatListEnd
mutableprivate

end of current category

Definition at line 403 of file funcdesc.hxx.

Referenced by First(), Next(), and ScFunctionMgr().

◆ pCurCatListIter

std::vector<constScFuncDesc*>::const_iterator ScFunctionMgr::pCurCatListIter
mutableprivate

position in current category

Definition at line 402 of file funcdesc.hxx.

Referenced by First(), Next(), and ScFunctionMgr().


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