Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
21 : #define INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
22 :
23 : #include <svx/svdundo.hxx>
24 : #include <svx/svdpage.hxx>
25 : #include <svx/svdobj.hxx>
26 : #include "pres.hxx"
27 :
28 : class SdrObjUserCall;
29 : class SdPage;
30 :
31 : namespace sd
32 : {
33 :
34 : class UndoRemovePresObjectImpl
35 : {
36 : protected:
37 : UndoRemovePresObjectImpl( SdrObject& rObject );
38 : virtual ~UndoRemovePresObjectImpl();
39 :
40 : virtual void Undo();
41 : virtual void Redo();
42 :
43 : private:
44 : SfxUndoAction* mpUndoUsercall;
45 : SfxUndoAction* mpUndoAnimation;
46 : SfxUndoAction* mpUndoPresObj;
47 : };
48 :
49 272 : class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
50 : {
51 : public:
52 : UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
53 :
54 : virtual void Undo() SAL_OVERRIDE;
55 : virtual void Redo() SAL_OVERRIDE;
56 :
57 : private:
58 : SdrObjectWeakRef mxSdrObject;
59 : };
60 :
61 1458 : class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
62 : {
63 : public:
64 : UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
65 :
66 : virtual void Undo() SAL_OVERRIDE;
67 : virtual void Redo() SAL_OVERRIDE;
68 :
69 : private:
70 : SdrObjectWeakRef mxSdrObject;
71 : };
72 :
73 40 : class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
74 : {
75 : public:
76 : UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
77 :
78 : virtual void Undo() SAL_OVERRIDE;
79 : virtual void Redo() SAL_OVERRIDE;
80 :
81 : private:
82 : SdrObjectWeakRef mxSdrObject;
83 : };
84 :
85 : class UndoObjectSetText : public SdrUndoObjSetText
86 : {
87 : public:
88 : UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
89 : virtual ~UndoObjectSetText();
90 :
91 : virtual void Undo() SAL_OVERRIDE;
92 : virtual void Redo() SAL_OVERRIDE;
93 :
94 : private:
95 : SfxUndoAction* mpUndoAnimation;
96 : bool mbNewEmptyPresObj;
97 : SdrObjectWeakRef mxSdrObject;
98 : };
99 :
100 : // Undo for SdrObject::SetUserCall()
101 :
102 1018 : class UndoObjectUserCall : public SdrUndoObj
103 : {
104 : public:
105 : UndoObjectUserCall(SdrObject& rNewObj);
106 :
107 : virtual void Undo() SAL_OVERRIDE;
108 : virtual void Redo() SAL_OVERRIDE;
109 :
110 : protected:
111 : SdrObjUserCall* mpOldUserCall;
112 : SdrObjUserCall* mpNewUserCall;
113 : SdrObjectWeakRef mxSdrObject;
114 : };
115 :
116 : // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
117 :
118 0 : class UndoObjectPresentationKind : public SdrUndoObj
119 : {
120 : public:
121 : UndoObjectPresentationKind(SdrObject& rObject);
122 :
123 : virtual void Undo() SAL_OVERRIDE;
124 : virtual void Redo() SAL_OVERRIDE;
125 :
126 : protected:
127 : PresObjKind meOldKind;
128 : PresObjKind meNewKind;
129 : SdrPageWeakRef mxPage;
130 : SdrObjectWeakRef mxSdrObject;
131 : };
132 :
133 : // Restores correct position and size for presentation shapes with user call
134 : // on undo
135 :
136 0 : class UndoAutoLayoutPosAndSize : public SfxUndoAction
137 : {
138 : public:
139 : UndoAutoLayoutPosAndSize( SdPage& rPage );
140 :
141 : virtual void Undo() SAL_OVERRIDE;
142 : virtual void Redo() SAL_OVERRIDE;
143 :
144 : protected:
145 : SdrPageWeakRef mxPage;
146 : };
147 :
148 42 : class UndoGeoObject : public SdrUndoGeoObj
149 : {
150 : public:
151 : UndoGeoObject( SdrObject& rNewObj );
152 :
153 : virtual void Undo() SAL_OVERRIDE;
154 : virtual void Redo() SAL_OVERRIDE;
155 :
156 : protected:
157 : SdrPageWeakRef mxPage;
158 : SdrObjectWeakRef mxSdrObject;
159 : };
160 :
161 0 : class UndoAttrObject : public SdrUndoAttrObj
162 : {
163 : public:
164 : UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
165 :
166 : virtual void Undo() SAL_OVERRIDE;
167 : virtual void Redo() SAL_OVERRIDE;
168 :
169 : protected:
170 : SdrPageWeakRef mxPage;
171 : SdrObjectWeakRef mxSdrObject;
172 : };
173 :
174 : } // namespace sd
175 :
176 : #endif // INCLUDED_SD_INC_UNDO_UNDOOBJECTS_HXX
177 :
178 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|