LibreOffice Module sc (master) 1
broadcast.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
10#pragma once
11
12#include "address.hxx"
13
14#include <map>
15#include <variant>
16#include <ostream>
17
18class ScFormulaCell;
19class SvtListener;
20
21namespace sc
22{
23class FormulaGroupAreaListener;
24
26{
28 {
29 FormulaCell,
30 Generic,
31 };
32
34 {
35 FormulaCell,
36 FormulaGroup,
37 Generic,
38 };
39
41 {
42 using DataType = std::variant<const ScFormulaCell*, const SvtListener*>;
43
46
48 CellListener(const SvtListener* p);
49 };
50
52 {
53 using DataType = std::variant<const ScFormulaCell*, const sc::FormulaGroupAreaListener*,
54 const SvtListener*>;
55
58
61 AreaListener(const SvtListener* p);
62 };
63
64 std::map<ScAddress, std::vector<CellListener>> aCellListenerStore;
65 std::map<ScRange, std::vector<AreaListener>> aAreaListenerStore;
66
70 bool hasFormulaCellListener(const ScAddress& rBroadcasterPos,
71 const ScAddress& rFormulaPos) const;
72
76 bool hasFormulaCellListener(const ScRange& rBroadcasterRange,
77 const ScAddress& rFormulaPos) const;
78
82 void dump(std::ostream& rStrm, const ScDocument* pDoc = nullptr) const;
83};
84}
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
std::variant< const ScFormulaCell *, const sc::FormulaGroupAreaListener *, const SvtListener * > DataType
Definition: broadcast.hxx:54
AreaListener(const ScFormulaCell *p)
Definition: broadcast.cxx:28
CellListener(const ScFormulaCell *p)
Definition: broadcast.cxx:16
std::variant< const ScFormulaCell *, const SvtListener * > DataType
Definition: broadcast.hxx:42
bool hasFormulaCellListener(const ScAddress &rBroadcasterPos, const ScAddress &rFormulaPos) const
Check if a formula cell listens on a single cell.
Definition: broadcast.cxx:46
std::map< ScAddress, std::vector< CellListener > > aCellListenerStore
Definition: broadcast.hxx:64
std::map< ScRange, std::vector< AreaListener > > aAreaListenerStore
Definition: broadcast.hxx:65
void dump(std::ostream &rStrm, const ScDocument *pDoc=nullptr) const
Dump all broadcaster state in YAML format.
Definition: broadcast.cxx:86