[Libreoffice-commits] .: 2 commits - sc/inc
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Jan 24 11:24:38 PST 2011
sc/inc/funcdesc.hxx | 216 ++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 169 insertions(+), 47 deletions(-)
New commits:
commit 56498044c62080bd353d9f9e89906dea1c159407
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Sun Jan 23 18:32:50 2011 +0100
Added doxygen style comments to ScFunctionCategory.
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index c864555..562f84c 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -253,21 +253,44 @@ private:
/**
Category of spreadsheet functions.
+
+ Contains the name, index and function manager of a category,
+ as well as a list of functions in the category
*/
class ScFunctionCategory : public formula::IFunctionCategory
{
- ScFunctionMgr* m_pMgr;
- List* m_pCategory;
- mutable ::rtl::OUString m_sName;
- sal_uInt32 m_nCategory;
public:
- ScFunctionCategory(ScFunctionMgr* _pMgr,List* _pCategory,sal_uInt32 _nCategory) : m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
+ ScFunctionCategory(ScFunctionMgr* _pMgr,List* _pCategory,sal_uInt32 _nCategory)
+ : m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
virtual ~ScFunctionCategory(){}
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionManager* getFunctionManager() const;
- virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
- virtual sal_uInt32 getNumber() const;
- virtual ::rtl::OUString getName() const;
+
+ /**
+ @return count of functions in this category
+ */
+ virtual sal_uInt32 getCount() const;
+ virtual const formula::IFunctionManager* getFunctionManager() const;
+
+ /**
+ Gives the _nPos'th function in this category.
+
+ @param _nPos
+ position of function in this category.
+
+ @return function at the _nPos postion in this category, null if _nPos out of bounds.
+ */
+ virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
+
+ /**
+ @return index number of this category.
+ */
+ virtual sal_uInt32 getNumber() const;
+ virtual ::rtl::OUString getName() const;
+
+private:
+ ScFunctionMgr* m_pMgr; /**< function manager for this category */
+ List* m_pCategory; /**< list of functions in this category */
+ mutable ::rtl::OUString m_sName; /**< name of this category */
+ sal_uInt32 m_nCategory; /**< index number of this category */
};
#define SC_FUNCGROUP_COUNT ID_FUNCTION_GRP_ADDINS
commit a59ac09d7e174ea4c87de99516db4c3d046b1995
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Sat Jan 22 21:06:03 2011 +0100
Added doxygen style comments to ScFunctionMgr and ScFunctionList
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index bad1501..c864555 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -51,7 +51,7 @@ class ScFunctionMgr;
/**
Stores and generates human readable descriptions for spreadsheet-functions,
- e.g. functions used in formulas in calc
+ e.g.\ functions used in formulas in calc
*/
class ScFuncDesc : public formula::IFunctionDescription
{
@@ -191,31 +191,37 @@ public:
*/
struct ParameterFlags
{
- bool bOptional :1; // Parameter is optional
- bool bSuppress :1; // Suppress parameter in UI because not implemented yet
+ bool bOptional :1; /**< Parameter is optional */
+ bool bSuppress :1; /**< Suppress parameter in UI because not implemented yet */
ParameterFlags() : bOptional(false), bSuppress(false) {}
};
- ::rtl::OUString *pFuncName; // Function name
- ::rtl::OUString *pFuncDesc; // Description of function
- ::rtl::OUString **ppDefArgNames; // Parameter name(s)
- ::rtl::OUString **ppDefArgDescs; // Description(s) of parameter(s)
- ParameterFlags *pDefArgFlags; // Flags for each parameter
- sal_uInt16 nFIndex; // Unique function index
- sal_uInt16 nCategory; // Function category
- sal_uInt16 nArgCount; // All parameter count, suppressed and unsuppressed
- sal_uInt16 nHelpId; // HelpId of function
- bool bIncomplete :1; // Incomplete argument info (set for add-in info from configuration)
- bool bHasSuppressedArgs :1; // Whether there is any suppressed parameter.
+ ::rtl::OUString *pFuncName; /**< Function name */
+ ::rtl::OUString *pFuncDesc; /**< Description of function */
+ ::rtl::OUString **ppDefArgNames; /**< Parameter name(s) */
+ ::rtl::OUString **ppDefArgDescs; /**< Description(s) of parameter(s) */
+ ParameterFlags *pDefArgFlags; /**< Flags for each parameter */
+ sal_uInt16 nFIndex; /**< Unique function index */
+ sal_uInt16 nCategory; /**< Function category */
+ sal_uInt16 nArgCount; /**< All parameter count, suppressed and unsuppressed */
+ sal_uInt16 nHelpId; /**< HelpId of function */
+ bool bIncomplete :1; /**< Incomplete argument info (set for add-in info from configuration) */
+ bool bHasSuppressedArgs :1; /**< Whether there is any suppressed parameter. */
};
-
-
-//============================================================================
-
+/**
+ List of spreadsheet functions.
+ Generated by retrieving functions from resources, AddIns and StarOne AddIns,
+ and storing these in one linked list. Functions can be retrieved by index and
+ by iterating through the list, starting at the First element, and retrieving
+ the Next elements one by one.
+
+ The length of the longest function name can be retrieved for easier
+ processing (i.e printing a function list).
+*/
class ScFunctionList
{
public:
@@ -241,11 +247,13 @@ public:
{ return nMaxFuncNameLen; }
private:
- List aFunctionList;
- xub_StrLen nMaxFuncNameLen;
+ List aFunctionList; /**< List of functions */
+ xub_StrLen nMaxFuncNameLen; /**< Length of longest function name */
};
-//============================================================================
+/**
+ Category of spreadsheet functions.
+*/
class ScFunctionCategory : public formula::IFunctionCategory
{
ScFunctionMgr* m_pMgr;
@@ -261,34 +269,125 @@ public:
virtual sal_uInt32 getNumber() const;
virtual ::rtl::OUString getName() const;
};
-//============================================================================
+
#define SC_FUNCGROUP_COUNT ID_FUNCTION_GRP_ADDINS
+/**
+ Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them accessible.
+*/
class ScFunctionMgr : public formula::IFunctionManager
{
public:
+ /**
+ Retrieves all calc functions, generates cumulative ('All') category, and the categories.
+
+ The function lists of the categories are sorted by (case insensitive) function name
+ */
ScFunctionMgr();
virtual ~ScFunctionMgr();
- static ::rtl::OUString GetCategoryName(sal_uInt32 _nCategoryNumber );
+ /**
+ Returns name of category.
+
+ @param _nCategoryNumber
+ index of category
+
+ @return name of the category specified by _nCategoryNumber, empty string if _nCategoryNumber out of bounds
+ */
+ static ::rtl::OUString GetCategoryName(sal_uInt32 _nCategoryNumber );
+
+ /**
+ Returns function by name.
+
+ Searches for a function with the function name rFName, while ignoring case.
+
+ @param rFName
+ name of the function
+
+ @return pointer to function with the name rFName, null if no such function was found.
+ */
+ const ScFuncDesc* Get( const ::rtl::OUString& rFName ) const;
+
+ /**
+ Returns function by index.
+
+ Searches for a function with the function index nFIndex.
+
+ @param nFIndex
+ index of the function
+
+ @return pointer to function with the index nFIndex, null if no such function was found.
+ */
+ const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
+
+ /**
+ Returns the first function in category nCategory.
- const ScFuncDesc* Get( const ::rtl::OUString& rFName ) const;
- const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
- const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
- const ScFuncDesc* Next() const;
+ Selects nCategory as current category and returns first element of this.
+
+ @param nCategory
+ index of requested category
+
+ @return pointer to first element in current category, null if nCategory out of bounds
+ */
+ const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
+
+ /**
+ Returns the next function of the current category.
+
+ @return pointer to the next function in current category, null if current category not set.
+ */
+ const ScFuncDesc* Next() const;
+
+ /**
+ @return number of categories, not counting the cumulative category ('All')
+ */
+ virtual sal_uInt32 getCount() const;
+
+ /**
+ Returns a category.
+
+ Creates an IFunctionCategory object from a category specified by nPos.
+
+ @param nPos
+ the index of the category, note that 0 maps to the first category not the cumulative ('All') category.
+
+ @return pointer to an IFunctionCategory object, null if nPos out of bounds.
+ */
+ virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
+
+ /**
+ Appends the last recently used functions.
+
+ Takes the last recently used functions, but maximal LRU_MAX, and appends them to the given vector _rLastRUFunctions.
+
+ @param _rLastRUFunctions
+ a vector of pointer to IFunctionDescription, by reference.
+ */
+ virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const;
+
+ /**
+ Implemented because of inheritance \see ScFunctionMgr::Get(const ::rtl::OUString&) const
+ */
+ virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString& _sFunctionName) const;
+
+ /**
+ Maps Etoken to character
+
+ Used for retrieving characters for parantheses and separators.
+
+ @param _eToken
+ token for which, the corresponding character is retrieved
+
+ @return character
+ */
+ virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const;
- // formula::IFunctionManager
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
- virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const;
- virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString& _sFunctionName) const;
- virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const;
private:
- ScFunctionList* pFuncList;
- List* aCatLists[MAX_FUNCCAT];
- mutable List* pCurCatList;
+ ScFunctionList* pFuncList; /**< list of all calc functions */
+ List* aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative ('All') category */
+ mutable List* pCurCatList; /**< pointer to current category */
};
-//============================================================================
#endif // SC_FUNCDESC_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list