LibreOffice Module sc (master) 1
listenercontext.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#include "columnspanset.hxx"
14#include "mtvelements.hxx"
15
16#include <memory>
17
18class ScDocument;
19class ScTokenArray;
20
21namespace sc
22{
23class ColumnSet;
24
26{
28 std::shared_ptr<ColumnBlockPositionSet> mpSet;
29 std::shared_ptr<const ColumnSet> mpColSet;
30
31public:
35 StartListeningContext(ScDocument& rDoc, std::shared_ptr<ColumnBlockPositionSet> pSet);
36 void setColumnSet(const std::shared_ptr<const ColumnSet>& pColSet);
37 const std::shared_ptr<const ColumnSet>& getColumnSet() const;
38 ScDocument& getDoc() { return mrDoc; }
39
41};
42
44{
47 std::shared_ptr<ColumnBlockPositionSet> mpPosSet;
49 ScAddress maPosDelta; // Add this to get the old position prior to the move.
50
51public:
54 EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode = nullptr);
55 EndListeningContext(ScDocument& rDoc, std::shared_ptr<ColumnBlockPositionSet> pSet,
56 ScTokenArray* pOldCode = nullptr);
57
58 void setPositionDelta(const ScAddress& rDelta);
59
60 ScDocument& getDoc() { return mrDoc; }
62 ScAddress getOldPosition(const ScAddress& rPos) const;
63
65
66 void addEmptyBroadcasterPosition(SCTAB nTab, SCCOL nCol, SCROW nRow);
68};
69
71{
73 std::unique_ptr<ColumnBlockPosition> mpBlockPos;
74
75public:
79
80 virtual void startColumn(SCTAB nTab, SCCOL nCol) override;
81 virtual void execute(const ScAddress& rPos, SCROW nLength, bool bVal) override;
82};
83}
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
void setPositionDelta(const ScAddress &rDelta)
void addEmptyBroadcasterPosition(SCTAB nTab, SCCOL nCol, SCROW nRow)
ScAddress getOldPosition(const ScAddress &rPos) const
std::shared_ptr< ColumnBlockPositionSet > mpPosSet
EndListeningContext(const EndListeningContext &)=delete
const EndListeningContext & operator=(const EndListeningContext &)=delete
ColumnBlockPosition * getBlockPosition(SCTAB nTab, SCCOL nCol)
ScTokenArray * getOldCode()
const PurgeListenerAction & operator=(const PurgeListenerAction &)=delete
virtual void startColumn(SCTAB nTab, SCCOL nCol) override
std::unique_ptr< ColumnBlockPosition > mpBlockPos
virtual void execute(const ScAddress &rPos, SCROW nLength, bool bVal) override
PurgeListenerAction(const PurgeListenerAction &)=delete
std::shared_ptr< ColumnBlockPositionSet > mpSet
void setColumnSet(const std::shared_ptr< const ColumnSet > &pColSet)
const StartListeningContext & operator=(const StartListeningContext &)=delete
ColumnBlockPosition * getBlockPosition(SCTAB nTab, SCCOL nCol)
StartListeningContext(const StartListeningContext &)=delete
std::shared_ptr< const ColumnSet > mpColSet
const std::shared_ptr< const ColumnSet > & getColumnSet() const
CAUTION! The following defines must be in the same namespace as the respective type.
Store position data for column array storage.
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17