merge the formfield patch from ooo-build
[ooovba.git] / sd / inc / undo / undoobjects.hxx
blob6f8e157cc0a998ead5725cc017a6b237a61186a4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: undoobjects.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 #ifndef _SD_UNDOOBJECTS_HXX
32 #define _SD_UNDOOBJECTS_HXX
34 #include <svx/svdundo.hxx>
35 #include <svx/svdpage.hxx>
36 #include <svx/svdobj.hxx>
37 #include "pres.hxx"
39 class SdrObjUserCall;
40 class SdPage;
42 namespace sd
44 class UndoManager;
46 ///////////////////////////////////////////////////////////////////////
48 class UndoRemovePresObjectImpl
50 protected:
51 UndoRemovePresObjectImpl( SdrObject& rObject );
52 virtual ~UndoRemovePresObjectImpl();
54 virtual void Undo();
55 virtual void Redo();
57 private:
58 SfxUndoAction* mpUndoUsercall;
59 SfxUndoAction* mpUndoAnimation;
60 SfxUndoAction* mpUndoPresObj;
63 ///////////////////////////////////////////////////////////////////////
65 class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
67 public:
68 UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
70 virtual void Undo();
71 virtual void Redo();
73 private:
74 SdrObjectWeakRef mxSdrObject;
77 ///////////////////////////////////////////////////////////////////////
79 class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
81 public:
82 UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
84 virtual void Undo();
85 virtual void Redo();
87 private:
88 SdrObjectWeakRef mxSdrObject;
91 ///////////////////////////////////////////////////////////////////////
93 class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
95 public:
96 UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
98 virtual void Undo();
99 virtual void Redo();
101 private:
102 SdrObjectWeakRef mxSdrObject;
105 ///////////////////////////////////////////////////////////////////////
107 class UndoObjectSetText : public SdrUndoObjSetText
109 public:
110 UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
111 virtual ~UndoObjectSetText();
113 virtual void Undo();
114 virtual void Redo();
116 private:
117 SfxUndoAction* mpUndoAnimation;
118 bool mbNewEmptyPresObj;
119 SdrObjectWeakRef mxSdrObject;
122 //////////////////////////////////////////////////////////////////////////////
123 // Undo for SdrObject::SetUserCall()
125 class UndoObjectUserCall : public SdrUndoObj
127 public:
128 UndoObjectUserCall(SdrObject& rNewObj);
130 virtual void Undo();
131 virtual void Redo();
133 protected:
134 SdrObjUserCall* mpOldUserCall;
135 SdrObjUserCall* mpNewUserCall;
136 SdrObjectWeakRef mxSdrObject;
139 //////////////////////////////////////////////////////////////////////////////
140 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
142 class UndoObjectPresentationKind : public SdrUndoObj
144 public:
145 UndoObjectPresentationKind(SdrObject& rObject);
147 virtual void Undo();
148 virtual void Redo();
150 protected:
151 PresObjKind meOldKind;
152 PresObjKind meNewKind;
153 SdrPageWeakRef mxPage;
154 SdrObjectWeakRef mxSdrObject;
157 //////////////////////////////////////////////////////////////////////////////
158 // Restores correct position and size for presentation shapes with user call
159 // on undo
161 class UndoAutoLayoutPosAndSize : public SfxUndoAction
163 public:
164 UndoAutoLayoutPosAndSize( SdPage& rPage );
166 virtual void Undo();
167 virtual void Redo();
169 protected:
170 SdrPageWeakRef mxPage;
173 //////////////////////////////////////////////////////////////////////////////
175 class UndoGeoObject : public SdrUndoGeoObj
177 public:
178 UndoGeoObject( SdrObject& rNewObj );
180 virtual void Undo();
181 virtual void Redo();
183 protected:
184 SdrPageWeakRef mxPage;
185 SdrObjectWeakRef mxSdrObject;
188 //////////////////////////////////////////////////////////////////////////////
190 class UndoAttrObject : public SdrUndoAttrObj
192 public:
193 UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
195 virtual void Undo();
196 virtual void Redo();
198 protected:
199 SdrPageWeakRef mxPage;
200 SdrObjectWeakRef mxSdrObject;
203 } // namespace sd
205 #endif // _SD_UNDOOBJECTS_HXX