14c5491eaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
34c5491eaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
44c5491eaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
54c5491eaSAndrew Rist  * distributed with this work for additional information
64c5491eaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
74c5491eaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
84c5491eaSAndrew Rist  * "License"); you may not use this file except in compliance
94c5491eaSAndrew Rist  * with the License.  You may obtain a copy of the License at
104c5491eaSAndrew Rist  *
114c5491eaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
124c5491eaSAndrew Rist  *
134c5491eaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
144c5491eaSAndrew Rist  * software distributed under the License is distributed on an
154c5491eaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
164c5491eaSAndrew Rist  * KIND, either express or implied.  See the License for the
174c5491eaSAndrew Rist  * specific language governing permissions and limitations
184c5491eaSAndrew Rist  * under the License.
194c5491eaSAndrew Rist  *
204c5491eaSAndrew Rist  *************************************************************/
214c5491eaSAndrew Rist 
224c5491eaSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _OUTLUNDO_HXX
25cdf0e10cSrcweir #define _OUTLUNDO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <editeng/outliner.hxx>
28cdf0e10cSrcweir #include <editeng/editdata.hxx>
29cdf0e10cSrcweir #include <editeng/editund2.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class OutlinerUndoBase : public EditUndo
32cdf0e10cSrcweir {
33cdf0e10cSrcweir private:
34cdf0e10cSrcweir 	Outliner*	mpOutliner;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir public:
37cdf0e10cSrcweir 				OutlinerUndoBase( sal_uInt16 nId, Outliner* pOutliner );
38cdf0e10cSrcweir 
GetOutliner() const39cdf0e10cSrcweir 	Outliner*	GetOutliner() const { return mpOutliner; }
40cdf0e10cSrcweir };
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
43cdf0e10cSrcweir {
44cdf0e10cSrcweir private:
45*7a980842SDamjanJovanovic 	sal_uInt32		mnPara;
46cdf0e10cSrcweir 	sal_uInt16		mnOldFlags;
47cdf0e10cSrcweir 	sal_uInt16		mnNewFlags;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	void ImplChangeFlags( sal_uInt16 nFlags );
50cdf0e10cSrcweir 
51cdf0e10cSrcweir public:
52*7a980842SDamjanJovanovic 	OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt32 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	virtual void	Undo();
55cdf0e10cSrcweir 	virtual void	Redo();
56cdf0e10cSrcweir };
57cdf0e10cSrcweir 
58cdf0e10cSrcweir class OutlinerUndoChangeParaNumberingRestart : public OutlinerUndoBase
59cdf0e10cSrcweir {
60cdf0e10cSrcweir private:
61*7a980842SDamjanJovanovic     sal_uInt32		mnPara;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     struct ParaRestartData
64cdf0e10cSrcweir     {
65cdf0e10cSrcweir         sal_Int16       mnNumberingStartValue;
66cdf0e10cSrcweir         sal_Bool        mbParaIsNumberingRestart;
67cdf0e10cSrcweir     };
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     ParaRestartData maUndoData;
70cdf0e10cSrcweir     ParaRestartData maRedoData;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     void ImplApplyData( const ParaRestartData& rData );
73cdf0e10cSrcweir public:
74*7a980842SDamjanJovanovic     OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt32 nPara,
75cdf0e10cSrcweir         sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue,
76cdf0e10cSrcweir         sal_Bool  nOldbParaIsNumberingRestart, sal_Bool nbNewParaIsNumberingRestart );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     virtual void	Undo();
79cdf0e10cSrcweir 	virtual void	Redo();
80cdf0e10cSrcweir };
81cdf0e10cSrcweir 
82cdf0e10cSrcweir class OutlinerUndoChangeDepth : public OutlinerUndoBase
83cdf0e10cSrcweir {
84cdf0e10cSrcweir 	using SfxUndoAction::Repeat;
85cdf0e10cSrcweir private:
86*7a980842SDamjanJovanovic 	sal_uInt32 			mnPara;
87cdf0e10cSrcweir 	sal_Int16		mnOldDepth;
88cdf0e10cSrcweir 	sal_Int16		mnNewDepth;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir public:
91*7a980842SDamjanJovanovic 					OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt32 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	virtual void	Undo();
94cdf0e10cSrcweir 	virtual void	Redo();
95cdf0e10cSrcweir 	virtual void 	Repeat();
96cdf0e10cSrcweir };
97cdf0e10cSrcweir 
98cdf0e10cSrcweir // Hilfs-Undo: Wenn es fuer eine Aktion keine OutlinerUndoAction gibst, weil
99cdf0e10cSrcweir // die EditEngine das handelt, aber z.B. noch das Bullet neu berechnet werden muss.
100cdf0e10cSrcweir 
101cdf0e10cSrcweir class OutlinerUndoCheckPara : public OutlinerUndoBase
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	using SfxUndoAction::Repeat;
104cdf0e10cSrcweir private:
105*7a980842SDamjanJovanovic 	sal_uInt32 			mnPara;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir public:
108*7a980842SDamjanJovanovic 					OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt32 nPara );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	virtual void	Undo();
111cdf0e10cSrcweir 	virtual void	Redo();
112cdf0e10cSrcweir 	virtual void 	Repeat();
113cdf0e10cSrcweir };
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 
117cdf0e10cSrcweir // -------------------------------------
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 
120cdf0e10cSrcweir class OLUndoExpand : public EditUndo
121cdf0e10cSrcweir {
122cdf0e10cSrcweir 	using SfxUndoAction::Repeat;
123cdf0e10cSrcweir 	void Restore( sal_Bool bUndo );
124cdf0e10cSrcweir public:
125cdf0e10cSrcweir 	OLUndoExpand( Outliner* pOut, sal_uInt16 nId );
126cdf0e10cSrcweir 	~OLUndoExpand();
127cdf0e10cSrcweir 	virtual void Undo();
128cdf0e10cSrcweir 	virtual void Redo();
129cdf0e10cSrcweir 	virtual void Repeat();
130cdf0e10cSrcweir 
131*7a980842SDamjanJovanovic 	sal_uInt32* pParas;  // 0 == nCount enthaelt Absatznummer
132cdf0e10cSrcweir 	Outliner* pOutliner;
133*7a980842SDamjanJovanovic 	sal_uInt32 nCount;
134cdf0e10cSrcweir };
135cdf0e10cSrcweir 
136cdf0e10cSrcweir #endif
137