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