xref: /trunk/main/svtools/source/edit/textund2.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _TEXTUND2_HXX
28 #define _TEXTUND2_HXX
29 
30 #include <textundo.hxx>
31 
32 
33 class TextUndoDelPara : public TextUndo
34 {
35 private:
36 	sal_Bool 			mbDelObject;
37 	sal_uLong 			mnPara;
38 	TextNode* 		mpNode;	// Zeigt auf das gueltige, nicht zerstoerte Objekt!
39 
40 public:
41 					TYPEINFO();
42 					TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
43 					~TextUndoDelPara();
44 
45 	virtual void 	Undo();
46 	virtual void 	Redo();
47 };
48 
49 
50 class TextUndoConnectParas : public TextUndo
51 {
52 private:
53 	sal_uLong 			mnPara;
54 	sal_uInt16			mnSepPos;
55 
56 public:
57 					TYPEINFO();
58 					TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
59 					~TextUndoConnectParas();
60 
61 	virtual void 	Undo();
62 	virtual void 	Redo();
63 };
64 
65 
66 class TextUndoSplitPara : public TextUndo
67 {
68 private:
69 	sal_uLong 			mnPara;
70 	sal_uInt16			mnSepPos;
71 
72 public:
73 					TYPEINFO();
74 					TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
75 					~TextUndoSplitPara();
76 
77 	virtual void 	Undo();
78 	virtual void 	Redo();
79 };
80 
81 
82 class TextUndoInsertChars : public TextUndo
83 {
84 private:
85 	TextPaM			maTextPaM;
86 	String			maText;
87 
88 public:
89 					TYPEINFO();
90 					TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
91 
92 //	const TextPaM&	GetTextPaM() { return aTextPaM; }
93 //	String&			GetStr() { return aText; }
94 
95 	virtual void 	Undo();
96 	virtual void 	Redo();
97 
98 	virtual sal_Bool	Merge( SfxUndoAction *pNextAction );
99 };
100 
101 
102 class TextUndoRemoveChars : public TextUndo
103 {
104 private:
105 	TextPaM			maTextPaM;
106 	String			maText;
107 
108 public:
109 					TYPEINFO();
110 					TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
111 
112 //	const TextPaM&		GetTextPaM() { return aTextPaM; }
113 //	String&			GetStr() { return aText; }
114 
115 	virtual void 	Undo();
116 	virtual void 	Redo();
117 };
118 
119 
120 class TextUndoSetAttribs: public TextUndo
121 {
122 private:
123 	TextSelection		maSelection;
124 //	SfxItemSet			aNewAttribs;
125 //	TextInfoArray		aPrevAttribs;
126 //	sal_uInt8				nSpecial;
127 //	sal_Bool				bSetIsRemove;
128 //	sal_uInt16				nRemoveWhich;
129 //
130 //	void				ImpSetSelection( TextView* pView );
131 
132 
133 public:
134 						TYPEINFO();
135 						TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rESel );
136 						~TextUndoSetAttribs();
137 
138 //	TextInfoArray&		GetTextInfos()	{ return aPrevAttribs; }
139 //	SfxItemSet&			GetNewAttribs()		{ return aNewAttribs; }
140 //	void				SetSpecial( sal_uInt8 n ) 			{ nSpecial = n; }
141 //	void				SetRemoveAttribs( sal_Bool b ) 		{ bSetIsRemove = b; }
142 //	void				SetRemoveWhich( sal_uInt16 n )		{ nRemoveWhich = n; }
143 
144 	virtual void		Undo();
145 	virtual void		Redo();
146 };
147 
148 #endif // _TEXTUND2_HXX
149