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 .
23 #include <svx/svdundo.hxx>
25 #include <tools/weakbase.hxx>
26 #include <unotools/weakref.hxx>
33 class UndoRemovePresObjectImpl
36 UndoRemovePresObjectImpl(SdrObject
& rObject
);
37 virtual ~UndoRemovePresObjectImpl();
43 std::unique_ptr
<SfxUndoAction
> mpUndoUsercall
;
44 std::unique_ptr
<SfxUndoAction
> mpUndoAnimation
;
45 std::unique_ptr
<SfxUndoAction
> mpUndoPresObj
;
48 class UndoRemoveObject final
: public SdrUndoRemoveObj
, public UndoRemovePresObjectImpl
51 UndoRemoveObject(SdrObject
& rObject
);
53 virtual void Undo() override
;
54 virtual void Redo() override
;
57 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
60 class UndoDeleteObject final
: public SdrUndoDelObj
, public UndoRemovePresObjectImpl
63 UndoDeleteObject(SdrObject
& rObject
, bool bOrdNumDirect
);
65 virtual void Undo() override
;
66 virtual void Redo() override
;
69 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
72 class UndoReplaceObject final
: public SdrUndoReplaceObj
, public UndoRemovePresObjectImpl
75 UndoReplaceObject(SdrObject
& rOldObject
, SdrObject
& rNewObject
);
77 virtual void Undo() override
;
78 virtual void Redo() override
;
81 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
84 class UndoObjectSetText final
: public SdrUndoObjSetText
87 UndoObjectSetText(SdrObject
& rNewObj
, sal_Int32 nText
);
88 virtual ~UndoObjectSetText() override
;
90 virtual void Undo() override
;
91 virtual void Redo() override
;
94 std::unique_ptr
<SfxUndoAction
> mpUndoAnimation
;
95 bool mbNewEmptyPresObj
;
96 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
99 // Undo for SdrObject::SetUserCall()
101 class UndoObjectUserCall final
: public SdrUndoObj
104 UndoObjectUserCall(SdrObject
& rNewObj
);
106 virtual void Undo() override
;
107 virtual void Redo() override
;
110 SdrObjUserCall
* mpOldUserCall
;
111 SdrObjUserCall
* mpNewUserCall
;
112 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
115 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
117 class UndoObjectPresentationKind final
: public SdrUndoObj
120 UndoObjectPresentationKind(SdrObject
& rObject
);
122 virtual void Undo() override
;
123 virtual void Redo() override
;
126 PresObjKind meOldKind
;
127 PresObjKind meNewKind
;
128 ::unotools::WeakReference
<SdPage
> mxPage
;
129 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
132 // Restores correct position and size for presentation shapes with user call
135 class UndoAutoLayoutPosAndSize final
: public SfxUndoAction
138 UndoAutoLayoutPosAndSize(SdPage
& rPage
);
140 virtual void Undo() override
;
141 virtual void Redo() override
;
144 ::unotools::WeakReference
<SdPage
> mxPage
;
147 class UndoGeoObject final
: public SdrUndoGeoObj
150 UndoGeoObject(SdrObject
& rNewObj
);
152 virtual void Undo() override
;
153 virtual void Redo() override
;
156 ::unotools::WeakReference
<SdPage
> mxPage
;
157 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
160 class UndoAttrObject final
: public SdrUndoAttrObj
163 UndoAttrObject(SdrObject
& rObject
, bool bStyleSheet1
, bool bSaveText
);
165 virtual void Undo() override
;
166 virtual void Redo() override
;
169 ::unotools::WeakReference
<SdPage
> mxPage
;
170 ::unotools::WeakReference
<SdrObject
> mxSdrObject
;
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */