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
23 #include <svx/svdundo.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdobj.hxx>
34 class UndoRemovePresObjectImpl
37 UndoRemovePresObjectImpl( SdrObject
& rObject
);
38 virtual ~UndoRemovePresObjectImpl();
44 SfxUndoAction
* mpUndoUsercall
;
45 SfxUndoAction
* mpUndoAnimation
;
46 SfxUndoAction
* mpUndoPresObj
;
49 class UndoRemoveObject
: public SdrUndoRemoveObj
, public UndoRemovePresObjectImpl
52 UndoRemoveObject( SdrObject
& rObject
, bool bOrdNumDirect
);
54 virtual void Undo() SAL_OVERRIDE
;
55 virtual void Redo() SAL_OVERRIDE
;
58 SdrObjectWeakRef mxSdrObject
;
61 class UndoDeleteObject
: public SdrUndoDelObj
, public UndoRemovePresObjectImpl
64 UndoDeleteObject( SdrObject
& rObject
, bool bOrdNumDirect
);
66 virtual void Undo() SAL_OVERRIDE
;
67 virtual void Redo() SAL_OVERRIDE
;
70 SdrObjectWeakRef mxSdrObject
;
73 class UndoReplaceObject
: public SdrUndoReplaceObj
, public UndoRemovePresObjectImpl
76 UndoReplaceObject( SdrObject
& rOldObject
, SdrObject
& rNewObject
, bool bOrdNumDirect
);
78 virtual void Undo() SAL_OVERRIDE
;
79 virtual void Redo() SAL_OVERRIDE
;
82 SdrObjectWeakRef mxSdrObject
;
85 class UndoObjectSetText
: public SdrUndoObjSetText
88 UndoObjectSetText( SdrObject
& rNewObj
, sal_Int32 nText
);
89 virtual ~UndoObjectSetText();
91 virtual void Undo() SAL_OVERRIDE
;
92 virtual void Redo() SAL_OVERRIDE
;
95 SfxUndoAction
* mpUndoAnimation
;
96 bool mbNewEmptyPresObj
;
97 SdrObjectWeakRef mxSdrObject
;
100 // Undo for SdrObject::SetUserCall()
102 class UndoObjectUserCall
: public SdrUndoObj
105 UndoObjectUserCall(SdrObject
& rNewObj
);
107 virtual void Undo() SAL_OVERRIDE
;
108 virtual void Redo() SAL_OVERRIDE
;
111 SdrObjUserCall
* mpOldUserCall
;
112 SdrObjUserCall
* mpNewUserCall
;
113 SdrObjectWeakRef mxSdrObject
;
116 // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
118 class UndoObjectPresentationKind
: public SdrUndoObj
121 UndoObjectPresentationKind(SdrObject
& rObject
);
123 virtual void Undo() SAL_OVERRIDE
;
124 virtual void Redo() SAL_OVERRIDE
;
127 PresObjKind meOldKind
;
128 PresObjKind meNewKind
;
129 SdrPageWeakRef mxPage
;
130 SdrObjectWeakRef mxSdrObject
;
133 // Restores correct position and size for presentation shapes with user call
136 class UndoAutoLayoutPosAndSize
: public SfxUndoAction
139 UndoAutoLayoutPosAndSize( SdPage
& rPage
);
141 virtual void Undo() SAL_OVERRIDE
;
142 virtual void Redo() SAL_OVERRIDE
;
145 SdrPageWeakRef mxPage
;
148 class UndoGeoObject
: public SdrUndoGeoObj
151 UndoGeoObject( SdrObject
& rNewObj
);
153 virtual void Undo() SAL_OVERRIDE
;
154 virtual void Redo() SAL_OVERRIDE
;
157 SdrPageWeakRef mxPage
;
158 SdrObjectWeakRef mxSdrObject
;
161 class UndoAttrObject
: public SdrUndoAttrObj
164 UndoAttrObject( SdrObject
& rObject
, bool bStyleSheet1
, bool bSaveText
);
166 virtual void Undo() SAL_OVERRIDE
;
167 virtual void Redo() SAL_OVERRIDE
;
170 SdrPageWeakRef mxPage
;
171 SdrObjectWeakRef mxSdrObject
;
176 #endif // INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
178 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */