fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sc / source / ui / inc / undoblk.hxx
blob470e7d3bdf4a38d4bafd07c83e0cbd0d24b97e66
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 .
19 #ifndef SC_UNDOBLK_HXX
20 #define SC_UNDOBLK_HXX
22 #include "undobase.hxx"
23 #include "markdata.hxx"
24 #include "viewutil.hxx"
25 #include "spellparam.hxx"
26 #include "cellmergeoption.hxx"
28 #include <boost/shared_ptr.hpp>
29 #include <boost/scoped_ptr.hpp>
31 class ScDocShell;
32 class ScDocument;
33 class ScOutlineTable;
34 class ScRangeList;
35 class ScPatternAttr;
36 class SvxBoxItem;
37 class SvxBoxInfoItem;
38 class SvxSearchItem;
39 class SdrUndoAction;
40 class ScEditDataArray;
42 //----------------------------------------------------------------------------
44 class ScUndoInsertCells: public ScMoveUndo
46 public:
47 TYPEINFO();
48 ScUndoInsertCells( ScDocShell* pNewDocShell,
49 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
50 InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData,
51 sal_Bool bNewPartOfPaste );
52 virtual ~ScUndoInsertCells();
54 virtual void Undo();
55 virtual void Redo();
56 virtual void Repeat( SfxRepeatTarget& rTarget );
57 virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const;
59 virtual OUString GetComment() const;
61 virtual sal_Bool Merge( SfxUndoAction *pNextAction );
63 private:
64 ScRange aEffRange;
65 SCTAB nCount;
66 SCTAB* pTabs;
67 SCTAB* pScenarios;
68 sal_uLong nEndChangeAction;
69 InsCellCmd eCmd;
70 sal_Bool bPartOfPaste;
71 SfxUndoAction* pPasteUndo;
73 void DoChange ( const sal_Bool bUndo );
74 void SetChangeTrack();
78 class ScUndoDeleteCells: public ScMoveUndo
80 public:
81 TYPEINFO();
82 ScUndoDeleteCells( ScDocShell* pNewDocShell,
83 const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios,
84 DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData );
85 virtual ~ScUndoDeleteCells();
87 virtual void Undo();
88 virtual void Redo();
89 virtual void Repeat(SfxRepeatTarget& rTarget);
90 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
92 virtual OUString GetComment() const;
94 private:
95 ScRange aEffRange;
96 SCTAB nCount;
97 SCTAB* pTabs;
98 SCTAB* pScenarios;
99 sal_uLong nStartChangeAction;
100 sal_uLong nEndChangeAction;
101 DelCellCmd eCmd;
103 void DoChange ( const sal_Bool bUndo );
104 void SetChangeTrack();
108 class ScUndoDeleteMulti: public ScMoveUndo
110 public:
111 TYPEINFO();
112 ScUndoDeleteMulti( ScDocShell* pNewDocShell,
113 sal_Bool bNewRows, sal_Bool bNeedsRefresh, SCTAB nNewTab,
114 const SCCOLROW* pRng, SCCOLROW nRngCnt,
115 ScDocument* pUndoDocument, ScRefUndoData* pRefData );
116 virtual ~ScUndoDeleteMulti();
118 virtual void Undo();
119 virtual void Redo();
120 virtual void Repeat(SfxRepeatTarget& rTarget);
121 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
123 virtual OUString GetComment() const;
125 private:
126 sal_Bool bRows;
127 sal_Bool bRefresh;
128 SCTAB nTab;
129 SCCOLROW* pRanges;
130 SCCOLROW nRangeCnt;
131 sal_uLong nStartChangeAction;
132 sal_uLong nEndChangeAction;
134 void DoChange() const;
135 void SetChangeTrack();
139 class ScUndoCut: public ScBlockUndo
141 public:
142 TYPEINFO();
143 ScUndoCut( ScDocShell* pNewDocShell,
144 ScRange aRange, // adjusted for merged cells
145 ScAddress aOldEnd, // end position without adjustment
146 const ScMarkData& rMark, // selected sheets
147 ScDocument* pNewUndoDoc );
148 virtual ~ScUndoCut();
150 virtual void Undo();
151 virtual void Redo();
152 virtual void Repeat(SfxRepeatTarget& rTarget);
153 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
155 virtual OUString GetComment() const;
157 private:
158 ScMarkData aMarkData;
159 ScDocument* pUndoDoc;
160 ScRange aExtendedRange;
161 sal_uLong nStartChangeAction;
162 sal_uLong nEndChangeAction;
164 void DoChange( const sal_Bool bUndo );
165 void SetChangeTrack();
169 struct ScUndoPasteOptions
171 sal_uInt16 nFunction;
172 sal_Bool bSkipEmpty;
173 sal_Bool bTranspose;
174 sal_Bool bAsLink;
175 InsCellCmd eMoveMode;
177 ScUndoPasteOptions() :
178 nFunction( PASTE_NOFUNC ),
179 bSkipEmpty( false ),
180 bTranspose( false ),
181 bAsLink( false ),
182 eMoveMode( INS_NONE )
186 class ScUndoPaste: public ScMultiBlockUndo
188 public:
189 TYPEINFO();
190 ScUndoPaste(ScDocShell* pNewDocShell, const ScRangeList& rRanges,
191 const ScMarkData& rMark,
192 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc,
193 sal_uInt16 nNewFlags,
194 ScRefUndoData* pRefData,
195 bool bRedoIsFilled = true,
196 const ScUndoPasteOptions* pOptions = NULL);
197 virtual ~ScUndoPaste();
199 virtual void Undo();
200 virtual void Redo();
201 virtual void Repeat(SfxRepeatTarget& rTarget);
202 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
204 virtual OUString GetComment() const;
206 private:
207 ScMarkData aMarkData;
208 ScDocument* pUndoDoc;
209 ScDocument* pRedoDoc;
210 sal_uInt16 nFlags;
211 ScRefUndoData* pRefUndoData;
212 ScRefUndoData* pRefRedoData;
213 sal_uLong nStartChangeAction;
214 sal_uLong nEndChangeAction;
215 sal_Bool bRedoFilled;
216 ScUndoPasteOptions aPasteOptions;
218 void DoChange(bool bUndo);
219 void SetChangeTrack();
223 class ScUndoDragDrop: public ScMoveUndo
225 public:
226 TYPEINFO();
227 ScUndoDragDrop( ScDocShell* pNewDocShell,
228 const ScRange& rRange, ScAddress aNewDestPos, sal_Bool bNewCut,
229 ScDocument* pUndoDocument, ScRefUndoData* pRefData,
230 sal_Bool bScenario );
231 virtual ~ScUndoDragDrop();
233 virtual void Undo();
234 virtual void Redo();
235 virtual void Repeat(SfxRepeatTarget& rTarget);
236 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
238 virtual OUString GetComment() const;
240 private:
241 ScRange aSrcRange;
242 ScRange aDestRange;
243 sal_uLong nStartChangeAction;
244 sal_uLong nEndChangeAction;
245 sal_Bool bCut;
246 sal_Bool bKeepScenarioFlags;
248 void PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const;
249 void DoUndo( ScRange aRange ) const;
251 void SetChangeTrack();
255 class ScUndoDeleteContents: public ScSimpleUndo
257 public:
258 TYPEINFO();
259 ScUndoDeleteContents( ScDocShell* pNewDocShell,
260 const ScMarkData& rMark,
261 const ScRange& rRange,
262 ScDocument* pNewUndoDoc, sal_Bool bNewMulti,
263 sal_uInt16 nNewFlags, sal_Bool bObjects );
264 virtual ~ScUndoDeleteContents();
266 virtual void Undo();
267 virtual void Redo();
268 virtual void Repeat(SfxRepeatTarget& rTarget);
269 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
271 virtual OUString GetComment() const;
273 private:
274 ScRange aRange;
275 ScMarkData aMarkData;
276 ScDocument* pUndoDoc; // Block mark and deleted data
277 SdrUndoAction* pDrawUndo; // Deleted objects
278 sal_uLong nStartChangeAction;
279 sal_uLong nEndChangeAction;
280 sal_uInt16 nFlags;
281 sal_Bool bMulti; // Multi selection
283 void DoChange( const sal_Bool bUndo );
284 void SetChangeTrack();
288 class ScUndoFillTable: public ScSimpleUndo
290 public:
291 TYPEINFO();
292 ScUndoFillTable( ScDocShell* pNewDocShell,
293 const ScMarkData& rMark,
294 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
295 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
296 ScDocument* pNewUndoDoc, sal_Bool bNewMulti, SCTAB nSrc,
297 sal_uInt16 nFlg, sal_uInt16 nFunc, sal_Bool bSkip, sal_Bool bLink );
298 virtual ~ScUndoFillTable();
300 virtual void Undo();
301 virtual void Redo();
302 virtual void Repeat(SfxRepeatTarget& rTarget);
303 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
305 virtual OUString GetComment() const;
307 private:
308 ScRange aRange;
309 ScMarkData aMarkData;
310 ScDocument* pUndoDoc; // Block mark and deleted data
311 sal_uLong nStartChangeAction;
312 sal_uLong nEndChangeAction;
313 sal_uInt16 nFlags;
314 sal_uInt16 nFunction;
315 SCTAB nSrcTab;
316 sal_Bool bMulti; // Multi selection
317 sal_Bool bSkipEmpty;
318 sal_Bool bAsLink;
320 void DoChange( const sal_Bool bUndo );
321 void SetChangeTrack();
325 class ScUndoSelectionAttr: public ScSimpleUndo
327 public:
328 TYPEINFO();
329 ScUndoSelectionAttr( ScDocShell* pNewDocShell,
330 const ScMarkData& rMark,
331 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
332 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
333 ScDocument* pNewUndoDoc, sal_Bool bNewMulti,
334 const ScPatternAttr* pNewApply,
335 const SvxBoxItem* pNewOuter = NULL,
336 const SvxBoxInfoItem* pNewInner = NULL );
337 virtual ~ScUndoSelectionAttr();
339 virtual void Undo();
340 virtual void Redo();
341 virtual void Repeat(SfxRepeatTarget& rTarget);
342 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
344 virtual OUString GetComment() const;
346 ScEditDataArray* GetDataArray();
347 private:
348 ScMarkData aMarkData;
349 ScRange aRange;
350 boost::scoped_ptr<ScEditDataArray> mpDataArray;
351 ScDocument* pUndoDoc;
352 sal_Bool bMulti;
353 ScPatternAttr* pApplyPattern;
354 SvxBoxItem* pLineOuter;
355 SvxBoxInfoItem* pLineInner;
357 void DoChange( const sal_Bool bUndo );
358 void ChangeEditData( const bool bUndo );
362 class ScUndoWidthOrHeight: public ScSimpleUndo
364 public:
365 TYPEINFO();
366 ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
367 const ScMarkData& rMark,
368 SCCOLROW nNewStart, SCTAB nNewStartTab,
369 SCCOLROW nNewEnd, SCTAB nNewEndTab,
370 ScDocument* pNewUndoDoc,
371 SCCOLROW nNewCnt, SCCOLROW* pNewRanges,
372 ScOutlineTable* pNewUndoTab,
373 ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips,
374 sal_Bool bNewWidth );
375 virtual ~ScUndoWidthOrHeight();
377 virtual void Undo();
378 virtual void Redo();
379 virtual void Repeat(SfxRepeatTarget& rTarget);
380 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
382 virtual OUString GetComment() const;
384 private:
385 ScMarkData aMarkData;
386 SCCOLROW nStart;
387 SCCOLROW nEnd;
388 SCTAB nStartTab;
389 SCTAB nEndTab;
390 ScDocument* pUndoDoc;
391 ScOutlineTable* pUndoTab;
392 SCCOLROW nRangeCnt;
393 SCCOLROW* pRanges;
394 sal_uInt16 nNewSize;
395 sal_Bool bWidth;
396 ScSizeMode eMode;
397 SdrUndoAction* pDrawUndo;
401 class ScUndoAutoFill: public ScBlockUndo
403 public:
404 TYPEINFO();
405 ScUndoAutoFill( ScDocShell* pNewDocShell,
406 const ScRange& rRange, const ScRange& rSourceArea,
407 ScDocument* pNewUndoDoc, const ScMarkData& rMark,
408 FillDir eNewFillDir,
409 FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd,
410 double fNewStartValue, double fNewStepValue, double fNewMaxValue );
411 virtual ~ScUndoAutoFill();
413 virtual void Undo();
414 virtual void Redo();
415 virtual void Repeat(SfxRepeatTarget& rTarget);
416 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
418 virtual OUString GetComment() const;
420 private:
421 ScRange aSource;
422 ScMarkData aMarkData;
423 ScDocument* pUndoDoc;
424 FillDir eFillDir;
425 FillCmd eFillCmd;
426 FillDateCmd eFillDateCmd;
427 double fStartValue;
428 double fStepValue;
429 double fMaxValue;
430 sal_uLong nStartChangeAction;
431 sal_uLong nEndChangeAction;
433 void SetChangeTrack();
437 class ScUndoMerge: public ScSimpleUndo
439 public:
440 TYPEINFO();
441 ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
442 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
443 virtual ~ScUndoMerge();
445 virtual void Undo();
446 virtual void Redo();
447 virtual void Repeat(SfxRepeatTarget& rTarget);
448 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
450 virtual OUString GetComment() const;
452 private:
453 ScCellMergeOption maOption;
454 bool mbMergeContents; // Merge contents in Redo().
455 ScDocument* mpUndoDoc; // when data is merged
456 SdrUndoAction* mpDrawUndo;
458 void DoChange( bool bUndo ) const;
462 class ScUndoAutoFormat: public ScBlockUndo
464 public:
465 TYPEINFO();
466 ScUndoAutoFormat( ScDocShell* pNewDocShell,
467 const ScRange& rRange, ScDocument* pNewUndoDoc,
468 const ScMarkData& rMark,
469 sal_Bool bNewSize, sal_uInt16 nNewFormatNo );
470 virtual ~ScUndoAutoFormat();
472 virtual void Undo();
473 virtual void Redo();
474 virtual void Repeat(SfxRepeatTarget& rTarget);
475 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
477 virtual OUString GetComment() const;
479 private:
480 ScDocument* pUndoDoc; // deleted data
481 ScMarkData aMarkData;
482 sal_Bool bSize;
483 sal_uInt16 nFormatNo;
487 class ScUndoReplace: public ScSimpleUndo
489 public:
490 TYPEINFO();
491 ScUndoReplace( ScDocShell* pNewDocShell,
492 const ScMarkData& rMark,
493 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
494 const String& rNewUndoStr, ScDocument* pNewUndoDoc,
495 const SvxSearchItem* pItem );
496 virtual ~ScUndoReplace();
498 virtual void Undo();
499 virtual void Redo();
500 virtual void Repeat(SfxRepeatTarget& rTarget);
501 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
503 virtual OUString GetComment() const;
505 private:
506 ScAddress aCursorPos;
507 ScMarkData aMarkData;
508 String aUndoStr; // Data at single selection
509 ScDocument* pUndoDoc; // Block mark and deleted data
510 SvxSearchItem* pSearchItem;
511 sal_uLong nStartChangeAction;
512 sal_uLong nEndChangeAction;
514 void SetChangeTrack();
518 class ScUndoTabOp: public ScSimpleUndo
520 public:
521 TYPEINFO();
522 ScUndoTabOp( ScDocShell* pNewDocShell,
523 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
524 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
525 ScDocument* pNewUndoDoc,
526 const ScRefAddress& rFormulaCell,
527 const ScRefAddress& rFormulaEnd,
528 const ScRefAddress& rRowCell,
529 const ScRefAddress& rColCell,
530 sal_uInt8 nMode );
531 virtual ~ScUndoTabOp();
533 virtual void Undo();
534 virtual void Redo();
535 virtual void Repeat(SfxRepeatTarget& rTarget);
536 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
538 virtual OUString GetComment() const;
540 private:
541 ScRange aRange;
542 ScDocument* pUndoDoc; // Deleted data
543 ScRefAddress theFormulaCell;
544 ScRefAddress theFormulaEnd;
545 ScRefAddress theRowCell;
546 ScRefAddress theColCell;
547 sal_uInt8 nMode;
551 class ScUndoConversion : public ScSimpleUndo
553 public:
554 TYPEINFO();
556 ScUndoConversion(
557 ScDocShell* pNewDocShell, const ScMarkData& rMark,
558 SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc,
559 SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc,
560 const ScConversionParam& rConvParam );
561 virtual ~ScUndoConversion();
563 virtual void Undo();
564 virtual void Redo();
565 virtual void Repeat(SfxRepeatTarget& rTarget);
566 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
568 virtual OUString GetComment() const;
570 private:
571 ScMarkData aMarkData;
572 ScAddress aCursorPos;
573 ScDocument* pUndoDoc; // Block mark and deleted data
574 ScAddress aNewCursorPos;
575 ScDocument* pRedoDoc; // Block mark and new data
576 sal_uLong nStartChangeAction;
577 sal_uLong nEndChangeAction;
578 ScConversionParam maConvParam; /// Conversion type and parameters.
580 void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos );
581 void SetChangeTrack();
584 class ScUndoRefConversion: public ScSimpleUndo
586 public:
587 TYPEINFO();
588 ScUndoRefConversion( ScDocShell* pNewDocShell,
589 const ScRange& aMarkRange, const ScMarkData& rMark,
590 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag);
591 virtual ~ScUndoRefConversion();
593 virtual void Undo();
594 virtual void Redo();
595 virtual void Repeat(SfxRepeatTarget& rTarget);
596 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
598 virtual OUString GetComment() const;
600 private:
601 ScMarkData aMarkData;
602 ScDocument* pUndoDoc;
603 ScDocument* pRedoDoc;
604 ScRange aRange;
605 sal_Bool bMulti;
606 sal_uInt16 nFlags;
607 sal_uLong nStartChangeAction;
608 sal_uLong nEndChangeAction;
610 void DoChange( ScDocument* pRefDoc);
611 void SetChangeTrack();
614 class ScUndoListNames: public ScBlockUndo
616 public:
617 TYPEINFO();
618 ScUndoListNames( ScDocShell* pNewDocShell,
619 const ScRange& rRange,
620 ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc );
621 virtual ~ScUndoListNames();
623 virtual void Undo();
624 virtual void Redo();
625 virtual void Repeat(SfxRepeatTarget& rTarget);
626 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
628 virtual OUString GetComment() const;
630 private:
631 ScDocument* pUndoDoc;
632 ScDocument* pRedoDoc;
634 void DoChange( ScDocument* pSrcDoc ) const;
638 class ScUndoUseScenario: public ScSimpleUndo
640 public:
641 TYPEINFO();
642 ScUndoUseScenario( ScDocShell* pNewDocShell,
643 const ScMarkData& rMark,
644 const ScArea& rDestArea, ScDocument* pNewUndoDoc,
645 const String& rNewName );
646 virtual ~ScUndoUseScenario();
648 virtual void Undo();
649 virtual void Redo();
650 virtual void Repeat(SfxRepeatTarget& rTarget);
651 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
653 virtual OUString GetComment() const;
655 private:
656 ScDocument* pUndoDoc;
657 ScRange aRange;
658 ScMarkData aMarkData;
659 String aName;
663 class ScUndoSelectionStyle: public ScSimpleUndo
665 public:
666 TYPEINFO();
667 ScUndoSelectionStyle( ScDocShell* pNewDocShell,
668 const ScMarkData& rMark,
669 const ScRange& rRange,
670 const String& rName,
671 ScDocument* pNewUndoDoc );
672 virtual ~ScUndoSelectionStyle();
674 virtual void Undo();
675 virtual void Redo();
676 virtual void Repeat(SfxRepeatTarget& rTarget);
677 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
679 virtual OUString GetComment() const;
680 virtual sal_uInt16 GetId() const;
682 private:
683 ScMarkData aMarkData;
684 ScDocument* pUndoDoc;
685 String aStyleName;
686 ScRange aRange;
688 void DoChange( const sal_Bool bUndo );
692 class ScUndoRefreshLink: public ScSimpleUndo
694 public:
695 TYPEINFO();
696 ScUndoRefreshLink( ScDocShell* pNewDocShell,
697 ScDocument* pNewUndoDoc );
698 virtual ~ScUndoRefreshLink();
700 virtual void Undo();
701 virtual void Redo();
702 virtual void Repeat(SfxRepeatTarget& rTarget);
703 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
705 virtual OUString GetComment() const;
707 private:
708 ScDocument* pUndoDoc;
709 ScDocument* pRedoDoc;
713 class ScUndoEnterMatrix: public ScBlockUndo
715 public:
716 TYPEINFO();
717 ScUndoEnterMatrix( ScDocShell* pNewDocShell,
718 const ScRange& rArea,
719 ScDocument* pNewUndoDoc,
720 const String& rForm );
721 virtual ~ScUndoEnterMatrix();
723 virtual void Undo();
724 virtual void Redo();
725 virtual void Repeat(SfxRepeatTarget& rTarget);
726 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
728 virtual OUString GetComment() const;
730 private:
731 ScDocument* pUndoDoc;
732 String aFormula;
733 sal_uLong nStartChangeAction;
734 sal_uLong nEndChangeAction;
736 void SetChangeTrack();
740 class ScUndoInsertAreaLink : public ScSimpleUndo
742 public:
743 TYPEINFO();
744 ScUndoInsertAreaLink( ScDocShell* pShell,
745 const String& rDoc,
746 const String& rFlt, const String& rOpt,
747 const String& rArea, const ScRange& rDestRange,
748 sal_uLong nRefreshDelay );
749 virtual ~ScUndoInsertAreaLink();
751 virtual void Undo();
752 virtual void Redo();
753 virtual void Repeat(SfxRepeatTarget& rTarget);
754 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
756 virtual OUString GetComment() const;
758 private:
759 String aDocName;
760 String aFltName;
761 String aOptions;
762 String aAreaName;
763 ScRange aRange;
764 sal_uLong nRefreshDelay;
768 class ScUndoRemoveAreaLink : public ScSimpleUndo
770 public:
771 TYPEINFO();
772 ScUndoRemoveAreaLink( ScDocShell* pShell,
773 const String& rDoc,
774 const String& rFlt, const String& rOpt,
775 const String& rArea, const ScRange& rDestRange,
776 sal_uLong nRefreshDelay );
777 virtual ~ScUndoRemoveAreaLink();
779 virtual void Undo();
780 virtual void Redo();
781 virtual void Repeat(SfxRepeatTarget& rTarget);
782 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
784 virtual OUString GetComment() const;
786 private:
787 String aDocName;
788 String aFltName;
789 String aOptions;
790 String aAreaName;
791 ScRange aRange;
792 sal_uLong nRefreshDelay;
796 class ScUndoUpdateAreaLink : public ScSimpleUndo //! also change BlockUndo?
798 public:
799 TYPEINFO();
800 ScUndoUpdateAreaLink( ScDocShell* pShell,
801 const String& rOldD,
802 const String& rOldF, const String& rOldO,
803 const String& rOldA, const ScRange& rOldR,
804 sal_uLong nOldRD,
805 const String& rNewD,
806 const String& rNewF, const String& rNewO,
807 const String& rNewA, const ScRange& rNewR,
808 sal_uLong nNewRD,
809 ScDocument* pUndo, ScDocument* pRedo,
810 sal_Bool bDoInsert );
811 virtual ~ScUndoUpdateAreaLink();
813 virtual void Undo();
814 virtual void Redo();
815 virtual void Repeat(SfxRepeatTarget& rTarget);
816 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
818 virtual OUString GetComment() const;
820 private:
821 String aOldDoc;
822 String aOldFlt;
823 String aOldOpt;
824 String aOldArea;
825 ScRange aOldRange;
826 String aNewDoc;
827 String aNewFlt;
828 String aNewOpt;
829 String aNewArea;
830 ScRange aNewRange;
831 ScDocument* pUndoDoc;
832 ScDocument* pRedoDoc;
833 sal_uLong nOldRefresh;
834 sal_uLong nNewRefresh;
835 sal_Bool bWithInsert;
837 void DoChange( const sal_Bool bUndo ) const;
841 class ScUndoIndent: public ScBlockUndo
843 public:
844 TYPEINFO();
845 ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark,
846 ScDocument* pNewUndoDoc, sal_Bool bIncrement );
847 virtual ~ScUndoIndent();
849 virtual void Undo();
850 virtual void Redo();
851 virtual void Repeat(SfxRepeatTarget& rTarget);
852 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
854 virtual OUString GetComment() const;
856 private:
857 ScMarkData aMarkData;
858 ScDocument* pUndoDoc;
859 sal_Bool bIsIncrement;
863 class ScUndoTransliterate: public ScBlockUndo
865 public:
866 TYPEINFO();
867 ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark,
868 ScDocument* pNewUndoDoc, sal_Int32 nType );
869 virtual ~ScUndoTransliterate();
871 virtual void Undo();
872 virtual void Redo();
873 virtual void Repeat(SfxRepeatTarget& rTarget);
874 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
876 virtual OUString GetComment() const;
878 private:
879 ScMarkData aMarkData;
880 ScDocument* pUndoDoc;
881 sal_Int32 nTransliterationType;
885 class ScUndoClearItems: public ScBlockUndo
887 public:
888 TYPEINFO();
889 ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark,
890 ScDocument* pNewUndoDoc, const sal_uInt16* pW );
891 virtual ~ScUndoClearItems();
893 virtual void Undo();
894 virtual void Redo();
895 virtual void Repeat(SfxRepeatTarget& rTarget);
896 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
898 virtual OUString GetComment() const;
900 private:
901 ScMarkData aMarkData;
902 ScDocument* pUndoDoc;
903 sal_uInt16* pWhich;
907 class ScUndoRemoveBreaks: public ScSimpleUndo
909 public:
910 TYPEINFO();
911 ScUndoRemoveBreaks( ScDocShell* pNewDocShell,
912 SCTAB nNewTab, ScDocument* pNewUndoDoc );
913 virtual ~ScUndoRemoveBreaks();
915 virtual void Undo();
916 virtual void Redo();
917 virtual void Repeat(SfxRepeatTarget& rTarget);
918 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
920 virtual OUString GetComment() const;
922 private:
923 SCTAB nTab;
924 ScDocument* pUndoDoc;
928 class ScUndoRemoveMerge: public ScBlockUndo
930 public:
931 TYPEINFO();
932 ScUndoRemoveMerge( ScDocShell* pNewDocShell,
933 const ScCellMergeOption& rOption,
934 ScDocument* pNewUndoDoc );
935 virtual ~ScUndoRemoveMerge();
937 virtual void Undo();
938 virtual void Redo();
939 virtual void Repeat(SfxRepeatTarget& rTarget);
940 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
942 virtual OUString GetComment() const;
944 private:
945 void SetCurTab();
947 ScCellMergeOption maOption;
948 ScDocument* pUndoDoc;
952 class ScUndoBorder: public ScBlockUndo
954 public:
955 TYPEINFO();
956 ScUndoBorder( ScDocShell* pNewDocShell,
957 const ScRangeList& rRangeList,
958 ScDocument* pNewUndoDoc,
959 const SvxBoxItem& rNewOuter,
960 const SvxBoxInfoItem& rNewInner );
961 virtual ~ScUndoBorder();
963 virtual void Undo();
964 virtual void Redo();
965 virtual void Repeat(SfxRepeatTarget& rTarget);
966 virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const;
968 virtual OUString GetComment() const;
970 private:
971 ScDocument* pUndoDoc;
972 ScRangeList* pRanges;
973 SvxBoxItem* pOuter;
974 SvxBoxInfoItem* pInner;
980 #endif
982 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */