update credits
[LibreOffice.git] / sd / inc / undo / undoobjects.hxx
blobf615af64bc9bf0908b509774b78f4f389ae4ade8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SD_UNDOOBJECTS_HXX
21 #define _SD_UNDOOBJECTS_HXX
23 #include <svx/svdundo.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdobj.hxx>
26 #include "pres.hxx"
28 class SdrObjUserCall;
29 class SdPage;
31 namespace sd
33 ///////////////////////////////////////////////////////////////////////
35 class UndoRemovePresObjectImpl
37 protected:
38 UndoRemovePresObjectImpl( SdrObject& rObject );
39 virtual ~UndoRemovePresObjectImpl();
41 virtual void Undo();
42 virtual void Redo();
44 private:
45 SfxUndoAction* mpUndoUsercall;
46 SfxUndoAction* mpUndoAnimation;
47 SfxUndoAction* mpUndoPresObj;
50 ///////////////////////////////////////////////////////////////////////
52 class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
54 public:
55 UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
57 virtual void Undo();
58 virtual void Redo();
60 private:
61 SdrObjectWeakRef mxSdrObject;
64 ///////////////////////////////////////////////////////////////////////
66 class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
68 public:
69 UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
71 virtual void Undo();
72 virtual void Redo();
74 private:
75 SdrObjectWeakRef mxSdrObject;
78 ///////////////////////////////////////////////////////////////////////
80 class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
82 public:
83 UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
85 virtual void Undo();
86 virtual void Redo();
88 private:
89 SdrObjectWeakRef mxSdrObject;
92 ///////////////////////////////////////////////////////////////////////
94 class UndoObjectSetText : public SdrUndoObjSetText
96 public:
97 UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
98 virtual ~UndoObjectSetText();
100 virtual void Undo();
101 virtual void Redo();
103 private:
104 SfxUndoAction* mpUndoAnimation;
105 bool mbNewEmptyPresObj;
106 SdrObjectWeakRef mxSdrObject;
109 //////////////////////////////////////////////////////////////////////////////
110 // Undo for SdrObject::SetUserCall()
112 class UndoObjectUserCall : public SdrUndoObj
114 public:
115 UndoObjectUserCall(SdrObject& rNewObj);
117 virtual void Undo();
118 virtual void Redo();
120 protected:
121 SdrObjUserCall* mpOldUserCall;
122 SdrObjUserCall* mpNewUserCall;
123 SdrObjectWeakRef mxSdrObject;
126 //////////////////////////////////////////////////////////////////////////////
127 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
129 class UndoObjectPresentationKind : public SdrUndoObj
131 public:
132 UndoObjectPresentationKind(SdrObject& rObject);
134 virtual void Undo();
135 virtual void Redo();
137 protected:
138 PresObjKind meOldKind;
139 PresObjKind meNewKind;
140 SdrPageWeakRef mxPage;
141 SdrObjectWeakRef mxSdrObject;
144 //////////////////////////////////////////////////////////////////////////////
145 // Restores correct position and size for presentation shapes with user call
146 // on undo
148 class UndoAutoLayoutPosAndSize : public SfxUndoAction
150 public:
151 UndoAutoLayoutPosAndSize( SdPage& rPage );
153 virtual void Undo();
154 virtual void Redo();
156 protected:
157 SdrPageWeakRef mxPage;
160 //////////////////////////////////////////////////////////////////////////////
162 class UndoGeoObject : public SdrUndoGeoObj
164 public:
165 UndoGeoObject( SdrObject& rNewObj );
167 virtual void Undo();
168 virtual void Redo();
170 protected:
171 SdrPageWeakRef mxPage;
172 SdrObjectWeakRef mxSdrObject;
175 //////////////////////////////////////////////////////////////////////////////
177 class UndoAttrObject : public SdrUndoAttrObj
179 public:
180 UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
182 virtual void Undo();
183 virtual void Redo();
185 protected:
186 SdrPageWeakRef mxPage;
187 SdrObjectWeakRef mxSdrObject;
190 } // namespace sd
192 #endif // _SD_UNDOOBJECTS_HXX
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */