xref: /aoo4110/main/editeng/inc/editeng/editund2.hxx (revision b1cdbd2c)
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 
24 #ifndef _EDITUND2_HXX
25 #define _EDITUND2_HXX
26 
27 #include "editeng/editengdllapi.h"
28 #include <svl/undo.hxx>
29 
30 class ImpEditEngine;
31 
32 class EDITENG_DLLPUBLIC EditUndoManager : public SfxUndoManager
33 {
34 private:
35 	using SfxUndoManager::Undo;
36 	using SfxUndoManager::Redo;
37     friend class ImpEditEngine;
38 
39 	ImpEditEngine*	mpImpEE;
40     void SetImpEditEngine(ImpEditEngine* pNew);
41 
42 public:
43     EditUndoManager(sal_uInt16 nMaxUndoActionCount = 20);
44 
45 	virtual sal_Bool Undo();
46 	virtual sal_Bool Redo();
47 };
48 
49 // -----------------------------------------------------------------------
50 // EditUndo
51 // ------------------------------------------------------------------------
52 class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction
53 {
54 private:
55 	sal_uInt16 			nId;
56 	ImpEditEngine*	pImpEE;
57 
58 public:
59 					TYPEINFO();
60 					EditUndo( sal_uInt16 nI, ImpEditEngine* pImpEE );
61 	virtual 		~EditUndo();
62 
GetImpEditEngine() const63 	ImpEditEngine*	GetImpEditEngine() const	{ return pImpEE; }
64 
65 	virtual void	Undo() 		= 0;
66 	virtual void	Redo()		= 0;
67 
68 	virtual sal_Bool	CanRepeat(SfxRepeatTarget&) const;
69 	virtual String	GetComment() const;
70 	virtual sal_uInt16	GetId() const;
71 };
72 
73 #endif	// _EDITUND2_HXX
74 
75 
76