1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
12 #include "address.hxx"
23 class FormulaGroupAreaListener
;
25 struct BroadcasterState
27 enum class CellListenerType
33 enum class AreaListenerType
42 using DataType
= std::variant
<const ScFormulaCell
*, const SvtListener
*>;
44 CellListenerType eType
;
47 CellListener(const ScFormulaCell
* p
);
48 CellListener(const SvtListener
* p
);
53 using DataType
= std::variant
<const ScFormulaCell
*, const sc::FormulaGroupAreaListener
*,
56 AreaListenerType eType
;
59 AreaListener(const ScFormulaCell
* p
);
60 AreaListener(const sc::FormulaGroupAreaListener
* p
);
61 AreaListener(const SvtListener
* p
);
64 std::map
<ScAddress
, std::vector
<CellListener
>> aCellListenerStore
;
65 std::map
<ScRange
, std::vector
<AreaListener
>> aAreaListenerStore
;
68 * Check if a formula cell listens on a single cell.
70 bool hasFormulaCellListener(const ScAddress
& rBroadcasterPos
,
71 const ScAddress
& rFormulaPos
) const;
74 * Check if a formula cell listens on a single range.
76 bool hasFormulaCellListener(const ScRange
& rBroadcasterRange
,
77 const ScAddress
& rFormulaPos
) const;
80 * Dump all broadcaster state in YAML format.
82 void dump(std::ostream
& rStrm
, const ScDocument
* pDoc
= nullptr) const;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */