xref: /AOO41X/main/svtools/source/edit/textund2.hxx (revision ff0525f24f03981d56b7579b645949f111420994)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _TEXTUND2_HXX
24 #define _TEXTUND2_HXX
25 
26 #include <textundo.hxx>
27 
28 
29 class TextUndoDelPara : public TextUndo
30 {
31 private:
32     sal_Bool            mbDelObject;
33     sal_uLong           mnPara;
34     TextNode*       mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
35 
36 public:
37                     TYPEINFO();
38                     TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
39                     ~TextUndoDelPara();
40 
41     virtual void    Undo();
42     virtual void    Redo();
43 };
44 
45 
46 class TextUndoConnectParas : public TextUndo
47 {
48 private:
49     sal_uLong           mnPara;
50     sal_uInt16          mnSepPos;
51 
52 public:
53                     TYPEINFO();
54                     TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
55                     ~TextUndoConnectParas();
56 
57     virtual void    Undo();
58     virtual void    Redo();
59 };
60 
61 
62 class TextUndoSplitPara : public TextUndo
63 {
64 private:
65     sal_uLong           mnPara;
66     sal_uInt16          mnSepPos;
67 
68 public:
69                     TYPEINFO();
70                     TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
71                     ~TextUndoSplitPara();
72 
73     virtual void    Undo();
74     virtual void    Redo();
75 };
76 
77 
78 class TextUndoInsertChars : public TextUndo
79 {
80 private:
81     TextPaM         maTextPaM;
82     String          maText;
83 
84 public:
85                     TYPEINFO();
86                     TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
87 
88 //  const TextPaM&  GetTextPaM() { return aTextPaM; }
89 //  String&         GetStr() { return aText; }
90 
91     virtual void    Undo();
92     virtual void    Redo();
93 
94     virtual sal_Bool    Merge( SfxUndoAction *pNextAction );
95 };
96 
97 
98 class TextUndoRemoveChars : public TextUndo
99 {
100 private:
101     TextPaM         maTextPaM;
102     String          maText;
103 
104 public:
105                     TYPEINFO();
106                     TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
107 
108 //  const TextPaM&      GetTextPaM() { return aTextPaM; }
109 //  String&         GetStr() { return aText; }
110 
111     virtual void    Undo();
112     virtual void    Redo();
113 };
114 
115 
116 class TextUndoSetAttribs: public TextUndo
117 {
118 private:
119     TextSelection       maSelection;
120 //  SfxItemSet          aNewAttribs;
121 //  TextInfoArray       aPrevAttribs;
122 //  sal_uInt8               nSpecial;
123 //  sal_Bool                bSetIsRemove;
124 //  sal_uInt16              nRemoveWhich;
125 //
126 //  void                ImpSetSelection( TextView* pView );
127 
128 
129 public:
130                         TYPEINFO();
131                         TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rESel );
132                         ~TextUndoSetAttribs();
133 
134 //  TextInfoArray&      GetTextInfos()  { return aPrevAttribs; }
135 //  SfxItemSet&         GetNewAttribs()     { return aNewAttribs; }
136 //  void                SetSpecial( sal_uInt8 n )           { nSpecial = n; }
137 //  void                SetRemoveAttribs( sal_Bool b )      { bSetIsRemove = b; }
138 //  void                SetRemoveWhich( sal_uInt16 n )      { nRemoveWhich = n; }
139 
140     virtual void        Undo();
141     virtual void        Redo();
142 };
143 
144 #endif // _TEXTUND2_HXX
145