LibreOffice Module reportdesign (master) 1
Formula.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FORMULA_HXX
21#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FORMULA_HXX
22
23#include <formula/formula.hxx>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/report/meta/XFormulaParser.hpp>
27#include <memory>
28
29namespace com::sun::star::lang {
30 class XMultiServiceFactory;
31}
32
33namespace svl {
34
35class SharedStringPool;
36
37}
38
39namespace rptui
40{
41
42class OAddFieldWindow;
43
44
47{
48 std::shared_ptr<formula::IFunctionManager> m_aFunctionManager;
49 std::unique_ptr<formula::FormEditData> m_xFormulaData;
50 std::shared_ptr<OAddFieldWindow> m_xAddField;
51 css::uno::Reference < css::beans::XPropertySet > m_xRowSet;
52 css::uno::Reference< css::report::meta::XFormulaParser> m_xParser;
53 css::uno::Reference< css::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
55 OUString m_sFormula;
56 sal_Int32 m_nStart;
57 sal_Int32 m_nEnd;
58
60
61 DECL_LINK( OnClickHdl, OAddFieldWindow&, void );
62public:
64 , const css::uno::Reference< css::lang::XMultiServiceFactory>& _xServiceFactory
65 , const std::shared_ptr< formula::IFunctionManager >& _pFunctionMgr
66 , const OUString& _sFormula
67 , css::uno::Reference < css::beans::XPropertySet > _xRowSet
68 , svl::SharedStringPool& rStrPool );
69
70 virtual ~FormulaDialog() override;
71
72 // IFormulaEditorHelper
73 virtual void notifyChange() override;
74 virtual void fill() override;
75 virtual bool calculateValue(const OUString& _sExpression, OUString& _rResult, bool bMatrixFormula) override;
76 virtual std::shared_ptr<formula::FormulaCompiler> getCompiler() const override;
77 virtual std::unique_ptr<formula::FormulaCompiler> createCompiler( formula::FormulaTokenArray& rArray ) const override;
78 virtual void doClose(bool _bOk) override;
79 virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc) override;
80 virtual void showReference(const OUString& _sFormula) override;
81 virtual void dispatch(bool _bOK, bool _bMatrixChecked) override;
82 virtual void setDispatcherLock( bool bLock ) override;
83 virtual void deleteFormData() override;
84 virtual void clear() override;
85 virtual void switchBack() override;
86 virtual formula::FormEditData* getFormEditData() const override;
87 virtual void setCurrentFormula(const OUString& _sReplacement) override;
88 virtual void setSelection(sal_Int32 _nStart, sal_Int32 _nEnd) override;
89 virtual void getSelection(sal_Int32& _nStart, sal_Int32& _nEnd) const override;
90 virtual OUString getCurrentFormula() const override;
91
93 virtual css::uno::Reference< css::sheet::XFormulaParser> getFormulaParser() const override;
94 virtual css::uno::Reference< css::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const override;
95 virtual css::table::CellAddress getReferencePosition() const override;
96
97 virtual ::std::unique_ptr<formula::FormulaTokenArray> convertToTokenArray(const css::uno::Sequence< css::sheet::FormulaToken >& _aTokenList) override;
98
99 // IControlReferenceHandler
100 virtual void ShowReference(const OUString& _sRef) override;
101 virtual void HideReference( bool bDoneRefMode = true ) override;
102 virtual void ReleaseFocus( formula::RefEdit* pEdit ) override;
103 virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton ) override;
104};
105
106
107} // rptui
108
109
110#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_FORMULA_HXX
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void notifyChange() override
Definition: Formula.cxx:74
virtual css::table::CellAddress getReferencePosition() const override
Definition: Formula.cxx:261
virtual void getSelection(sal_Int32 &_nStart, sal_Int32 &_nEnd) const override
Definition: Formula.cxx:174
virtual void insertEntryToLRUList(const formula::IFunctionDescription *pDesc) override
Definition: Formula.cxx:126
virtual void setSelection(sal_Int32 _nStart, sal_Int32 _nEnd) override
Definition: Formula.cxx:161
css::uno::Reference< css::report::meta::XFormulaParser > m_xParser
Definition: Formula.hxx:52
virtual void ReleaseFocus(formula::RefEdit *pEdit) override
Definition: Formula.cxx:196
css::uno::Reference< css::beans::XPropertySet > m_xRowSet
Definition: Formula.hxx:51
FormulaDialog(weld::Window *pParent, const css::uno::Reference< css::lang::XMultiServiceFactory > &_xServiceFactory, const std::shared_ptr< formula::IFunctionManager > &_pFunctionMgr, const OUString &_sFormula, css::uno::Reference< css::beans::XPropertySet > _xRowSet, svl::SharedStringPool &rStrPool)
Definition: Formula.cxx:45
std::shared_ptr< OAddFieldWindow > m_xAddField
Definition: Formula.hxx:50
virtual OUString getCurrentFormula() const override
Definition: Formula.cxx:179
virtual void HideReference(bool bDoneRefMode=true) override
Definition: Formula.cxx:192
virtual formula::FormEditData * getFormEditData() const override
Definition: Formula.cxx:147
std::unique_ptr< formula::FormEditData > m_xFormulaData
Definition: Formula.hxx:49
virtual css::uno::Reference< css::sheet::XFormulaOpCodeMapper > getFormulaOpCodeMapper() const override
Definition: Formula.cxx:256
css::uno::Reference< css::sheet::XFormulaOpCodeMapper > m_xOpCodeMapper
Definition: Formula.hxx:53
OUString m_sFormula
Definition: Formula.hxx:55
virtual void deleteFormData() override
Definition: Formula.cxx:138
virtual std::shared_ptr< formula::FormulaCompiler > getCompiler() const override
Definition: Formula.cxx:111
virtual void switchBack() override
Definition: Formula.cxx:144
formula::RefEdit * m_pEdit
Definition: Formula.hxx:54
virtual void dispatch(bool _bOK, bool _bMatrixChecked) override
Definition: Formula.cxx:132
virtual void fill() override
Definition: Formula.cxx:78
sal_Int32 m_nEnd
Definition: Formula.hxx:57
virtual css::uno::Reference< css::sheet::XFormulaParser > getFormulaParser() const override
Definition: Formula.cxx:251
virtual ::std::unique_ptr< formula::FormulaTokenArray > convertToTokenArray(const css::uno::Sequence< css::sheet::FormulaToken > &_aTokenList) override
Definition: Formula.cxx:266
virtual bool calculateValue(const OUString &_sExpression, OUString &_rResult, bool bMatrixFormula) override
Definition: Formula.cxx:105
virtual std::unique_ptr< formula::FormulaCompiler > createCompiler(formula::FormulaTokenArray &rArray) const override
Definition: Formula.cxx:116
virtual void doClose(bool _bOk) override
Definition: Formula.cxx:121
std::shared_ptr< formula::IFunctionManager > m_aFunctionManager
Definition: Formula.hxx:48
virtual void setDispatcherLock(bool bLock) override
Definition: Formula.cxx:135
virtual void setCurrentFormula(const OUString &_sReplacement) override
Definition: Formula.cxx:151
virtual void ToggleCollapsed(formula::RefEdit *pEdit, formula::RefButton *pButton) override
Definition: Formula.cxx:200
svl::SharedStringPool & mrStringPool
Definition: Formula.hxx:59
virtual formula::IFunctionManager * getFunctionManager() override
Definition: Formula.cxx:183
virtual ~FormulaDialog() override
Definition: Formula.cxx:86
virtual void showReference(const OUString &_sFormula) override
Definition: Formula.cxx:129
virtual void clear() override
Definition: Formula.cxx:141
sal_Int32 m_nStart
Definition: Formula.hxx:56
DECL_LINK(OnClickHdl, OAddFieldWindow &, void)
virtual void ShowReference(const OUString &_sRef) override
Definition: Formula.cxx:188