1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
26 #include <com/sun/star/table/CellAddress.hpp>
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <rtl/ustring.hxx>
29 #include <sal/types.h>
31 namespace com::sun::star
{
32 namespace sheet
{ struct FormulaToken
; }
33 namespace sheet
{ class XFormulaOpCodeMapper
; }
34 namespace sheet
{ class XFormulaParser
; }
37 namespace com::sun::star::uno
{ template <class E
> class Sequence
; }
41 class IFunctionCategory
;
42 class IFunctionDescription
;
44 class FormulaTokenArray
;
45 class FormulaCompiler
;
47 class SAL_NO_VTABLE IFunctionManager
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;
67 ~IFunctionManager() {}
70 class SAL_NO_VTABLE IFunctionCategory
73 virtual sal_uInt32
getCount() const = 0;
74 virtual const IFunctionDescription
* getFunction(sal_uInt32 _nPos
) const = 0;
75 virtual sal_uInt32
getNumber() const = 0;
76 virtual OUString
getName() const = 0;
79 ~IFunctionCategory() {}
82 class SAL_NO_VTABLE 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;
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 OUString
getHelpId() const = 0;
97 virtual bool isHidden() const = 0;
100 virtual sal_uInt32
getParameterCount() const = 0;
101 virtual sal_uInt32
getVarArgsStart() const = 0;
102 virtual sal_uInt32
getVarArgsLimit() const = 0;
103 virtual OUString
getParameterName(sal_uInt32 _nPos
) const = 0;
104 virtual OUString
getParameterDescription(sal_uInt32 _nPos
) const = 0;
105 virtual bool isParameterOptional(sal_uInt32 _nPos
) const = 0;
108 ~IFunctionDescription() {}
111 class SAL_NO_VTABLE IFormulaEditorHelper
114 virtual void notifyChange() = 0;
115 virtual void fill() = 0;
117 virtual OUString
getCurrentFormula() const = 0;
118 virtual void setCurrentFormula(const OUString
& _sReplacement
) = 0;
120 virtual void getSelection(sal_Int32
& _nStart
, sal_Int32
& _nEnd
) const = 0;
121 virtual void setSelection(sal_Int32 _nStart
, sal_Int32 _nEnd
) = 0;
123 virtual FormEditData
* getFormEditData() const = 0;
124 virtual bool calculateValue(const OUString
& _sExpression
, OUString
& _rResult
, bool bMatrixFormula
) = 0;
126 /** Obtain a resident FormulaCompiler instance, created without
127 FormulaTokenArray and reused but being application specific derived.
129 virtual std::shared_ptr
<FormulaCompiler
> getCompiler() const = 0;
131 /** Create an application specific FormulaCompiler instance with
132 FormulaTokenArray. The FormulaTokenArray had to be created using
133 convertToTokenArray().
135 virtual std::unique_ptr
<FormulaCompiler
> createCompiler( FormulaTokenArray
& rArray
) const = 0;
137 virtual void switchBack() = 0;
139 virtual void clear() = 0;
140 virtual void deleteFormData() = 0;
142 virtual IFunctionManager
* getFunctionManager() = 0;
143 virtual ::std::unique_ptr
<FormulaTokenArray
> convertToTokenArray(const css::uno::Sequence
< css::sheet::FormulaToken
>& _aTokenList
) = 0;
145 virtual css::uno::Reference
< css::sheet::XFormulaParser
> getFormulaParser() const = 0;
146 virtual css::uno::Reference
< css::sheet::XFormulaOpCodeMapper
> getFormulaOpCodeMapper() const = 0;
147 virtual css::table::CellAddress
getReferencePosition() const = 0;
149 virtual void setDispatcherLock( bool bLock
) = 0;
150 virtual void dispatch(bool _bOK
, bool _bMatrixChecked
) = 0;
151 virtual void doClose(bool _bOk
) = 0;
152 virtual void insertEntryToLRUList(const IFunctionDescription
* pDesc
) = 0;
153 virtual void showReference(const OUString
& _sFormula
) = 0;
156 ~IFormulaEditorHelper() {}
160 #endif // INCLUDED_FORMULA_IFUNCTIONDESCRIPTION_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */