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_FORMULAHELPER_HXX
21 #define INCLUDED_FORMULA_FORMULAHELPER_HXX
26 #include <formula/formuladllapi.h>
27 #include <rtl/ustring.hxx>
28 #include <sal/types.h>
29 #include <unotools/syslocale.hxx>
35 class IFunctionDescription
;
36 class IFunctionManager
;
38 class FORMULA_DLLPUBLIC FormulaHelper
40 ::std::unique_ptr
<SvtSysLocale
> m_pSysLocale
;
41 const CharClass
* m_pCharClass
;
42 const IFunctionManager
* m_pFunctionManager
;
43 const sal_Unicode open
;
44 const sal_Unicode close
;
45 const sal_Unicode sep
;
46 const sal_Unicode arrayOpen
;
47 const sal_Unicode arrayClose
;
49 FormulaHelper(const IFunctionManager
* _pFunctionManager
);
51 const CharClass
* GetCharClass() const { return m_pCharClass
; }
53 bool GetNextFunc( const OUString
& rFormula
,
55 sal_Int32
& rFStart
, // input and output
56 sal_Int32
* pFEnd
= nullptr,
57 const IFunctionDescription
** ppFDesc
= nullptr,
58 ::std::vector
< OUString
>* pArgs
= nullptr ) const;
60 sal_Int32
GetFunctionStart( const OUString
& rFormula
, sal_Int32 nStart
,
61 bool bBack
, OUString
* pFuncName
= nullptr ) const;
63 sal_Int32
GetFunctionEnd ( const OUString
& rFormula
, sal_Int32 nStart
) const;
65 sal_Int32
GetArgStart ( const OUString
& rFormula
, sal_Int32 nStart
,
66 sal_uInt16 nArg
) const;
68 void GetArgStrings ( ::std::vector
< OUString
>& _rArgs
,
69 const OUString
& rFormula
,
71 sal_uInt16 nArgs
) const;
73 void FillArgStrings ( const OUString
& rFormula
,
76 ::std::vector
< OUString
>& _rArgs
) const;
82 #endif // INCLUDED_FORMULA_FORMULAHELPER_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */