fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / undobase.hxx
blob67ecb454d78469988d79fd14f858c5464244bfe5
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_UNDOBASE_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_UNDOBASE_HXX
23 #include <svl/undo.hxx>
24 #include "global.hxx"
25 #include "address.hxx"
26 #include "docsh.hxx"
27 #include <columnspanset.hxx>
29 #include <boost/ptr_container/ptr_map.hpp>
31 class ScDocument;
32 class ScDocShell;
33 class SdrUndoAction;
34 class ScRefUndoData;
35 class ScDBData;
37 class ScSimpleUndo: public SfxUndoAction
39 ScSimpleUndo(const ScSimpleUndo&) SAL_DELETED_FUNCTION;
41 public:
42 typedef boost::ptr_map<SCTAB,sc::ColumnSpanSet> DataSpansType;
44 TYPEINFO_OVERRIDE();
45 ScSimpleUndo( ScDocShell* pDocSh );
46 virtual ~ScSimpleUndo();
48 virtual bool Merge( SfxUndoAction *pNextAction ) SAL_OVERRIDE;
50 protected:
51 ScDocShell* pDocShell;
52 SfxUndoAction* pDetectiveUndo;
54 bool IsPaintLocked() const { return pDocShell->IsPaintLocked(); }
56 bool SetViewMarkData( const ScMarkData& rMarkData );
58 void BeginUndo();
59 void EndUndo();
60 void BeginRedo();
61 void EndRedo();
63 void BroadcastChanges( const ScRange& rRange );
65 /**
66 * Broadcast changes on specified spans.
68 * @param rSpans container that specifies all spans whose changes need to
69 * be broadcasted.
71 void BroadcastChanges( const DataSpansType& rSpans );
73 static void ShowTable( SCTAB nTab );
74 static void ShowTable( const ScRange& rRange );
77 enum ScBlockUndoMode { SC_UNDO_SIMPLE, SC_UNDO_MANUALHEIGHT, SC_UNDO_AUTOHEIGHT };
79 class ScBlockUndo: public ScSimpleUndo
81 public:
82 TYPEINFO_OVERRIDE();
83 ScBlockUndo( ScDocShell* pDocSh, const ScRange& rRange,
84 ScBlockUndoMode eBlockMode );
85 virtual ~ScBlockUndo();
87 protected:
88 ScRange aBlockRange;
89 SdrUndoAction* pDrawUndo;
90 ScBlockUndoMode eMode;
92 void BeginUndo();
93 void EndUndo();
94 // void BeginRedo();
95 void EndRedo();
97 bool AdjustHeight();
98 void ShowBlock();
101 class ScMultiBlockUndo: public ScSimpleUndo
103 public:
104 TYPEINFO_OVERRIDE();
105 ScMultiBlockUndo(ScDocShell* pDocSh, const ScRangeList& rRanges,
106 ScBlockUndoMode eBlockMode);
107 virtual ~ScMultiBlockUndo();
109 protected:
110 ScRangeList maBlockRanges;
111 SdrUndoAction* mpDrawUndo;
112 ScBlockUndoMode meMode;
114 void BeginUndo();
115 void EndUndo();
116 void EndRedo();
118 void AdjustHeight();
119 void ShowBlock();
122 // for functions that act on a database range - takes care of the unnamed database range
123 // (collected separately, before the undo action, for showing dialogs etc.)
125 class ScDBFuncUndo: public ScSimpleUndo
127 protected:
128 ScDBData* pAutoDBRange;
129 ScRange aOriginalRange;
130 SdrUndoAction* mpDrawUndo;
132 public:
133 TYPEINFO_OVERRIDE();
134 ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo = 0 );
135 virtual ~ScDBFuncUndo();
137 void BeginUndo();
138 void EndUndo();
139 void BeginRedo();
140 void EndRedo();
143 enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST };
145 class ScMoveUndo: public ScSimpleUndo // mit Referenzen
147 public:
148 TYPEINFO_OVERRIDE();
149 ScMoveUndo( ScDocShell* pDocSh,
150 ScDocument* pRefDoc, ScRefUndoData* pRefData,
151 ScMoveUndoMode eRefMode );
152 virtual ~ScMoveUndo();
154 protected:
155 SdrUndoAction* pDrawUndo;
156 ScDocument* pRefUndoDoc;
157 ScRefUndoData* pRefUndoData;
158 ScMoveUndoMode eMode;
160 void BeginUndo();
161 void EndUndo();
162 // void BeginRedo();
163 // void EndRedo();
165 private:
166 void UndoRef();
169 class ScUndoWrapper: public SfxUndoAction // for manual merging of actions
171 SfxUndoAction* pWrappedUndo;
173 public:
174 TYPEINFO_OVERRIDE();
175 ScUndoWrapper( SfxUndoAction* pUndo );
176 virtual ~ScUndoWrapper();
178 SfxUndoAction* GetWrappedUndo() { return pWrappedUndo; }
179 void ForgetWrappedUndo();
181 virtual void SetLinkToSfxLinkUndoAction(SfxLinkUndoAction* pSfxLinkUndoAction) SAL_OVERRIDE;
183 virtual void Undo() SAL_OVERRIDE;
184 virtual void Redo() SAL_OVERRIDE;
185 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
186 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
187 virtual bool Merge( SfxUndoAction *pNextAction ) SAL_OVERRIDE;
188 virtual OUString GetComment() const SAL_OVERRIDE;
189 virtual OUString GetRepeatComment(SfxRepeatTarget&) const SAL_OVERRIDE;
190 virtual sal_uInt16 GetId() const SAL_OVERRIDE;
193 #endif
195 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */