Bump version to 6.0-36
[LibreOffice.git] / sd / inc / undo / undoobjects.hxx
blob964b0776caaa9b2fe4818c47a5ec0ec925c58d7d
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 INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
21 #define INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
23 #include <memory>
24 #include <svx/svdundo.hxx>
25 #include <svx/svdpage.hxx>
26 #include <svx/svdobj.hxx>
27 #include <pres.hxx>
29 class SdrObjUserCall;
30 class SdPage;
32 namespace sd
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 class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
52 public:
53 UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
55 virtual void Undo() override;
56 virtual void Redo() override;
58 private:
59 SdrObjectWeakRef mxSdrObject;
62 class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
64 public:
65 UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
67 virtual void Undo() override;
68 virtual void Redo() override;
70 private:
71 SdrObjectWeakRef mxSdrObject;
74 class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
76 public:
77 UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
79 virtual void Undo() override;
80 virtual void Redo() override;
82 private:
83 SdrObjectWeakRef mxSdrObject;
86 class UndoObjectSetText : public SdrUndoObjSetText
88 public:
89 UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
90 virtual ~UndoObjectSetText() override;
92 virtual void Undo() override;
93 virtual void Redo() override;
95 private:
96 std::unique_ptr<SfxUndoAction> mpUndoAnimation;
97 bool mbNewEmptyPresObj;
98 SdrObjectWeakRef mxSdrObject;
101 // Undo for SdrObject::SetUserCall()
103 class UndoObjectUserCall final : public SdrUndoObj
105 public:
106 UndoObjectUserCall(SdrObject& rNewObj);
108 virtual void Undo() override;
109 virtual void Redo() override;
111 private:
112 SdrObjUserCall* mpOldUserCall;
113 SdrObjUserCall* mpNewUserCall;
114 SdrObjectWeakRef mxSdrObject;
117 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
119 class UndoObjectPresentationKind final : public SdrUndoObj
121 public:
122 UndoObjectPresentationKind(SdrObject& rObject);
124 virtual void Undo() override;
125 virtual void Redo() override;
127 private:
128 PresObjKind meOldKind;
129 PresObjKind meNewKind;
130 SdrPageWeakRef mxPage;
131 SdrObjectWeakRef mxSdrObject;
134 // Restores correct position and size for presentation shapes with user call
135 // on undo
137 class UndoAutoLayoutPosAndSize final : public SfxUndoAction
139 public:
140 UndoAutoLayoutPosAndSize( SdPage& rPage );
142 virtual void Undo() override;
143 virtual void Redo() override;
145 private:
146 SdrPageWeakRef mxPage;
149 class UndoGeoObject final : public SdrUndoGeoObj
151 public:
152 UndoGeoObject( SdrObject& rNewObj );
154 virtual void Undo() override;
155 virtual void Redo() override;
157 private:
158 SdrPageWeakRef mxPage;
159 SdrObjectWeakRef mxSdrObject;
162 class UndoAttrObject final : public SdrUndoAttrObj
164 public:
165 UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
167 virtual void Undo() override;
168 virtual void Redo() override;
170 private:
171 SdrPageWeakRef mxPage;
172 SdrObjectWeakRef mxSdrObject;
175 } // namespace sd
177 #endif // INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */