1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
24 #include <svx/svdundo.hxx>
25 #include <svx/svdpage.hxx>
26 #include <svx/svdobj.hxx>
35 class UndoRemovePresObjectImpl
38 UndoRemovePresObjectImpl( SdrObject
& rObject
);
39 virtual ~UndoRemovePresObjectImpl();
45 SfxUndoAction
* mpUndoUsercall
;
46 SfxUndoAction
* mpUndoAnimation
;
47 SfxUndoAction
* mpUndoPresObj
;
50 class UndoRemoveObject
: public SdrUndoRemoveObj
, public UndoRemovePresObjectImpl
53 UndoRemoveObject( SdrObject
& rObject
, bool bOrdNumDirect
);
55 virtual void Undo() override
;
56 virtual void Redo() override
;
59 SdrObjectWeakRef mxSdrObject
;
62 class UndoDeleteObject
: public SdrUndoDelObj
, public UndoRemovePresObjectImpl
65 UndoDeleteObject( SdrObject
& rObject
, bool bOrdNumDirect
);
67 virtual void Undo() override
;
68 virtual void Redo() override
;
71 SdrObjectWeakRef mxSdrObject
;
74 class UndoReplaceObject
: public SdrUndoReplaceObj
, public UndoRemovePresObjectImpl
77 UndoReplaceObject( SdrObject
& rOldObject
, SdrObject
& rNewObject
, bool bOrdNumDirect
);
79 virtual void Undo() override
;
80 virtual void Redo() override
;
83 SdrObjectWeakRef mxSdrObject
;
86 class UndoObjectSetText
: public SdrUndoObjSetText
89 UndoObjectSetText( SdrObject
& rNewObj
, sal_Int32 nText
);
90 virtual ~UndoObjectSetText() override
;
92 virtual void Undo() override
;
93 virtual void Redo() override
;
96 std::unique_ptr
<SfxUndoAction
> mpUndoAnimation
;
97 bool mbNewEmptyPresObj
;
98 SdrObjectWeakRef mxSdrObject
;
101 // Undo for SdrObject::SetUserCall()
103 class UndoObjectUserCall final
: public SdrUndoObj
106 UndoObjectUserCall(SdrObject
& rNewObj
);
108 virtual void Undo() override
;
109 virtual void Redo() override
;
112 SdrObjUserCall
* mpOldUserCall
;
113 SdrObjUserCall
* mpNewUserCall
;
114 SdrObjectWeakRef mxSdrObject
;
117 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
119 class UndoObjectPresentationKind final
: public SdrUndoObj
122 UndoObjectPresentationKind(SdrObject
& rObject
);
124 virtual void Undo() override
;
125 virtual void Redo() override
;
128 PresObjKind meOldKind
;
129 PresObjKind meNewKind
;
130 SdrPageWeakRef mxPage
;
131 SdrObjectWeakRef mxSdrObject
;
134 // Restores correct position and size for presentation shapes with user call
137 class UndoAutoLayoutPosAndSize final
: public SfxUndoAction
140 UndoAutoLayoutPosAndSize( SdPage
& rPage
);
142 virtual void Undo() override
;
143 virtual void Redo() override
;
146 SdrPageWeakRef mxPage
;
149 class UndoGeoObject final
: public SdrUndoGeoObj
152 UndoGeoObject( SdrObject
& rNewObj
);
154 virtual void Undo() override
;
155 virtual void Redo() override
;
158 SdrPageWeakRef mxPage
;
159 SdrObjectWeakRef mxSdrObject
;
162 class UndoAttrObject final
: public SdrUndoAttrObj
165 UndoAttrObject( SdrObject
& rObject
, bool bStyleSheet1
, bool bSaveText
);
167 virtual void Undo() override
;
168 virtual void Redo() override
;
171 SdrPageWeakRef mxPage
;
172 SdrObjectWeakRef mxSdrObject
;
177 #endif // INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */