xref: /aoo41x/main/sc/source/ui/inc/undotab.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SC_UNDOTAB_HXX
29*cdf0e10cSrcweir #define SC_UNDOTAB_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "undobase.hxx"
32*cdf0e10cSrcweir #include "markdata.hxx"
33*cdf0e10cSrcweir #include "formula/grammar.hxx"
34*cdf0e10cSrcweir #include <tools/color.hxx>
35*cdf0e10cSrcweir #include "tabbgcolor.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #ifndef _SVSTDARR_SHORTS
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #define _SVSTDARR_SHORTS
40*cdf0e10cSrcweir #include <svl/svstdarr.hxx>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #ifndef _SVSTDARR_STRINGS
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir #define _SVSTDARR_STRINGS
47*cdf0e10cSrcweir #include <svl/svstdarr.hxx>
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir #endif
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir #include <memory>
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir class ScDocShell;
56*cdf0e10cSrcweir class ScDocument;
57*cdf0e10cSrcweir class SdrUndoAction;
58*cdf0e10cSrcweir class ScPrintRangeSaver;
59*cdf0e10cSrcweir class SdrObject;
60*cdf0e10cSrcweir class ScDocProtection;
61*cdf0e10cSrcweir class ScTableProtection;
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir //----------------------------------------------------------------------------
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir class ScUndoInsertTab : public ScSimpleUndo
66*cdf0e10cSrcweir {
67*cdf0e10cSrcweir public:
68*cdf0e10cSrcweir 					TYPEINFO();
69*cdf0e10cSrcweir 					ScUndoInsertTab(
70*cdf0e10cSrcweir 							ScDocShell* pNewDocShell,
71*cdf0e10cSrcweir 							SCTAB nTabNum,
72*cdf0e10cSrcweir 							sal_Bool bApp,
73*cdf0e10cSrcweir 							const String& rNewName);
74*cdf0e10cSrcweir 	virtual			~ScUndoInsertTab();
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	virtual void	Undo();
77*cdf0e10cSrcweir 	virtual void	Redo();
78*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
79*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	virtual String	GetComment() const;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir private:
84*cdf0e10cSrcweir 	String			sNewName;
85*cdf0e10cSrcweir 	SdrUndoAction*	pDrawUndo;
86*cdf0e10cSrcweir 	sal_uLong			nEndChangeAction;
87*cdf0e10cSrcweir 	SCTAB			nTab;
88*cdf0e10cSrcweir 	sal_Bool			bAppend;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 	void			SetChangeTrack();
91*cdf0e10cSrcweir };
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir class ScUndoInsertTables : public ScSimpleUndo
94*cdf0e10cSrcweir {
95*cdf0e10cSrcweir public:
96*cdf0e10cSrcweir 					TYPEINFO();
97*cdf0e10cSrcweir 					ScUndoInsertTables(
98*cdf0e10cSrcweir 							ScDocShell* pNewDocShell,
99*cdf0e10cSrcweir 							SCTAB nTabNum,
100*cdf0e10cSrcweir 							sal_Bool bApp,
101*cdf0e10cSrcweir 							SvStrings *pNewNameList);
102*cdf0e10cSrcweir 	virtual			~ScUndoInsertTables();
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir 	virtual void	Undo();
105*cdf0e10cSrcweir 	virtual void	Redo();
106*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
107*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 	virtual String	GetComment() const;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir private:
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 	SdrUndoAction*	pDrawUndo;
114*cdf0e10cSrcweir 	SvStrings*		pNameList;
115*cdf0e10cSrcweir 	sal_uLong			nStartChangeAction;
116*cdf0e10cSrcweir 	sal_uLong			nEndChangeAction;
117*cdf0e10cSrcweir 	SCTAB			nTab;
118*cdf0e10cSrcweir 	sal_Bool			bAppend;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 	void			SetChangeTrack();
121*cdf0e10cSrcweir };
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir class ScUndoDeleteTab: public ScMoveUndo	// Draw vom Move fuer geloeschte Tabelle
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir public:
127*cdf0e10cSrcweir 					TYPEINFO();
128*cdf0e10cSrcweir 					ScUndoDeleteTab(
129*cdf0e10cSrcweir 							ScDocShell* pNewDocShell,
130*cdf0e10cSrcweir 							const SvShorts &theTabs,		//SCTAB nNewTab,
131*cdf0e10cSrcweir 							ScDocument* pUndoDocument,
132*cdf0e10cSrcweir 							ScRefUndoData* pRefData );
133*cdf0e10cSrcweir 	virtual			~ScUndoDeleteTab();
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 	virtual void	Undo();
136*cdf0e10cSrcweir 	virtual void	Redo();
137*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
138*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 	virtual String	GetComment() const;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir private:
143*cdf0e10cSrcweir 	SvShorts	theTabs;
144*cdf0e10cSrcweir 	sal_uLong			nStartChangeAction;
145*cdf0e10cSrcweir 	sal_uLong			nEndChangeAction;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	void			SetChangeTrack();
148*cdf0e10cSrcweir };
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir class ScUndoRenameTab: public ScSimpleUndo
152*cdf0e10cSrcweir {
153*cdf0e10cSrcweir public:
154*cdf0e10cSrcweir 					TYPEINFO();
155*cdf0e10cSrcweir 					ScUndoRenameTab(
156*cdf0e10cSrcweir 							ScDocShell* pNewDocShell,
157*cdf0e10cSrcweir 							SCTAB nT,
158*cdf0e10cSrcweir 							const String& rOldName,
159*cdf0e10cSrcweir 							const String& rNewName);
160*cdf0e10cSrcweir 	virtual			~ScUndoRenameTab();
161*cdf0e10cSrcweir 
162*cdf0e10cSrcweir 	virtual void	Undo();
163*cdf0e10cSrcweir 	virtual void	Redo();
164*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
165*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir 	virtual String	GetComment() const;
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir private:
170*cdf0e10cSrcweir 	SCTAB	nTab;
171*cdf0e10cSrcweir 	String	sOldName;
172*cdf0e10cSrcweir 	String	sNewName;
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir 	void DoChange( SCTAB nTab, const String& rName ) const;
175*cdf0e10cSrcweir };
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir class ScUndoMoveTab: public ScSimpleUndo
179*cdf0e10cSrcweir {
180*cdf0e10cSrcweir public:
181*cdf0e10cSrcweir 					TYPEINFO();
182*cdf0e10cSrcweir 					ScUndoMoveTab( ScDocShell* pNewDocShell,
183*cdf0e10cSrcweir 								  const SvShorts &aOldTab,
184*cdf0e10cSrcweir 								  const SvShorts &aNewTab);
185*cdf0e10cSrcweir 	virtual			~ScUndoMoveTab();
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 	virtual void	Undo();
188*cdf0e10cSrcweir 	virtual void	Redo();
189*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
190*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 	virtual String	GetComment() const;
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir private:
195*cdf0e10cSrcweir 	SvShorts	theOldTabs;
196*cdf0e10cSrcweir 	SvShorts	theNewTabs;
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir 	void DoChange( sal_Bool bUndo ) const;
199*cdf0e10cSrcweir };
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir class ScUndoCopyTab: public ScSimpleUndo
203*cdf0e10cSrcweir {
204*cdf0e10cSrcweir public:
205*cdf0e10cSrcweir 					TYPEINFO();
206*cdf0e10cSrcweir 					ScUndoCopyTab(ScDocShell* pNewDocShell,
207*cdf0e10cSrcweir 								  const SvShorts &aOldTab,
208*cdf0e10cSrcweir 								  const SvShorts &aNewTab);
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir 	virtual			~ScUndoCopyTab();
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir 	virtual void	Undo();
213*cdf0e10cSrcweir 	virtual void	Redo();
214*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
215*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 	virtual String	GetComment() const;
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir private:
220*cdf0e10cSrcweir 	SdrUndoAction*	pDrawUndo;
221*cdf0e10cSrcweir 	SvShorts	theOldTabs;
222*cdf0e10cSrcweir 	SvShorts	theNewTabs;
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 	void DoChange() const;
225*cdf0e10cSrcweir };
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir class ScUndoTabColor: public ScSimpleUndo
228*cdf0e10cSrcweir {
229*cdf0e10cSrcweir public:
230*cdf0e10cSrcweir                     TYPEINFO();
231*cdf0e10cSrcweir                     ScUndoTabColor(
232*cdf0e10cSrcweir                             ScDocShell* pNewDocShell,
233*cdf0e10cSrcweir                             SCTAB nT,
234*cdf0e10cSrcweir                             const Color& aOTabBgColor,
235*cdf0e10cSrcweir                             const Color& aNTabBgColor);
236*cdf0e10cSrcweir                     ScUndoTabColor(
237*cdf0e10cSrcweir                             ScDocShell* pNewDocShell,
238*cdf0e10cSrcweir                             const ScUndoTabColorInfo::List& rUndoTabColorList);
239*cdf0e10cSrcweir     virtual         ~ScUndoTabColor();
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir     virtual void    Undo();
242*cdf0e10cSrcweir     virtual void    Redo();
243*cdf0e10cSrcweir     virtual void    Repeat(SfxRepeatTarget& rTarget);
244*cdf0e10cSrcweir     virtual sal_Bool    CanRepeat(SfxRepeatTarget& rTarget) const;
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir virtual String	GetComment() const;
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir private:
249*cdf0e10cSrcweir     ScUndoTabColorInfo::List aTabColorList;
250*cdf0e10cSrcweir     bool    bIsMultipleUndo;
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir     void DoChange(bool bUndoType) const;
253*cdf0e10cSrcweir };
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir class ScUndoMakeScenario: public ScSimpleUndo
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir public:
258*cdf0e10cSrcweir 					TYPEINFO();
259*cdf0e10cSrcweir 					ScUndoMakeScenario(
260*cdf0e10cSrcweir 							ScDocShell* pNewDocShell,
261*cdf0e10cSrcweir 							SCTAB nSrc, SCTAB nDest,
262*cdf0e10cSrcweir 							const String& rN, const String& rC,
263*cdf0e10cSrcweir 							const Color& rCol, sal_uInt16 nF,
264*cdf0e10cSrcweir 							const ScMarkData& rMark );
265*cdf0e10cSrcweir 	virtual			~ScUndoMakeScenario();
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir 	virtual void	Undo();
268*cdf0e10cSrcweir 	virtual void	Redo();
269*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
270*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 	virtual String	GetComment() const;
273*cdf0e10cSrcweir 
274*cdf0e10cSrcweir private:
275*cdf0e10cSrcweir 	SCTAB		nSrcTab;
276*cdf0e10cSrcweir 	SCTAB		nDestTab;
277*cdf0e10cSrcweir 	String		aName;
278*cdf0e10cSrcweir 	String		aComment;
279*cdf0e10cSrcweir 	Color		aColor;
280*cdf0e10cSrcweir 	sal_uInt16		nFlags;
281*cdf0e10cSrcweir 	ScMarkData	aMarkData;
282*cdf0e10cSrcweir     SdrUndoAction* pDrawUndo;
283*cdf0e10cSrcweir };
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir class ScUndoImportTab : public ScSimpleUndo
287*cdf0e10cSrcweir {
288*cdf0e10cSrcweir public:
289*cdf0e10cSrcweir 					TYPEINFO();
290*cdf0e10cSrcweir 					ScUndoImportTab(
291*cdf0e10cSrcweir 							ScDocShell* pShell,
292*cdf0e10cSrcweir 							SCTAB nNewTab, SCTAB nNewCount,
293*cdf0e10cSrcweir 							sal_Bool bNewLink );
294*cdf0e10cSrcweir 	virtual			~ScUndoImportTab();
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir 	virtual void	Undo();
297*cdf0e10cSrcweir 	virtual void	Redo();
298*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
299*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir 	virtual String	GetComment() const;
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir private:
304*cdf0e10cSrcweir 	SCTAB		nTab;
305*cdf0e10cSrcweir 	SCTAB		nCount;
306*cdf0e10cSrcweir 	sal_Bool		bLink;
307*cdf0e10cSrcweir 	ScDocument*	pRedoDoc;
308*cdf0e10cSrcweir 	SdrUndoAction*	pDrawUndo;
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 	void DoChange() const;
311*cdf0e10cSrcweir };
312*cdf0e10cSrcweir 
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir class ScUndoRemoveLink : public ScSimpleUndo
315*cdf0e10cSrcweir {
316*cdf0e10cSrcweir public:
317*cdf0e10cSrcweir 					TYPEINFO();
318*cdf0e10cSrcweir 					ScUndoRemoveLink(				// vor dem Loeschen aufrufen!
319*cdf0e10cSrcweir 							ScDocShell* pShell,
320*cdf0e10cSrcweir 							const String& rDoc );
321*cdf0e10cSrcweir 	virtual			~ScUndoRemoveLink();
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir 	virtual void	Undo();
324*cdf0e10cSrcweir 	virtual void	Redo();
325*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
326*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
327*cdf0e10cSrcweir 
328*cdf0e10cSrcweir 	virtual String	GetComment() const;
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir private:
331*cdf0e10cSrcweir 	String	aDocName;
332*cdf0e10cSrcweir 	String	aFltName;
333*cdf0e10cSrcweir 	String	aOptions;
334*cdf0e10cSrcweir 	sal_uLong	nRefreshDelay;
335*cdf0e10cSrcweir 	sal_uInt16	nCount;
336*cdf0e10cSrcweir 	SCTAB*	pTabs;
337*cdf0e10cSrcweir 	sal_uInt8*	pModes;
338*cdf0e10cSrcweir 	String*	pTabNames;
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 	void DoChange( sal_Bool bLink ) const;
341*cdf0e10cSrcweir };
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir class ScUndoShowHideTab : public ScSimpleUndo
345*cdf0e10cSrcweir {
346*cdf0e10cSrcweir public:
347*cdf0e10cSrcweir 					TYPEINFO();
348*cdf0e10cSrcweir 					ScUndoShowHideTab(
349*cdf0e10cSrcweir 							ScDocShell* pShell,
350*cdf0e10cSrcweir 							SCTAB nNewTab, sal_Bool bNewShow );
351*cdf0e10cSrcweir 	virtual			~ScUndoShowHideTab();
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir 	virtual void	Undo();
354*cdf0e10cSrcweir 	virtual void	Redo();
355*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
356*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 	virtual String	GetComment() const;
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir private:
361*cdf0e10cSrcweir 	SCTAB	nTab;
362*cdf0e10cSrcweir 	sal_Bool	bShow;
363*cdf0e10cSrcweir 
364*cdf0e10cSrcweir 	void DoChange( sal_Bool bShow ) const;
365*cdf0e10cSrcweir };
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir // ============================================================================
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir /** This class implements undo & redo of document protect & unprotect
370*cdf0e10cSrcweir     operations. */
371*cdf0e10cSrcweir class ScUndoDocProtect : public ScSimpleUndo
372*cdf0e10cSrcweir {
373*cdf0e10cSrcweir public:
374*cdf0e10cSrcweir                     ScUndoDocProtect(ScDocShell* pShell, ::std::auto_ptr<ScDocProtection> pProtectSettings);
375*cdf0e10cSrcweir 	virtual			~ScUndoDocProtect();
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 	virtual void	Undo();
378*cdf0e10cSrcweir 	virtual void	Redo();
379*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
380*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
381*cdf0e10cSrcweir 
382*cdf0e10cSrcweir 	virtual String	GetComment() const;
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir private:
385*cdf0e10cSrcweir     ::std::auto_ptr<ScDocProtection> mpProtectSettings;
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir 	void	DoProtect(bool bProtect);
388*cdf0e10cSrcweir };
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir // ============================================================================
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir /** This class implements undo & redo of both protect and unprotect of
393*cdf0e10cSrcweir     sheet. */
394*cdf0e10cSrcweir class ScUndoTabProtect : public ScSimpleUndo
395*cdf0e10cSrcweir {
396*cdf0e10cSrcweir public:
397*cdf0e10cSrcweir                     ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab,
398*cdf0e10cSrcweir                                      ::std::auto_ptr<ScTableProtection> pProtectSettings);
399*cdf0e10cSrcweir 	virtual			~ScUndoTabProtect();
400*cdf0e10cSrcweir 
401*cdf0e10cSrcweir 	virtual void	Undo();
402*cdf0e10cSrcweir 	virtual void	Redo();
403*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
404*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir 	virtual String	GetComment() const;
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir private:
409*cdf0e10cSrcweir     SCTAB   mnTab;
410*cdf0e10cSrcweir     ::std::auto_ptr<ScTableProtection> mpProtectSettings;
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 	void	DoProtect(bool bProtect);
413*cdf0e10cSrcweir };
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir class ScUndoPrintRange : public ScSimpleUndo
417*cdf0e10cSrcweir {
418*cdf0e10cSrcweir public:
419*cdf0e10cSrcweir 					TYPEINFO();
420*cdf0e10cSrcweir 					ScUndoPrintRange( ScDocShell* pShell, SCTAB nNewTab,
421*cdf0e10cSrcweir 										ScPrintRangeSaver* pOld, ScPrintRangeSaver* pNew );
422*cdf0e10cSrcweir 	virtual			~ScUndoPrintRange();
423*cdf0e10cSrcweir 
424*cdf0e10cSrcweir 	virtual void	Undo();
425*cdf0e10cSrcweir 	virtual void	Redo();
426*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
427*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir 	virtual String	GetComment() const;
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir private:
432*cdf0e10cSrcweir 	SCTAB				nTab;
433*cdf0e10cSrcweir 	ScPrintRangeSaver*	pOldRanges;
434*cdf0e10cSrcweir 	ScPrintRangeSaver*	pNewRanges;
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir 	void DoChange( sal_Bool bUndo );
437*cdf0e10cSrcweir };
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir 
440*cdf0e10cSrcweir class ScUndoScenarioFlags: public ScSimpleUndo
441*cdf0e10cSrcweir {
442*cdf0e10cSrcweir public:
443*cdf0e10cSrcweir 					TYPEINFO();
444*cdf0e10cSrcweir 					ScUndoScenarioFlags(
445*cdf0e10cSrcweir 							ScDocShell* pNewDocShell, SCTAB nT,
446*cdf0e10cSrcweir 							const String& rON, const String& rNN,
447*cdf0e10cSrcweir 							const String& rOC, const String& rNC,
448*cdf0e10cSrcweir 							const Color& rOCol, const Color& rNCol,
449*cdf0e10cSrcweir 							sal_uInt16 nOF, sal_uInt16 nNF );
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir 	virtual			~ScUndoScenarioFlags();
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir 	virtual void	Undo();
454*cdf0e10cSrcweir 	virtual void	Redo();
455*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
456*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
457*cdf0e10cSrcweir 
458*cdf0e10cSrcweir 	virtual String	GetComment() const;
459*cdf0e10cSrcweir 
460*cdf0e10cSrcweir private:
461*cdf0e10cSrcweir 	SCTAB	nTab;
462*cdf0e10cSrcweir 	String	aOldName;
463*cdf0e10cSrcweir 	String	aNewName;
464*cdf0e10cSrcweir 	String	aOldComment;
465*cdf0e10cSrcweir 	String	aNewComment;
466*cdf0e10cSrcweir 	Color	aOldColor;
467*cdf0e10cSrcweir 	Color	aNewColor;
468*cdf0e10cSrcweir 	sal_uInt16	nOldFlags;
469*cdf0e10cSrcweir 	sal_uInt16	nNewFlags;
470*cdf0e10cSrcweir };
471*cdf0e10cSrcweir 
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir class ScUndoRenameObject: public ScSimpleUndo
474*cdf0e10cSrcweir {
475*cdf0e10cSrcweir public:
476*cdf0e10cSrcweir 					TYPEINFO();
477*cdf0e10cSrcweir 					ScUndoRenameObject(
478*cdf0e10cSrcweir 							ScDocShell* pNewDocShell, const String& rPN,
479*cdf0e10cSrcweir 							const String& rON, const String& rNN );
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir 	virtual			~ScUndoRenameObject();
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir 	virtual void	Undo();
484*cdf0e10cSrcweir 	virtual void	Redo();
485*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
486*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
487*cdf0e10cSrcweir 
488*cdf0e10cSrcweir 	virtual String	GetComment() const;
489*cdf0e10cSrcweir 
490*cdf0e10cSrcweir private:
491*cdf0e10cSrcweir 	String	aPersistName;		// to find object (works only for OLE objects)
492*cdf0e10cSrcweir 	String	aOldName;
493*cdf0e10cSrcweir 	String	aNewName;
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir 	SdrObject*	GetObject();
496*cdf0e10cSrcweir };
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir 
499*cdf0e10cSrcweir class ScUndoLayoutRTL : public ScSimpleUndo
500*cdf0e10cSrcweir {
501*cdf0e10cSrcweir public:
502*cdf0e10cSrcweir 					TYPEINFO();
503*cdf0e10cSrcweir 					ScUndoLayoutRTL( ScDocShell* pShell, SCTAB nNewTab, sal_Bool bNewRTL );
504*cdf0e10cSrcweir 	virtual			~ScUndoLayoutRTL();
505*cdf0e10cSrcweir 
506*cdf0e10cSrcweir 	virtual void	Undo();
507*cdf0e10cSrcweir 	virtual void	Redo();
508*cdf0e10cSrcweir 	virtual void	Repeat(SfxRepeatTarget& rTarget);
509*cdf0e10cSrcweir 	virtual sal_Bool	CanRepeat(SfxRepeatTarget& rTarget) const;
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir 	virtual String	GetComment() const;
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir private:
514*cdf0e10cSrcweir 	SCTAB	nTab;
515*cdf0e10cSrcweir 	sal_Bool	bRTL;
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir 	void DoChange( sal_Bool bNew );
518*cdf0e10cSrcweir };
519*cdf0e10cSrcweir 
520*cdf0e10cSrcweir 
521*cdf0e10cSrcweir //UNUSED2009-05 class ScUndoSetGrammar : public ScSimpleUndo
522*cdf0e10cSrcweir //UNUSED2009-05 {
523*cdf0e10cSrcweir //UNUSED2009-05 public:
524*cdf0e10cSrcweir //UNUSED2009-05                     TYPEINFO();
525*cdf0e10cSrcweir //UNUSED2009-05                     ScUndoSetGrammar( ScDocShell* pShell,
526*cdf0e10cSrcweir //UNUSED2009-05                                       formula::FormulaGrammar::Grammar eGrammar );
527*cdf0e10cSrcweir //UNUSED2009-05     virtual         ~ScUndoSetGrammar();
528*cdf0e10cSrcweir //UNUSED2009-05
529*cdf0e10cSrcweir //UNUSED2009-05     virtual void    Undo();
530*cdf0e10cSrcweir //UNUSED2009-05     virtual void    Redo();
531*cdf0e10cSrcweir //UNUSED2009-05     virtual void    Repeat(SfxRepeatTarget& rTarget);
532*cdf0e10cSrcweir //UNUSED2009-05     virtual sal_Bool    CanRepeat(SfxRepeatTarget& rTarget) const;
533*cdf0e10cSrcweir //UNUSED2009-05
534*cdf0e10cSrcweir //UNUSED2009-05     virtual String  GetComment() const;
535*cdf0e10cSrcweir //UNUSED2009-05
536*cdf0e10cSrcweir //UNUSED2009-05 private:
537*cdf0e10cSrcweir //UNUSED2009-05     formula::FormulaGrammar::Grammar meNewGrammar, meOldGrammar;
538*cdf0e10cSrcweir //UNUSED2009-05
539*cdf0e10cSrcweir //UNUSED2009-05     void DoChange( formula::FormulaGrammar::Grammar eGrammar );
540*cdf0e10cSrcweir //UNUSED2009-05 };
541*cdf0e10cSrcweir 
542*cdf0e10cSrcweir #endif
543*cdf0e10cSrcweir 
544