bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / formula / IFunctionDescription.hxx
blob5d4616b9b9e5cb5118d21ac67249972df23a6ed4
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 <rtl/string.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
32 namespace com { namespace sun { namespace star {
33 namespace sheet { struct FormulaToken; }
34 namespace sheet { class XFormulaOpCodeMapper; }
35 namespace sheet { class XFormulaParser; }
36 } } }
38 namespace com::sun::star::uno { template <class E> class Sequence; }
40 namespace formula
42 class IFunctionCategory;
43 class IFunctionDescription;
44 class FormEditData;
45 class FormulaTokenArray;
46 class FormulaCompiler;
48 class SAL_NO_VTABLE IFunctionManager
50 public:
51 IFunctionManager(){}
52 enum EToken
54 eOk,
55 eClose,
56 eSep,
57 eArrayOpen,
58 eArrayClose
60 virtual sal_uInt32 getCount() const = 0;
61 virtual const IFunctionCategory* getCategory(sal_uInt32 nPos) const = 0;
62 virtual void fillLastRecentlyUsedFunctions(::std::vector< const IFunctionDescription*>& _rLastRUFunctions) const = 0;
64 virtual sal_Unicode getSingleToken(const EToken _eToken) const = 0;
66 protected:
67 ~IFunctionManager() {}
70 class SAL_NO_VTABLE IFunctionCategory
72 public:
73 IFunctionCategory(){}
74 virtual sal_uInt32 getCount() const = 0;
75 virtual const IFunctionDescription* getFunction(sal_uInt32 _nPos) const = 0;
76 virtual sal_uInt32 getNumber() const = 0;
77 virtual OUString getName() const = 0;
79 protected:
80 ~IFunctionCategory() {}
83 class SAL_NO_VTABLE IFunctionDescription
85 public:
86 IFunctionDescription(){}
87 virtual OUString getFunctionName() const = 0;
88 virtual const IFunctionCategory* getCategory() const = 0;
89 virtual OUString getDescription() const = 0;
90 // GetSuppressedArgCount
91 virtual sal_Int32 getSuppressedArgumentCount() const = 0;
92 // GetFormulaString
93 virtual OUString getFormula(const ::std::vector< OUString >& _aArguments) const = 0;
94 // GetVisibleArgMapping
95 virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const = 0;
96 virtual void initArgumentInfo() const = 0;
97 virtual OUString getSignature() const = 0;
98 virtual OString getHelpId() const = 0;
99 virtual bool isHidden() const = 0;
101 // parameter
102 virtual sal_uInt32 getParameterCount() const = 0;
103 virtual sal_uInt32 getVarArgsStart() const = 0;
104 virtual OUString getParameterName(sal_uInt32 _nPos) const = 0;
105 virtual OUString getParameterDescription(sal_uInt32 _nPos) const = 0;
106 virtual bool isParameterOptional(sal_uInt32 _nPos) const = 0;
108 protected:
109 ~IFunctionDescription() {}
112 class SAL_NO_VTABLE IFormulaEditorHelper
114 public:
115 IFormulaEditorHelper(){}
116 virtual void notifyChange() = 0;
117 virtual void fill() = 0;
119 virtual OUString getCurrentFormula() const = 0;
120 virtual void setCurrentFormula(const OUString& _sReplacement) = 0;
122 virtual void getSelection(sal_Int32& _nStart, sal_Int32& _nEnd) const = 0;
123 virtual void setSelection(sal_Int32 _nStart, sal_Int32 _nEnd) = 0;
125 virtual FormEditData* getFormEditData() const = 0;
126 virtual bool calculateValue(const OUString& _sExpression, OUString& _rResult, bool bMatrixFormula) = 0;
128 /** Obtain a resident FormulaCompiler instance, created without
129 FormulaTokenArray and reused but being application specific derived.
131 virtual std::shared_ptr<FormulaCompiler> getCompiler() const = 0;
133 /** Create an application specific FormulaCompiler instance with
134 FormulaTokenArray. The FormulaTokenArray had to be created using
135 convertToTokenArray().
137 virtual std::unique_ptr<FormulaCompiler> createCompiler( FormulaTokenArray& rArray ) const = 0;
139 virtual void switchBack() = 0;
141 virtual void clear() = 0;
142 virtual void deleteFormData() = 0;
144 virtual IFunctionManager* getFunctionManager() = 0;
145 virtual ::std::unique_ptr<FormulaTokenArray> convertToTokenArray(const css::uno::Sequence< css::sheet::FormulaToken >& _aTokenList) = 0;
147 virtual css::uno::Reference< css::sheet::XFormulaParser> getFormulaParser() const = 0;
148 virtual css::uno::Reference< css::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;
149 virtual css::table::CellAddress getReferencePosition() const = 0;
151 virtual void setDispatcherLock( bool bLock ) = 0;
152 virtual void dispatch(bool _bOK, bool _bMatrixChecked) = 0;
153 virtual void doClose(bool _bOk) = 0;
154 virtual void insertEntryToLRUList(const IFunctionDescription* pDesc) = 0;
155 virtual void showReference(const OUString& _sFormula) = 0;
157 protected:
158 ~IFormulaEditorHelper() {}
162 #endif // INCLUDED_FORMULA_IFUNCTIONDESCRIPTION_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */