xref: /aoo42x/main/svx/inc/svx/e3dundo.hxx (revision 3334a7e6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _E3D_UNDO_HXX
25 #define _E3D_UNDO_HXX
26 
27 #include <svx/svdundo.hxx>
28 class E3DObject;
29 #include <svx/scene3d.hxx>
30 #include "svx/svxdllapi.h"
31 
32 class E3dView;
33 
34 /************************************************************************\
35 |*
36 |* Basisklasse fuer alle 3D-Undo-Aktionen.
37 |*
38 \************************************************************************/
39 class E3dUndoAction : public SdrUndoAction
40 {
41 
42 	protected :
43 		E3dObject *pMy3DObj;
44 
45 	public:
46 		TYPEINFO();
E3dUndoAction(SdrModel * pModel,E3dObject * p3DObj)47 		E3dUndoAction (SdrModel  *pModel,
48 					   E3dObject *p3DObj) :
49 			SdrUndoAction (*pModel),
50 			pMy3DObj (p3DObj)
51 			{
52 			}
53 
54 		virtual ~E3dUndoAction ();
55 
56 		virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
57 };
58 
59 /************************************************************************\
60 |*
61 |* Undo fuer 3D-Rotation ueber die Rotationsmatrizen (ob das wohl klappt ?)
62 |*
63 \************************************************************************/
64 class E3dRotateUndoAction : public E3dUndoAction
65 {
66 		basegfx::B3DHomMatrix aMyOldRotation;
67 		basegfx::B3DHomMatrix aMyNewRotation;
68 
69 	public:
70 		TYPEINFO();
E3dRotateUndoAction(SdrModel * pModel,E3dObject * p3DObj,const basegfx::B3DHomMatrix & aOldRotation,const basegfx::B3DHomMatrix & aNewRotation)71 		E3dRotateUndoAction (SdrModel       *pModel,
72 							 E3dObject      *p3DObj,
73 							 const basegfx::B3DHomMatrix &aOldRotation,
74 							 const basegfx::B3DHomMatrix &aNewRotation) :
75 			E3dUndoAction (pModel, p3DObj),
76 			aMyOldRotation (aOldRotation),
77 			aMyNewRotation (aNewRotation)
78 			{
79 			}
80 
81 		virtual ~E3dRotateUndoAction ();
82 
83 		virtual void Undo();
84 		virtual void Redo();
85 
86 };
87 
88 /************************************************************************\
89 |*
90 |* Undo fuer 3D-Attribute (Implementiert ueber Set3DAttributes())
91 |*
92 \************************************************************************/
93 class SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
94 {
95 	using SdrUndoAction::Repeat;
96 
97 	SdrObject*	pObject;
98 	E3dView*	pView;
99 	sal_Bool		bUseSubObjects;
100 
101 	const SfxItemSet aNewSet;
102 	const SfxItemSet aOldSet;
103 
104  public:
105 		TYPEINFO();
106 		E3dAttributesUndoAction( SdrModel &rModel, E3dView*	pView,
107 			E3dObject* pInObject,
108 			const SfxItemSet& rNewSet,
109 			const SfxItemSet& rOldSet,
110 			sal_Bool bUseSubObj);
111 
112 		virtual ~E3dAttributesUndoAction();
113 
114 		virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const;
115 		virtual void Undo();
116 		virtual void Redo();
117 		virtual void Repeat();
118 };
119 
120 #endif			// _E3D_CUBE3D_HXX
121