1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: editundo.hxx,v $
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 ************************************************************************/
34 #include <editdoc.hxx>
35 #include <editund2.hxx>
36 #include <svx/editdata.hxx>
38 #define UNDO_NOACTION 0
39 #define UNDO_NEWUNDO 1
40 #define UNDO_UNDOSDELETED 2
41 #define UNDO_EMPTYGROUPDELETED 3
42 #define UNDO_INVALIDEND 4
47 // -----------------------------------------------------------------------
49 // ------------------------------------------------------------------------
50 class EditUndoDelContent
: public EditUndo
55 ContentNode
* pContentNode
; // Zeigt auf das gueltige,
56 // nicht zerstoerte Objekt!
60 EditUndoDelContent( ImpEditEngine
* pImpEE
, ContentNode
* pNode
, USHORT nPortio
);
61 ~EditUndoDelContent();
67 // -----------------------------------------------------------------------
68 // EditUndoConnectParas
69 // ------------------------------------------------------------------------
70 class EditUndoConnectParas
: public EditUndo
75 SfxItemSet aLeftParaAttribs
;
76 SfxItemSet aRightParaAttribs
;
78 // 2 Pointer waeren schoener, aber dann muesste es ein SfxListener sein.
79 String aLeftStyleName
;
80 String aRightStyleName
;
81 SfxStyleFamily eLeftStyleFamily
;
82 SfxStyleFamily eRightStyleFamily
;
88 EditUndoConnectParas( ImpEditEngine
* pImpEE
, USHORT nNode
, USHORT nSepPos
,
89 const SfxItemSet
& rLeftParaAttribs
, const SfxItemSet
& rRightParaAttribs
,
90 const SfxStyleSheet
* pLeftStyle
, const SfxStyleSheet
* pRightStyle
, BOOL bBackward
);
91 ~EditUndoConnectParas();
97 // -----------------------------------------------------------------------
99 // ------------------------------------------------------------------------
100 class EditUndoSplitPara
: public EditUndo
108 EditUndoSplitPara( ImpEditEngine
* pImpEE
, USHORT nNode
, USHORT nSepPos
);
109 ~EditUndoSplitPara();
115 // -----------------------------------------------------------------------
116 // EditUndoInsertChars
117 // ------------------------------------------------------------------------
118 class EditUndoInsertChars
: public EditUndo
126 EditUndoInsertChars( ImpEditEngine
* pImpEE
, const EPaM
& rEPaM
, const String
& rStr
);
128 const EPaM
& GetEPaM() { return aEPaM
; }
129 String
& GetStr() { return aText
; }
134 virtual BOOL
Merge( SfxUndoAction
*pNextAction
);
137 // -----------------------------------------------------------------------
138 // EditUndoRemoveChars
139 // ------------------------------------------------------------------------
140 class EditUndoRemoveChars
: public EditUndo
148 EditUndoRemoveChars( ImpEditEngine
* pImpEE
, const EPaM
& rEPaM
, const String
& rStr
);
150 const EPaM
& GetEPaM() { return aEPaM
; }
151 String
& GetStr() { return aText
; }
157 // -----------------------------------------------------------------------
158 // EditUndoInsertFeature
159 // ------------------------------------------------------------------------
160 class EditUndoInsertFeature
: public EditUndo
164 SfxPoolItem
* pFeature
;
168 EditUndoInsertFeature( ImpEditEngine
* pImpEE
, const EPaM
& rEPaM
,
169 const SfxPoolItem
& rFeature
);
170 ~EditUndoInsertFeature();
176 // -----------------------------------------------------------------------
177 // EditUndoMoveParagraphs
178 // ------------------------------------------------------------------------
179 class EditUndoMoveParagraphs
: public EditUndo
187 EditUndoMoveParagraphs( ImpEditEngine
* pImpEE
, const Range
& rParas
, USHORT nDest
);
188 ~EditUndoMoveParagraphs();
194 // -----------------------------------------------------------------------
195 // EditUndoSetStyleSheet
196 // ------------------------------------------------------------------------
197 class EditUndoSetStyleSheet
: public EditUndo
203 SfxStyleFamily ePrevFamily
;
204 SfxStyleFamily eNewFamily
;
205 SfxItemSet aPrevParaAttribs
;
210 EditUndoSetStyleSheet( ImpEditEngine
* pImpEE
, USHORT nPara
,
211 const XubString
& rPrevName
, SfxStyleFamily ePrevFamily
,
212 const XubString
& rNewName
, SfxStyleFamily eNewFamily
,
213 const SfxItemSet
& rPrevParaAttribs
);
214 ~EditUndoSetStyleSheet();
220 // -----------------------------------------------------------------------
221 // EditUndoSetParaAttribs
222 // ------------------------------------------------------------------------
223 class EditUndoSetParaAttribs
: public EditUndo
227 SfxItemSet aPrevItems
;
228 SfxItemSet aNewItems
;
232 EditUndoSetParaAttribs( ImpEditEngine
* pImpEE
, USHORT nPara
, const SfxItemSet
& rPrevItems
, const SfxItemSet
& rNewItems
);
233 ~EditUndoSetParaAttribs();
239 // -----------------------------------------------------------------------
240 // EditUndoSetAttribs
241 // ------------------------------------------------------------------------
242 class EditUndoSetAttribs
: public EditUndo
246 SfxItemSet aNewAttribs
;
247 ContentInfoArray aPrevAttribs
;
251 BOOL bRemoveParaAttribs
;
254 void ImpSetSelection( EditView
* pView
);
259 EditUndoSetAttribs( ImpEditEngine
* pImpEE
, const ESelection
& rESel
, const SfxItemSet
& rNewItems
);
260 ~EditUndoSetAttribs();
262 ContentInfoArray
& GetContentInfos() { return aPrevAttribs
; }
263 SfxItemSet
& GetNewAttribs() { return aNewAttribs
; }
265 void SetSpecial( BYTE n
) { nSpecial
= n
; }
266 void SetRemoveAttribs( BOOL b
) { bSetIsRemove
= b
; }
267 void SetRemoveParaAttribs( BOOL b
) { bRemoveParaAttribs
= b
; }
268 void SetRemoveWhich( USHORT n
) { nRemoveWhich
= n
; }
274 // -----------------------------------------------------------------------
275 // EditUndoTransliteration
276 // ------------------------------------------------------------------------
277 class EditUndoTransliteration
: public EditUndo
284 EditTextObject
* pTxtObj
;
289 EditUndoTransliteration( ImpEditEngine
* pImpEE
, const ESelection
& rESel
, sal_Int32 nMode
);
290 ~EditUndoTransliteration();
292 void SetText( const String
& rText
) { aText
= rText
; }
293 void SetText( EditTextObject
* pObj
) { pTxtObj
= pObj
; }
294 void SetNewSelection( const ESelection
& rSel
) { aNewESel
= rSel
; }
300 // -----------------------------------------------------------------------
301 // EditUndoMarkSelection
302 // ------------------------------------------------------------------------
303 class EditUndoMarkSelection
: public EditUndo
306 ESelection aSelection
;
310 EditUndoMarkSelection( ImpEditEngine
* pImpEE
, const ESelection
& rSel
);
311 ~EditUndoMarkSelection();
318 #endif // _EDITUNDO_HXX