Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / e3dundo.hxx
blob8be61b7b9e0e0ddf65f2f08b004dbc1a21a87dd0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SVX_E3DUNDO_HXX
21 #define INCLUDED_SVX_E3DUNDO_HXX
23 #include <svx/svdundo.hxx>
24 #include <svx/scene3d.hxx>
25 #include <svx/svxdllapi.h>
27 /************************************************************************\
29 |* Base class for all 3D undo actions.
31 \************************************************************************/
32 class SAL_WARN_UNUSED E3dUndoAction : public SdrUndoAction
35 protected:
36 E3dObject *pMy3DObj;
38 public:
39 E3dUndoAction (SdrModel *pModel,
40 E3dObject *p3DObj) :
41 SdrUndoAction (*pModel),
42 pMy3DObj (p3DObj)
46 virtual ~E3dUndoAction () override;
48 virtual bool CanRepeat(SfxRepeatTarget&) const override;
51 /************************************************************************\
53 |* Undo for 3D rotation through the rotation matrices
55 \************************************************************************/
56 class SAL_WARN_UNUSED E3dRotateUndoAction : public E3dUndoAction
58 basegfx::B3DHomMatrix aMyOldRotation;
59 basegfx::B3DHomMatrix aMyNewRotation;
61 public:
62 E3dRotateUndoAction (SdrModel *pModel,
63 E3dObject *p3DObj,
64 const basegfx::B3DHomMatrix &aOldRotation,
65 const basegfx::B3DHomMatrix &aNewRotation) :
66 E3dUndoAction (pModel, p3DObj),
67 aMyOldRotation (aOldRotation),
68 aMyNewRotation (aNewRotation)
72 virtual ~E3dRotateUndoAction () override;
74 virtual void Undo() override;
75 virtual void Redo() override;
79 /************************************************************************\
81 |* Undo for 3D attributes (implemented using Set3DAttributes())
83 \************************************************************************/
84 class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
86 using SdrUndoAction::Repeat;
88 SdrObject* pObject;
90 const SfxItemSet aNewSet;
91 const SfxItemSet aOldSet;
93 public:
94 E3dAttributesUndoAction( SdrModel &rModel,
95 E3dObject* pInObject,
96 const SfxItemSet& rNewSet,
97 const SfxItemSet& rOldSet);
99 virtual ~E3dAttributesUndoAction() override;
101 virtual bool CanRepeat(SfxRepeatTarget& rView) const override;
102 virtual void Undo() override;
103 virtual void Redo() override;
106 #endif // INCLUDED_SVX_E3DUNDO_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */