build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / formula / IFunctionDescription.hxx
blob40820ebbe04099d892fa388ae1abff7f4ac2cfae
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FORMULA_IFUNCTIONDESCRIPTION_HXX
21 #define INCLUDED_FORMULA_IFUNCTIONDESCRIPTION_HXX
23 #include <memory>
24 #include <vector>
26 #include <com/sun/star/table/CellAddress.hpp>
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/uno/Sequence.hxx>
29 #include <rtl/string.hxx>
30 #include <rtl/ustring.hxx>
31 #include <sal/types.h>
33 namespace com { namespace sun { namespace star {
34 namespace sheet { struct FormulaToken; }
35 namespace sheet { class XFormulaOpCodeMapper; }
36 namespace sheet { class XFormulaParser; }
37 } } }
39 namespace formula
41 class IFunctionCategory;
42 class IFunctionDescription;
43 class FormEditData;
44 class FormulaTokenArray;
46 class SAL_NO_VTABLE IFunctionManager
48 public:
49 IFunctionManager(){}
50 enum EToken
52 eOk,
53 eClose,
54 eSep,
55 eArrayOpen,
56 eArrayClose
58 virtual sal_uInt32 getCount() const = 0;
59 virtual const IFunctionCategory* getCategory(sal_uInt32 nPos) const = 0;
60 virtual void fillLastRecentlyUsedFunctions(::std::vector< const IFunctionDescription*>& _rLastRUFunctions) const = 0;
62 virtual sal_Unicode getSingleToken(const EToken _eToken) const = 0;
64 protected:
65 ~IFunctionManager() {}
68 class SAL_NO_VTABLE IFunctionCategory
70 public:
71 IFunctionCategory(){}
72 virtual sal_uInt32 getCount() const = 0;
73 virtual const IFunctionDescription* getFunction(sal_uInt32 _nPos) const = 0;
74 virtual sal_uInt32 getNumber() const = 0;
75 virtual OUString getName() const = 0;
77 protected:
78 ~IFunctionCategory() {}
81 class SAL_NO_VTABLE IFunctionDescription
83 public:
84 IFunctionDescription(){}
85 virtual OUString getFunctionName() const = 0;
86 virtual const IFunctionCategory* getCategory() const = 0;
87 virtual OUString getDescription() const = 0;
88 // GetSuppressedArgCount
89 virtual sal_Int32 getSuppressedArgumentCount() const = 0;
90 // GetFormulaString
91 virtual OUString getFormula(const ::std::vector< OUString >& _aArguments) const = 0;
92 // GetVisibleArgMapping
93 virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const = 0;
94 virtual void initArgumentInfo() const = 0;
95 virtual OUString getSignature() const = 0;
96 virtual OString getHelpId() const = 0;
97 virtual bool isHidden() const = 0;
99 // parameter
100 virtual sal_uInt32 getParameterCount() const = 0;
101 virtual sal_uInt32 getVarArgsStart() const = 0;
102 virtual OUString getParameterName(sal_uInt32 _nPos) const = 0;
103 virtual OUString getParameterDescription(sal_uInt32 _nPos) const = 0;
104 virtual bool isParameterOptional(sal_uInt32 _nPos) const = 0;
106 protected:
107 ~IFunctionDescription() {}
110 class SAL_NO_VTABLE IFormulaToken
112 public:
113 virtual bool isFunction() const = 0;
114 virtual sal_uInt32 getArgumentCount() const = 0;
116 protected:
117 ~IFormulaToken() {}
120 class SAL_NO_VTABLE IFormulaEditorHelper
122 public:
123 IFormulaEditorHelper(){}
124 virtual void notifyChange() = 0;
125 virtual void fill() = 0;
127 virtual OUString getCurrentFormula() const = 0;
128 virtual void setCurrentFormula(const OUString& _sReplacement) = 0;
130 virtual void getSelection(sal_Int32& _nStart, sal_Int32& _nEnd) const = 0;
131 virtual void setSelection(sal_Int32 _nStart, sal_Int32 _nEnd) = 0;
133 virtual FormEditData* getFormEditData() const = 0;
134 virtual bool calculateValue(const OUString& _sExpression, OUString& _rResult, bool bMatrixFormula) = 0;
136 virtual void switchBack() = 0;
138 virtual void clear() = 0;
139 virtual void deleteFormData() = 0;
141 virtual IFunctionManager* getFunctionManager() = 0;
142 virtual ::std::unique_ptr<FormulaTokenArray> convertToTokenArray(const css::uno::Sequence< css::sheet::FormulaToken >& _aTokenList) = 0;
144 virtual css::uno::Reference< css::sheet::XFormulaParser> getFormulaParser() const = 0;
145 virtual css::uno::Reference< css::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;
146 virtual css::table::CellAddress getReferencePosition() const = 0;
148 virtual void setDispatcherLock( bool bLock ) = 0;
149 virtual void dispatch(bool _bOK, bool _bMatrixChecked) = 0;
150 virtual void doClose(bool _bOk) = 0;
151 virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0;
152 virtual void showReference(const OUString& _sFormula) = 0;
154 protected:
155 ~IFormulaEditorHelper() {}
159 #endif // INCLUDED_FORMULA_IFUNCTIONDESCRIPTION_HXX
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */