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 _SD_UNDOOBJECTS_HXX
21 : #define _SD_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 :
35 : class UndoRemovePresObjectImpl
36 : {
37 : protected:
38 : UndoRemovePresObjectImpl( SdrObject& rObject );
39 : virtual ~UndoRemovePresObjectImpl();
40 :
41 : virtual void Undo();
42 : virtual void Redo();
43 :
44 : private:
45 : SfxUndoAction* mpUndoUsercall;
46 : SfxUndoAction* mpUndoAnimation;
47 : SfxUndoAction* mpUndoPresObj;
48 : };
49 :
50 : ///////////////////////////////////////////////////////////////////////
51 :
52 0 : class UndoRemoveObject : public SdrUndoRemoveObj, public UndoRemovePresObjectImpl
53 : {
54 : public:
55 : UndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect );
56 :
57 : virtual void Undo();
58 : virtual void Redo();
59 :
60 : private:
61 : SdrObjectWeakRef mxSdrObject;
62 : };
63 :
64 : ///////////////////////////////////////////////////////////////////////
65 :
66 0 : class UndoDeleteObject : public SdrUndoDelObj, public UndoRemovePresObjectImpl
67 : {
68 : public:
69 : UndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect );
70 :
71 : virtual void Undo();
72 : virtual void Redo();
73 :
74 : private:
75 : SdrObjectWeakRef mxSdrObject;
76 : };
77 :
78 : ///////////////////////////////////////////////////////////////////////
79 :
80 0 : class UndoReplaceObject : public SdrUndoReplaceObj, public UndoRemovePresObjectImpl
81 : {
82 : public:
83 : UndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect );
84 :
85 : virtual void Undo();
86 : virtual void Redo();
87 :
88 : private:
89 : SdrObjectWeakRef mxSdrObject;
90 : };
91 :
92 : ///////////////////////////////////////////////////////////////////////
93 :
94 : class UndoObjectSetText : public SdrUndoObjSetText
95 : {
96 : public:
97 : UndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText );
98 : virtual ~UndoObjectSetText();
99 :
100 : virtual void Undo();
101 : virtual void Redo();
102 :
103 : private:
104 : SfxUndoAction* mpUndoAnimation;
105 : bool mbNewEmptyPresObj;
106 : SdrObjectWeakRef mxSdrObject;
107 : };
108 :
109 : //////////////////////////////////////////////////////////////////////////////
110 : // Undo for SdrObject::SetUserCall()
111 :
112 0 : class UndoObjectUserCall : public SdrUndoObj
113 : {
114 : public:
115 : UndoObjectUserCall(SdrObject& rNewObj);
116 :
117 : virtual void Undo();
118 : virtual void Redo();
119 :
120 : protected:
121 : SdrObjUserCall* mpOldUserCall;
122 : SdrObjUserCall* mpNewUserCall;
123 : SdrObjectWeakRef mxSdrObject;
124 : };
125 :
126 : //////////////////////////////////////////////////////////////////////////////
127 : // Undo for SdPage::InsertPresObj() and SdPage::RemovePresObj()
128 :
129 0 : class UndoObjectPresentationKind : public SdrUndoObj
130 : {
131 : public:
132 : UndoObjectPresentationKind(SdrObject& rObject);
133 :
134 : virtual void Undo();
135 : virtual void Redo();
136 :
137 : protected:
138 : PresObjKind meOldKind;
139 : PresObjKind meNewKind;
140 : SdrPageWeakRef mxPage;
141 : SdrObjectWeakRef mxSdrObject;
142 : };
143 :
144 : //////////////////////////////////////////////////////////////////////////////
145 : // Restores correct position and size for presentation shapes with user call
146 : // on undo
147 :
148 0 : class UndoAutoLayoutPosAndSize : public SfxUndoAction
149 : {
150 : public:
151 : UndoAutoLayoutPosAndSize( SdPage& rPage );
152 :
153 : virtual void Undo();
154 : virtual void Redo();
155 :
156 : protected:
157 : SdrPageWeakRef mxPage;
158 : };
159 :
160 : //////////////////////////////////////////////////////////////////////////////
161 :
162 0 : class UndoGeoObject : public SdrUndoGeoObj
163 : {
164 : public:
165 : UndoGeoObject( SdrObject& rNewObj );
166 :
167 : virtual void Undo();
168 : virtual void Redo();
169 :
170 : protected:
171 : SdrPageWeakRef mxPage;
172 : SdrObjectWeakRef mxSdrObject;
173 : };
174 :
175 : //////////////////////////////////////////////////////////////////////////////
176 :
177 0 : class UndoAttrObject : public SdrUndoAttrObj
178 : {
179 : public:
180 : UndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText );
181 :
182 : virtual void Undo();
183 : virtual void Redo();
184 :
185 : protected:
186 : SdrPageWeakRef mxPage;
187 : SdrObjectWeakRef mxSdrObject;
188 : };
189 :
190 : } // namespace sd
191 :
192 : #endif // _SD_UNDOOBJECTS_HXX
193 :
194 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|