/src/libreoffice/include/svx/e3dundo.hxx
Line | Count | Source |
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_SVX_E3DUNDO_HXX |
21 | | #define INCLUDED_SVX_E3DUNDO_HXX |
22 | | |
23 | | #include <svl/itemset.hxx> |
24 | | #include <svx/svdundo.hxx> |
25 | | #include <svx/obj3d.hxx> |
26 | | #include <utility> |
27 | | #include <svx/svxdllapi.h> |
28 | | |
29 | | /************************************************************************\ |
30 | | |* |
31 | | |* Base class for all 3D undo actions. |
32 | | |* |
33 | | \************************************************************************/ |
34 | | class SAL_WARN_UNUSED E3dUndoAction : public SdrUndoAction |
35 | | { |
36 | | protected: |
37 | | E3dObject& mrMy3DObj; |
38 | | |
39 | | public: |
40 | | E3dUndoAction(E3dObject &r3DObj) |
41 | 0 | : SdrUndoAction(r3DObj.getSdrModelFromSdrObject()), |
42 | 0 | mrMy3DObj(r3DObj) |
43 | 0 | { |
44 | 0 | } |
45 | | |
46 | | virtual ~E3dUndoAction () override; |
47 | | |
48 | | virtual bool CanRepeat(SfxRepeatTarget&) const override; |
49 | | }; |
50 | | |
51 | | /************************************************************************\ |
52 | | |* |
53 | | |* Undo for 3D rotation through the rotation matrices |
54 | | |* |
55 | | \************************************************************************/ |
56 | | class SAL_WARN_UNUSED E3dRotateUndoAction final : public E3dUndoAction |
57 | | { |
58 | | private: |
59 | | basegfx::B3DHomMatrix maMyOldRotation; |
60 | | basegfx::B3DHomMatrix maMyNewRotation; |
61 | | |
62 | | public: |
63 | | E3dRotateUndoAction( |
64 | | E3dObject& r3DObj, |
65 | | basegfx::B3DHomMatrix aOldRotation, |
66 | | basegfx::B3DHomMatrix aNewRotation) |
67 | 0 | : E3dUndoAction(r3DObj), |
68 | 0 | maMyOldRotation(std::move(aOldRotation)), |
69 | 0 | maMyNewRotation(std::move(aNewRotation)) |
70 | 0 | { |
71 | 0 | } |
72 | | |
73 | | virtual ~E3dRotateUndoAction () override; |
74 | | |
75 | | virtual void Undo() override; |
76 | | virtual void Redo() override; |
77 | | }; |
78 | | |
79 | | /************************************************************************\ |
80 | | |* |
81 | | |* Undo for 3D attributes (implemented using Set3DAttributes()) |
82 | | |* |
83 | | \************************************************************************/ |
84 | | class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC E3dAttributesUndoAction final : public SdrUndoAction |
85 | | { |
86 | | private: |
87 | | using SdrUndoAction::Repeat; |
88 | | |
89 | | SdrObject& mrObject; |
90 | | const SfxItemSet maNewSet; |
91 | | const SfxItemSet maOldSet; |
92 | | |
93 | | public: |
94 | | E3dAttributesUndoAction( |
95 | | E3dObject& rInObject, |
96 | | SfxItemSet aNewSet, |
97 | | SfxItemSet aOldSet); |
98 | | |
99 | | virtual ~E3dAttributesUndoAction() override; |
100 | | |
101 | | virtual bool CanRepeat(SfxRepeatTarget& rView) const override; |
102 | | virtual void Undo() override; |
103 | | virtual void Redo() override; |
104 | | }; |
105 | | |
106 | | #endif // INCLUDED_SVX_E3DUNDO_HXX |
107 | | |
108 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |