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