bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / inc / undo / undoobjects.hxx
blob61edc1bbf4c58b7b7aa0a6b55102db99190d086d
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 <pres.hxx>
26 #include <tools/weakbase.hxx>
28 class SdrObjUserCall;
29 class SdPage;
31 namespace sd
34 class UndoRemovePresObjectImpl
36 protected:
37 UndoRemovePresObjectImpl( SdrObject& rObject );
38 virtual ~UndoRemovePresObjectImpl();
40 virtual void Undo();
41 virtual void Redo();
43 private:
44 std::unique_ptr<SfxUndoAction> mpUndoUsercall;
45 std::unique_ptr<SfxUndoAction> mpUndoAnimation;
46 std::unique_ptr<SfxUndoAction> mpUndoPresObj;
49 class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
51 public:
52 UndoRemoveObject(SdrObject& rObject);
54 virtual void Undo() override;
55 virtual void Redo() override;
57 private:
58 ::tools::WeakReference<SdrObject> mxSdrObject;
61 class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
63 public:
64 UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
66 virtual void Undo() override;
67 virtual void Redo() override;
69 private:
70 ::tools::WeakReference<SdrObject> mxSdrObject;
73 class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
75 public:
76 UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject );
78 virtual void Undo() override;
79 virtual void Redo() override;
81 private:
82 ::tools::WeakReference<SdrObject> mxSdrObject;
85 class UndoObjectSetText : public SdrUndoObjSetText
87 public:
88 UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
89 virtual ~UndoObjectSetText() override;
91 virtual void Undo() override;
92 virtual void Redo() override;
94 private:
95 std::unique_ptr<SfxUndoAction> mpUndoAnimation;
96 bool mbNewEmptyPresObj;
97 ::tools::WeakReference<SdrObject> mxSdrObject;
100 // Undo for SdrObject::SetUserCall()
102 class UndoObjectUserCall final : public SdrUndoObj
104 public:
105 UndoObjectUserCall(SdrObject& rNewObj);
107 virtual void Undo() override;
108 virtual void Redo() override;
110 private:
111 SdrObjUserCall* const mpOldUserCall;
112 SdrObjUserCall* mpNewUserCall;
113 ::tools::WeakReference<SdrObject> mxSdrObject;
116 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
118 class UndoObjectPresentationKind final : public SdrUndoObj
120 public:
121 UndoObjectPresentationKind(SdrObject& rObject);
123 virtual void Undo() override;
124 virtual void Redo() override;
126 private:
127 PresObjKind meOldKind;
128 PresObjKind meNewKind;
129 ::tools::WeakReference<SdPage> mxPage;
130 ::tools::WeakReference<SdrObject> mxSdrObject;
133 // Restores correct position and size for presentation shapes with user call
134 // on undo
136 class UndoAutoLayoutPosAndSize final : public SfxUndoAction
138 public:
139 UndoAutoLayoutPosAndSize( SdPage& rPage );
141 virtual void Undo() override;
142 virtual void Redo() override;
144 private:
145 ::tools::WeakReference<SdPage> mxPage;
148 class UndoGeoObject final : public SdrUndoGeoObj
150 public:
151 UndoGeoObject( SdrObject& rNewObj );
153 virtual void Undo() override;
154 virtual void Redo() override;
156 private:
157 ::tools::WeakReference<SdPage> mxPage;
158 ::tools::WeakReference<SdrObject> mxSdrObject;
161 class UndoAttrObject final : public SdrUndoAttrObj
163 public:
164 UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
166 virtual void Undo() override;
167 virtual void Redo() override;
169 private:
170 ::tools::WeakReference<SdPage> mxPage;
171 ::tools::WeakReference<SdrObject> mxSdrObject;
174 } // namespace sd
176 #endif // INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
178 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */