tdf#104816 sw: if non-section content, let all sections hide.
[LibreOffice.git] / sc / inc / listenerquery.hxx
bloba165332c1601df73f54fef3a5f62a62adc83a0fd
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 SC_LISTENERQUERY_HXX
11 #define SC_LISTENERQUERY_HXX
13 #include "address.hxx"
14 #include "rangelst.hxx"
15 #include <svl/listener.hxx>
17 #include <unordered_map>
18 #include <vector>
20 namespace sc {
22 /**
23 * Used to collect positions of formula cells that belong to a formula
24 * group.
26 class RefQueryFormulaGroup : public SvtListener::QueryBase
28 public:
29 typedef std::vector<SCROW> ColType;
30 typedef std::unordered_map<SCCOL,ColType> ColsType;
31 typedef std::unordered_map<SCTAB,ColsType> TabsType;
33 RefQueryFormulaGroup();
34 virtual ~RefQueryFormulaGroup() override;
36 void setSkipRange( const ScRange& rRange );
37 void add( const ScAddress& rPos );
39 /**
40 * Row positions in each column may contain duplicates. Caller must
41 * remove duplicates if necessary.
43 const TabsType& getAllPositions() const;
45 private:
46 ScRange maSkipRange;
47 TabsType maTabs;
50 class QueryRange : public SvtListener::QueryBase
52 ScRangeList maRanges;
54 QueryRange( const QueryRange& ) = delete;
55 QueryRange& operator= ( const QueryRange& ) = delete;
57 public:
58 QueryRange();
59 virtual ~QueryRange() override;
61 void add( const ScRange& rRange );
63 void swapRanges( ScRangeList& rRanges );
68 #endif
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */