make ValueTransfer easier to understand
[LibreOffice.git] / include / formula / formulahelper.hxx
blob02f757dc3726bdc2b74e6099cc589e1c5fa4137d
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_FORMULAHELPER_HXX
21 #define INCLUDED_FORMULA_FORMULAHELPER_HXX
23 #include <memory>
24 #include <vector>
26 #include <formula/formuladllapi.h>
27 #include <rtl/ustring.hxx>
28 #include <sal/types.h>
29 #include <unotools/syslocale.hxx>
31 class CharClass;
33 namespace formula
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;
48 public:
49 FormulaHelper(const IFunctionManager* _pFunctionManager);
51 const CharClass* GetCharClass() const { return m_pCharClass; }
53 sal_Int32 GetCategoryCount() const;
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;
62 sal_Int32 GetFunctionStart( const OUString& rFormula, sal_Int32 nStart,
63 bool bBack, OUString* pFuncName = nullptr ) const;
65 sal_Int32 GetFunctionEnd ( const OUString& rFormula, sal_Int32 nStart ) const;
67 sal_Int32 GetArgStart ( const OUString& rFormula, sal_Int32 nStart,
68 sal_uInt16 nArg ) const;
70 void GetArgStrings ( ::std::vector< OUString >& _rArgs,
71 const OUString& rFormula,
72 sal_Int32 nFuncPos,
73 sal_uInt16 nArgs ) const;
75 void FillArgStrings ( const OUString& rFormula,
76 sal_Int32 nFuncPos,
77 sal_uInt16 nArgs,
78 ::std::vector< OUString >& _rArgs ) const;
81 } // formula
84 #endif // INCLUDED_FORMULA_FORMULAHELPER_HXX
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */