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

Static Public Member Functions

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

Private Attributes

std::unique_ptr< 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< const ScFuncDesc * >::iterator pCurCatListIter
 position in current category More...
 
std::vector< const ScFuncDesc * >::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 306 of file funcdesc.hxx.

Constructor & Destructor Documentation

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 1051 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 ( )
virtual

Definition at line 1094 of file funcdesc.cxx.

Member Function Documentation

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

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

Referenced by ScFunctionWin::InitLRUList().

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

References aCatLists, MAX_FUNCCAT, pCurCatListEnd, and pCurCatListIter.

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

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

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

Referenced by fillLastRecentlyUsedFunctions().

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

References aCatLists, m_aCategories, and MAX_FUNCCAT.

Referenced by ScFuncDesc::getCategory().

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

References SC_FUNCGROUP_COUNT, and ScResId().

Referenced by ScFunctionCategory::getName().

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

Implements formula::IFunctionManager.

Definition at line 1139 of file funcdesc.cxx.

References MAX_FUNCCAT.

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 1182 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.

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

References pCurCatListEnd, and pCurCatListIter.

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

Member Data Documentation

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

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

Definition at line 398 of file funcdesc.hxx.

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

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

map of category pos to IFunctionCategory

Definition at line 399 of file funcdesc.hxx.

Referenced by getCategory().

std::vector<const ScFuncDesc*>::iterator ScFunctionMgr::pCurCatListEnd
mutableprivate

end of current category

Definition at line 401 of file funcdesc.hxx.

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

std::vector<const ScFuncDesc*>::iterator ScFunctionMgr::pCurCatListIter
mutableprivate

position in current category

Definition at line 400 of file funcdesc.hxx.

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


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