Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _E3D_UNDO_HXX
30 : : #define _E3D_UNDO_HXX
31 : :
32 : : #include <svx/svdundo.hxx>
33 : : #include <svx/scene3d.hxx>
34 : : #include "svx/svxdllapi.h"
35 : :
36 : : /************************************************************************\
37 : : |*
38 : : |* Base class for all 3D undo actions.
39 : : |*
40 : : \************************************************************************/
41 : : class E3dUndoAction : public SdrUndoAction
42 : : {
43 : :
44 : : protected :
45 : : E3dObject *pMy3DObj;
46 : :
47 : : public:
48 : : TYPEINFO();
49 : 0 : E3dUndoAction (SdrModel *pModel,
50 : : E3dObject *p3DObj) :
51 : : SdrUndoAction (*pModel),
52 : 0 : pMy3DObj (p3DObj)
53 : : {
54 : 0 : }
55 : :
56 : : virtual ~E3dUndoAction ();
57 : :
58 : : virtual sal_Bool CanRepeat(SfxRepeatTarget&) const;
59 : : };
60 : :
61 : : /************************************************************************\
62 : : |*
63 : : |* Undo for 3D rotation through the rotation matrices
64 : : |*
65 : : \************************************************************************/
66 : : class E3dRotateUndoAction : public E3dUndoAction
67 : : {
68 : : basegfx::B3DHomMatrix aMyOldRotation;
69 : : basegfx::B3DHomMatrix aMyNewRotation;
70 : :
71 : : public:
72 : : TYPEINFO();
73 : 0 : E3dRotateUndoAction (SdrModel *pModel,
74 : : E3dObject *p3DObj,
75 : : const basegfx::B3DHomMatrix &aOldRotation,
76 : : const basegfx::B3DHomMatrix &aNewRotation) :
77 : : E3dUndoAction (pModel, p3DObj),
78 : : aMyOldRotation (aOldRotation),
79 [ # # ][ # # ]: 0 : aMyNewRotation (aNewRotation)
80 : : {
81 : 0 : }
82 : :
83 : : virtual ~E3dRotateUndoAction ();
84 : :
85 : : virtual void Undo();
86 : : virtual void Redo();
87 : :
88 : : };
89 : :
90 : : /************************************************************************\
91 : : |*
92 : : |* Undo for 3D attributes (implemented using Set3DAttributes())
93 : : |*
94 : : \************************************************************************/
95 : : class SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
96 : : {
97 : : using SdrUndoAction::Repeat;
98 : :
99 : : SdrObject* pObject;
100 : :
101 : : const SfxItemSet aNewSet;
102 : : const SfxItemSet aOldSet;
103 : :
104 : : public:
105 : : TYPEINFO();
106 : : E3dAttributesUndoAction( SdrModel &rModel,
107 : : E3dObject* pInObject,
108 : : const SfxItemSet& rNewSet,
109 : : const SfxItemSet& rOldSet);
110 : :
111 : : virtual ~E3dAttributesUndoAction();
112 : :
113 : : virtual sal_Bool CanRepeat(SfxRepeatTarget& rView) const;
114 : : virtual void Undo();
115 : : virtual void Redo();
116 : : virtual void Repeat();
117 : : };
118 : :
119 : : #endif // _E3D_CUBE3D_HXX
120 : :
121 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|