LibreOffice Module reportdesign (master)  1
FunctionHelper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FUNCTIONHELPER_HXX
21 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FUNCTIONHELPER_HXX
22 
24 #include <com/sun/star/report/meta/XFunctionManager.hpp>
25 #include <com/sun/star/report/meta/XFunctionCategory.hpp>
26 #include <com/sun/star/report/meta/XFunctionDescription.hpp>
27 #include <map>
28 #include <memory>
29 #include <vector>
30 
31 namespace rptui
32 {
33 
34 class FunctionCategory;
35 class FunctionDescription;
36 
38 {
39  typedef std::map< OUString, std::shared_ptr< FunctionDescription > > TFunctionsMap;
40  typedef std::map< OUString, std::shared_ptr< FunctionCategory > > TCategoriesMap;
41  css::uno::Reference< css::report::meta::XFunctionManager> m_xMgr;
42  mutable TCategoriesMap m_aCategories;
43  mutable ::std::vector< TCategoriesMap::iterator > m_aCategoryIndex;
44  mutable TFunctionsMap m_aFunctions;
45 public:
46  FunctionManager(const css::uno::Reference< css::report::meta::XFunctionManager>& _xMgr);
47  virtual ~FunctionManager();
48  virtual sal_uInt32 getCount() const override;
49  virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const override;
50  virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const override;
51  virtual sal_Unicode getSingleToken(const EToken _eToken) const override;
52 
53  std::shared_ptr< FunctionDescription > get(const css::uno::Reference< css::report::meta::XFunctionDescription>& _xFunctionDescription) const;
54 };
55 
57 {
58  css::uno::Sequence< css::sheet::FunctionArgument > m_aParameter;
59  css::uno::Reference< css::report::meta::XFunctionDescription> m_xFunctionDescription;
61 public:
62  FunctionDescription(const formula::IFunctionCategory* _pFunctionCategory,const css::uno::Reference< css::report::meta::XFunctionDescription>& _xFunctionDescription);
64 
65  virtual OUString getFunctionName() const override ;
66  virtual const formula::IFunctionCategory* getCategory() const override ;
67  virtual OUString getDescription() const override ;
68  virtual sal_Int32 getSuppressedArgumentCount() const override ;
69  virtual OUString getFormula(const ::std::vector< OUString >& _aArguments) const override ;
70  virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const override ;
71  virtual void initArgumentInfo() const override;
72  virtual OUString getSignature() const override ;
73  virtual OString getHelpId() const override ;
74  virtual bool isHidden() const override;
75  virtual sal_uInt32 getParameterCount() const override ;
76  virtual sal_uInt32 getVarArgsStart() const override;
77  virtual sal_uInt32 getVarArgsLimit() const override;
78  virtual OUString getParameterName(sal_uInt32 _nPos) const override ;
79  virtual OUString getParameterDescription(sal_uInt32 _nPos) const override ;
80  virtual bool isParameterOptional(sal_uInt32 _nPos) const override ;
81 };
82 
84 {
85  mutable ::std::vector< std::shared_ptr< FunctionDescription > > m_aFunctions;
86  css::uno::Reference< css::report::meta::XFunctionCategory> m_xCategory;
87  sal_uInt32 m_nFunctionCount;
88  sal_uInt32 m_nNumber;
90 public:
91  FunctionCategory(const FunctionManager* _pFMgr,sal_uInt32 _nPos,const css::uno::Reference< css::report::meta::XFunctionCategory>& _xCategory);
92  virtual ~FunctionCategory() {}
93 
94  virtual sal_uInt32 getCount() const override;
95  virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const override;
96  virtual sal_uInt32 getNumber() const override;
97  virtual OUString getName() const override;
98 };
99 
100 } // rptui
101 
102 
103 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FUNCTIONHELPER_HXX
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::report::meta::XFunctionCategory > m_xCategory
FunctionManager(const css::uno::Reference< css::report::meta::XFunctionManager > &_xMgr)
virtual bool isHidden() const override
FunctionCategory(const FunctionManager *_pFMgr, sal_uInt32 _nPos, const css::uno::Reference< css::report::meta::XFunctionCategory > &_xCategory)
virtual sal_Int32 getSuppressedArgumentCount() const override
virtual void fillVisibleArgumentMapping(::std::vector< sal_uInt16 > &_rArguments) const override
std::map< OUString, std::shared_ptr< FunctionCategory > > TCategoriesMap
mutable::std::vector< std::shared_ptr< FunctionDescription > > m_aFunctions
virtual OUString getParameterName(sal_uInt32 _nPos) const override
sal_uInt16 sal_Unicode
TCategoriesMap m_aCategories
virtual const formula::IFunctionCategory * getCategory(sal_uInt32 nPos) const override
const formula::IFunctionCategory * m_pFunctionCategory
virtual const formula::IFunctionDescription * getFunction(sal_uInt32 _nPos) const override
css::uno::Sequence< css::sheet::FunctionArgument > m_aParameter
FunctionDescription(const formula::IFunctionCategory *_pFunctionCategory, const css::uno::Reference< css::report::meta::XFunctionDescription > &_xFunctionDescription)
virtual OUString getSignature() const override
TFunctionsMap m_aFunctions
virtual sal_uInt32 getCount() const override
virtual sal_uInt32 getCount() const override
css::uno::Reference< css::report::meta::XFunctionDescription > m_xFunctionDescription
css::uno::Reference< css::report::meta::XFunctionManager > m_xMgr
virtual sal_uInt32 getVarArgsStart() const override
virtual sal_uInt32 getParameterCount() const override
virtual bool isParameterOptional(sal_uInt32 _nPos) const override
virtual OUString getParameterDescription(sal_uInt32 _nPos) const override
virtual OUString getName() const override
virtual OUString getDescription() const override
virtual const formula::IFunctionCategory * getCategory() const override
virtual OUString getFormula(const ::std::vector< OUString > &_aArguments) const override
virtual OString getHelpId() const override
virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription * > &_rLastRUFunctions) const override
mutable::std::vector< TCategoriesMap::iterator > m_aCategoryIndex
const FunctionManager * m_pFunctionManager
virtual sal_Unicode getSingleToken(const EToken _eToken) const override
virtual void initArgumentInfo() const override
virtual OUString getFunctionName() const override
virtual sal_uInt32 getNumber() const override
std::map< OUString, std::shared_ptr< FunctionDescription > > TFunctionsMap
virtual sal_uInt32 getVarArgsLimit() const override