Bump version to 4.3-4
[LibreOffice.git] / sc / inc / listenercontext.hxx
blob7d66f9248ad6b04b29c06c5d9f2c40569bd2e232
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_LISTENERCONTEXT_HXX
11 #define INCLUDED_SC_INC_LISTENERCONTEXT_HXX
13 #include "address.hxx"
14 #include "columnspanset.hxx"
16 #include <boost/noncopyable.hpp>
17 #include <boost/scoped_ptr.hpp>
18 #include <boost/shared_ptr.hpp>
20 class ScDocument;
21 class ScTokenArray;
23 namespace sc {
25 struct ColumnBlockPosition;
26 class ColumnBlockPositionSet;
28 class StartListeningContext : boost::noncopyable
30 ScDocument& mrDoc;
31 boost::shared_ptr<ColumnBlockPositionSet> mpSet;
32 public:
33 StartListeningContext(ScDocument& rDoc);
34 StartListeningContext(ScDocument& rDoc, const boost::shared_ptr<ColumnBlockPositionSet>& pSet);
35 ScDocument& getDoc();
37 ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
40 class EndListeningContext : boost::noncopyable
42 ScDocument& mrDoc;
43 ColumnSpanSet maSet;
44 boost::shared_ptr<ColumnBlockPositionSet> mpPosSet;
45 ScTokenArray* mpOldCode;
46 ScAddress maPosDelta; // Add this to get the old position prior to the move.
48 public:
49 EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode = NULL);
50 EndListeningContext(ScDocument& rDoc, const boost::shared_ptr<ColumnBlockPositionSet>& pSet, ScTokenArray* pOldCode = NULL);
52 void setPositionDelta( const ScAddress& rDelta );
54 ScDocument& getDoc();
55 ScTokenArray* getOldCode();
56 ScAddress getOldPosition( const ScAddress& rPos ) const;
58 ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
60 void addEmptyBroadcasterPosition(SCTAB nTab, SCCOL nCol, SCROW nRow);
61 void purgeEmptyBroadcasters();
64 class PurgeListenerAction : public ColumnSpanSet::Action, boost::noncopyable
66 ScDocument& mrDoc;
67 boost::scoped_ptr<ColumnBlockPosition> mpBlockPos;
69 public:
70 PurgeListenerAction( ScDocument& rDoc );
72 virtual void startColumn( SCTAB nTab, SCCOL nCol ) SAL_OVERRIDE;
73 virtual void execute( const ScAddress& rPos, SCROW nLength, bool bVal ) SAL_OVERRIDE;
78 #endif
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */