nss: upgrade to release 3.73
[LibreOffice.git] / include / formula / formula.hxx
blobaed0e1b0d714fc2283395bf2e97e1bde53d45dac
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_FORMULA_HXX
21 #define INCLUDED_FORMULA_FORMULA_HXX
23 #include <memory>
24 #include <utility>
26 #include <formula/formuladllapi.h>
27 #include <formula/IFunctionDescription.hxx>
28 #include <o3tl/deleter.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
31 #include <sfx2/basedlgs.hxx>
32 #include <tools/gen.hxx>
34 class NotifyEvent;
35 class SfxBindings;
36 class SfxChildWindow;
38 namespace formula
41 #define STRUCT_END 1
42 #define STRUCT_FOLDER 2
43 #define STRUCT_ERROR 3
45 enum class FormulaDlgMode { Formula, Edit };
48 class FormulaDlg_Impl;
49 class IControlReferenceHandler;
50 class FormulaHelper;
51 class RefEdit;
52 class RefButton;
53 class FormEditData;
55 class FORMULA_DLLPUBLIC FormulaModalDialog
56 : public weld::GenericDialogController, public formula::IFormulaEditorHelper
58 friend class FormulaDlg_Impl;
59 public:
60 FormulaModalDialog(weld::Window* pParent, IFunctionManager const * _pFunctionMgr,
61 IControlReferenceHandler* _pDlg);
62 virtual ~FormulaModalDialog() override;
64 private:
65 std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl;
67 protected:
69 ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
70 void RefInputStartAfter();
71 void RefInputDoneAfter();
73 void SetMeText(const OUString& _sText);
74 void Update();
75 void CheckMatrix(OUString& aFormula /*IN/OUT*/);
76 void Update(const OUString& _sExp);
78 void StoreFormEditData(FormEditData* pData);
81 class FORMULA_DLLPUBLIC FormulaDlg:
82 public SfxModelessDialogController, public IFormulaEditorHelper
84 friend class FormulaDlg_Impl;
85 public:
86 FormulaDlg(SfxBindings* pB, SfxChildWindow* pCW,
87 weld::Window* pParent,
88 IFunctionManager const * _pFunctionMgr,
89 IControlReferenceHandler* _pDlg);
90 virtual ~FormulaDlg() override;
91 private:
92 std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl;
94 protected:
95 void disableOk();
97 protected:
99 ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
100 void RefInputStartAfter();
101 void RefInputDoneAfter( bool bForced );
103 void SetMeText(const OUString& _sText);
104 FormulaDlgMode SetMeText(const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate);
105 void Update();
106 bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
107 OUString GetMeText() const;
108 void Update(const OUString& _sExp);
109 void DoEnter();
110 const IFunctionDescription* getCurrentFunctionDescription() const;
111 bool UpdateParaWin(Selection& _rSelection);
112 void UpdateParaWin(const Selection& _rSelection, const OUString& _sRefStr);
113 RefEdit* GetActiveEdit();
114 void SetEdSelection();
116 void StoreFormEditData(FormEditData* pData);
118 const FormulaHelper& GetFormulaHelper() const;
121 } // formula
123 #endif // INCLUDED_FORMULA_FORMULA_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */