LibreOffice Module formula (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_FORMULA_FORMULA_HXX
21#define INCLUDED_FORMULA_FORMULA_HXX
22
23#include <memory>
24#include <utility>
25
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>
33
34class NotifyEvent;
35class SfxBindings;
36class SfxChildWindow;
37
38namespace formula
39{
40
41#define STRUCT_END 1
42#define STRUCT_FOLDER 2
43#define STRUCT_ERROR 3
44
45enum class FormulaDlgMode { Formula, Edit };
46
47
48class FormulaDlg_Impl;
49class IControlReferenceHandler;
50class FormulaHelper;
51class RefEdit;
52class RefButton;
53class FormEditData;
54
57{
58 friend class FormulaDlg_Impl;
59public:
60 FormulaModalDialog(weld::Window* pParent, IFunctionManager const * _pFunctionMgr,
62 virtual ~FormulaModalDialog() override;
63
64private:
65 std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl;
66
67protected:
68
69 ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
70 void RefInputStartAfter();
71 void RefInputDoneAfter();
72
73 void SetMeText(const OUString& _sText);
74 void Update();
75 void CheckMatrix(OUString& aFormula /*IN/OUT*/);
76 void Update(const OUString& _sExp);
77
78 void StoreFormEditData(FormEditData* pData);
79};
80
83{
84 friend class FormulaDlg_Impl;
85public:
87 weld::Window* pParent,
88 IFunctionManager const * _pFunctionMgr,
90 virtual ~FormulaDlg() override;
91private:
92 std::unique_ptr<FormulaDlg_Impl, o3tl::default_delete<FormulaDlg_Impl>> m_pImpl;
93
94protected:
95 void disableOk();
96
97protected:
98
99 ::std::pair<RefButton*,RefEdit*> RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
100 void RefInputStartAfter();
101 void RefInputDoneAfter( bool bForced );
102
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();
115
116 void StoreFormEditData(FormEditData* pData);
117
118 const FormulaHelper& GetFormulaHelper() const;
119};
120
121} // formula
122
123#endif // INCLUDED_FORMULA_FORMULA_HXX
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< FormulaDlg_Impl, o3tl::default_delete< FormulaDlg_Impl > > m_pImpl
Definition: formula.hxx:92
std::unique_ptr< FormulaDlg_Impl, o3tl::default_delete< FormulaDlg_Impl > > m_pImpl
Definition: formula.hxx:65
#define FORMULA_DLLPUBLIC
Definition: formuladllapi.h:28
FormulaDlgMode
Definition: formula.hxx:45