Update ooo320-m1
[ooovba.git] / svx / source / outliner / outlundo.hxx
blob7ed0e83a7197ae0ad2ef24a6ffc0a2df5727941e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: outlundo.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _OUTLUNDO_HXX
32 #define _OUTLUNDO_HXX
34 #include <svx/outliner.hxx>
36 #ifndef _EDITDATA_HXX
37 #include <svx/editdata.hxx>
38 #endif
39 #include <editund2.hxx>
41 class OutlinerUndoBase : public EditUndo
43 private:
44 Outliner* mpOutliner;
46 public:
47 OutlinerUndoBase( USHORT nId, Outliner* pOutliner );
49 Outliner* GetOutliner() const { return mpOutliner; }
52 class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
54 private:
55 sal_uInt16 mnPara;
56 sal_uInt16 mnOldFlags;
57 sal_uInt16 mnNewFlags;
59 void ImplChangeFlags( sal_uInt16 nFlags );
61 public:
62 OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt16 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
64 virtual void Undo();
65 virtual void Redo();
68 class OutlinerUndoChangeParaNumberingRestart : public OutlinerUndoBase
70 private:
71 sal_uInt16 mnPara;
73 struct ParaRestartData
75 sal_Int16 mnNumberingStartValue;
76 sal_Bool mbParaIsNumberingRestart;
79 ParaRestartData maUndoData;
80 ParaRestartData maRedoData;
82 void ImplApplyData( const ParaRestartData& rData );
83 public:
84 OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt16 nPara,
85 sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue,
86 sal_Bool nOldbParaIsNumberingRestart, sal_Bool nbNewParaIsNumberingRestart );
88 virtual void Undo();
89 virtual void Redo();
92 class OutlinerUndoChangeDepth : public OutlinerUndoBase
94 using SfxUndoAction::Repeat;
95 private:
96 USHORT mnPara;
97 sal_Int16 mnOldDepth;
98 sal_Int16 mnNewDepth;
100 public:
101 OutlinerUndoChangeDepth( Outliner* pOutliner, USHORT nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
103 virtual void Undo();
104 virtual void Redo();
105 virtual void Repeat();
108 // Hilfs-Undo: Wenn es fuer eine Aktion keine OutlinerUndoAction gibst, weil
109 // die EditEngine das handelt, aber z.B. noch das Bullet neu berechnet werden muss.
111 class OutlinerUndoCheckPara : public OutlinerUndoBase
113 using SfxUndoAction::Repeat;
114 private:
115 USHORT mnPara;
117 public:
118 OutlinerUndoCheckPara( Outliner* pOutliner, USHORT nPara );
120 virtual void Undo();
121 virtual void Redo();
122 virtual void Repeat();
127 // -------------------------------------
130 class OLUndoExpand : public EditUndo
132 using SfxUndoAction::Repeat;
133 void Restore( BOOL bUndo );
134 public:
135 OLUndoExpand( Outliner* pOut, USHORT nId );
136 ~OLUndoExpand();
137 virtual void Undo();
138 virtual void Redo();
139 virtual void Repeat();
141 USHORT* pParas; // 0 == nCount enthaelt Absatznummer
142 Outliner* pOutliner;
143 USHORT nCount;
146 #endif