/src/libreoffice/include/formula/formulahelper.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include <vector> |
23 | | |
24 | | #include <formula/formuladllapi.h> |
25 | | #include <rtl/ustring.hxx> |
26 | | #include <sal/types.h> |
27 | | #include <unotools/syslocale.hxx> |
28 | | |
29 | | class CharClass; |
30 | | |
31 | | namespace formula |
32 | | { |
33 | | class IFunctionDescription; |
34 | | class IFunctionManager; |
35 | | |
36 | | class FORMULA_DLLPUBLIC FormulaHelper |
37 | | { |
38 | | SvtSysLocale m_aSysLocale; |
39 | | const CharClass& m_rCharClass; |
40 | | const IFunctionManager* m_pFunctionManager; |
41 | | const sal_Unicode open; |
42 | | const sal_Unicode close; |
43 | | const sal_Unicode sep; |
44 | | const sal_Unicode arrayOpen; |
45 | | const sal_Unicode arrayClose; |
46 | | const sal_Unicode tableRefOpen; |
47 | | const sal_Unicode tableRefClose; |
48 | | public: |
49 | | FormulaHelper(const IFunctionManager* _pFunctionManager); |
50 | | |
51 | 0 | const CharClass& GetCharClass() const { return m_rCharClass; } |
52 | | |
53 | | sal_Int32 GetCategoryCount() const; |
54 | | |
55 | | bool GetNextFunc( const OUString& rFormula, |
56 | | bool bBack, |
57 | | sal_Int32& rFStart, // input and output |
58 | | sal_Int32* pFEnd = nullptr, |
59 | | const IFunctionDescription** ppFDesc = nullptr, |
60 | | ::std::vector< OUString>* pArgs = nullptr ) const; |
61 | | |
62 | | sal_Int32 GetFunctionStart( const OUString& rFormula, sal_Int32 nStart, |
63 | | bool bBack, OUString* pFuncName = nullptr ) const; |
64 | | |
65 | | sal_Int32 GetFunctionEnd ( std::u16string_view rFormula, sal_Int32 nStart ) const; |
66 | | |
67 | | sal_Int32 GetArgStart ( std::u16string_view rFormula, sal_Int32 nStart, |
68 | | sal_uInt16 nArg ) const; |
69 | | |
70 | | void GetArgStrings ( ::std::vector< OUString >& _rArgs, |
71 | | std::u16string_view rFormula, |
72 | | sal_Int32 nFuncPos, |
73 | | sal_uInt16 nArgs ) const; |
74 | | |
75 | | void FillArgStrings ( std::u16string_view rFormula, |
76 | | sal_Int32 nFuncPos, |
77 | | sal_uInt16 nArgs, |
78 | | ::std::vector< OUString >& _rArgs ) const; |
79 | | }; |
80 | | |
81 | | } // formula |
82 | | |
83 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |