nss: upgrade to release 3.73
[LibreOffice.git] / sc / source / ui / inc / namemgrtable.hxx
blobd092f7d18cf7fd53b7a4e1491b738cf7f5c140c3
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/.
8 */
10 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAMEMGRTABLE_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_NAMEMGRTABLE_HXX
13 #include <vcl/weld.hxx>
15 #include <address.hxx>
17 #include <memory>
18 #include <vector>
19 #include <map>
21 class ScRangeName;
22 class ScRangeData;
24 struct ScRangeNameLine
26 OUString aName;
27 OUString aExpression;
28 OUString aScope;
31 class SC_DLLPUBLIC ScRangeManagerTable
33 private:
34 std::unique_ptr<weld::TreeView> m_xTreeView;
36 OUString maGlobalString;
38 // should be const because we should not modify it here
39 const std::map<OUString, std::unique_ptr<ScRangeName>>& m_RangeMap;
40 // for performance, save which entries already have the formula entry
41 // otherwise opening the dialog with a lot of range names is extremely slow because
42 // we would calculate all formula strings during opening
43 std::map<OUString, bool> maCalculatedFormulaEntries;
44 const ScAddress maPos;
46 int m_nId;
48 bool mbNeedUpdate;
50 void GetLine(ScRangeNameLine& aLine, const weld::TreeIter& rEntry);
51 void Init();
52 const ScRangeData* findRangeData(const ScRangeNameLine& rLine);
54 DECL_LINK(SizeAllocHdl, const Size&, void);
55 DECL_LINK(VisRowsScrolledHdl, weld::TreeView&, void);
57 public:
58 ScRangeManagerTable(std::unique_ptr<weld::TreeView>,
59 const std::map<OUString, std::unique_ptr<ScRangeName>>& rTabRangeNames,
60 const ScAddress& rPos);
62 void CheckForFormulaString();
64 int n_children() const { return m_xTreeView->n_children(); }
65 void connect_changed(const Link<weld::TreeView&, void>& rLink) { m_xTreeView->connect_changed(rLink); }
66 void set_cursor(int nPos) { m_xTreeView->set_cursor(nPos); }
68 void addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry);
69 void DeleteSelectedEntries();
70 void SetEntry( const ScRangeNameLine& rLine );
72 void GetCurrentLine(ScRangeNameLine& rLine);
73 bool IsMultiSelection() const;
74 std::vector<ScRangeNameLine> GetSelectedEntries();
76 void BlockUpdate()
78 mbNeedUpdate = false;
81 bool UpdatesBlocked() const
83 return !mbNeedUpdate;
86 void UnblockUpdate()
88 mbNeedUpdate = true;
92 #endif
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */