Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / refhint.hxx
blobe558c8e7fe480241fb0dca32583b558297189c85
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_INC_REFHINT_HXX
11 #define INCLUDED_SC_INC_REFHINT_HXX
13 #include "address.hxx"
14 #include <svl/hint.hxx>
16 namespace sc {
18 struct RefUpdateContext;
19 class ColRowReorderMapType;
21 class RefHint : public SfxHint
23 public:
24 enum Type {
25 Moved,
26 ColumnReordered,
27 RowReordered,
28 StartListening,
29 StopListening
32 private:
33 Type meType;
35 protected:
36 RefHint( Type eType );
38 public:
39 RefHint() = delete;
40 virtual ~RefHint() override = 0;
42 Type getType() const;
45 class RefMovedHint : public RefHint
47 ScRange maRange;
48 ScAddress maMoveDelta;
49 const sc::RefUpdateContext& mrCxt;
51 public:
53 RefMovedHint( const ScRange& rRange, const ScAddress& rMove, const sc::RefUpdateContext& rCxt );
54 virtual ~RefMovedHint() override;
56 /**
57 * Get the source range from which the references have moved.
59 const ScRange& getRange() const;
61 /**
62 * Get the movement vector.
64 const ScAddress& getDelta() const;
66 const sc::RefUpdateContext& getContext() const;
69 class RefColReorderHint : public RefHint
71 const sc::ColRowReorderMapType& mrColMap;
72 SCTAB mnTab;
73 SCROW mnRow1;
74 SCROW mnRow2;
76 public:
77 RefColReorderHint( const sc::ColRowReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 );
78 virtual ~RefColReorderHint() override;
80 const sc::ColRowReorderMapType& getColMap() const;
82 SCTAB getTab() const;
83 SCROW getStartRow() const;
84 SCROW getEndRow() const;
87 class RefRowReorderHint : public RefHint
89 const sc::ColRowReorderMapType& mrRowMap;
90 SCTAB mnTab;
91 SCCOL mnCol1;
92 SCCOL mnCol2;
94 public:
95 RefRowReorderHint( const sc::ColRowReorderMapType& rRowMap, SCTAB nTab, SCCOL nCol1, SCCOL nCol2 );
96 virtual ~RefRowReorderHint() override;
98 const sc::ColRowReorderMapType& getRowMap() const;
100 SCTAB getTab() const;
101 SCCOL getStartColumn() const;
102 SCCOL getEndColumn() const;
105 class RefStartListeningHint : public RefHint
107 public:
108 RefStartListeningHint();
109 virtual ~RefStartListeningHint() override;
112 class RefStopListeningHint : public RefHint
114 public:
115 RefStopListeningHint();
116 virtual ~RefStopListeningHint() override;
121 #endif
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */