cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / inc / unoaprms.hxx
blob9ad32766842a62d7e7aee3ff4846c77620438412
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 #pragma once
22 #include <com/sun/star/presentation/AnimationEffect.hpp>
23 #include <com/sun/star/presentation/AnimationSpeed.hpp>
24 #include <com/sun/star/presentation/ClickAction.hpp>
25 #include <sdundo.hxx>
26 #include <tools/color.hxx>
28 class SdDrawDocument;
29 class SdrObject;
31 class SdAnimationPrmsUndoAction final : public SdUndoAction
33 SdrObject* pObject;
34 bool bOldActive;
35 bool bNewActive;
36 bool bOldDimPrevious;
37 bool bNewDimPrevious;
38 bool bOldDimHide;
39 bool bNewDimHide;
40 bool bOldSoundOn;
41 bool bNewSoundOn;
42 bool bOldSecondSoundOn;
43 bool bNewSecondSoundOn;
44 bool bOldPlayFull;
45 bool bNewPlayFull;
46 bool bOldSecondPlayFull;
47 bool bNewSecondPlayFull;
48 css::presentation::AnimationEffect eOldEffect;
49 css::presentation::AnimationEffect eNewEffect;
50 css::presentation::AnimationEffect eOldTextEffect;
51 css::presentation::AnimationEffect eNewTextEffect;
52 css::presentation::AnimationSpeed eOldSpeed;
53 css::presentation::AnimationSpeed eNewSpeed;
54 css::presentation::AnimationEffect eOldSecondEffect;
55 css::presentation::AnimationEffect eNewSecondEffect;
56 css::presentation::AnimationSpeed eOldSecondSpeed;
57 css::presentation::AnimationSpeed eNewSecondSpeed;
58 Color aOldDimColor;
59 Color aNewDimColor;
60 OUString aOldSoundFile;
61 OUString aNewSoundFile;
62 css::presentation::ClickAction eOldClickAction;
63 css::presentation::ClickAction eNewClickAction;
64 OUString aOldBookmark;
65 OUString aNewBookmark;
66 sal_uInt16 nOldVerb;
67 sal_uInt16 nNewVerb;
69 bool bInfoCreated;
71 public:
72 SdAnimationPrmsUndoAction(SdDrawDocument* pTheDoc, SdrObject* pObj,
73 bool bCreated)
74 : SdUndoAction(pTheDoc)
75 , pObject(pObj)
76 , bOldActive(false)
77 , bNewActive(false)
78 , bOldDimPrevious(false)
79 , bNewDimPrevious(false)
80 , bOldDimHide(false)
81 , bNewDimHide(false)
82 , bOldSoundOn(false)
83 , bNewSoundOn(false)
84 , bOldSecondSoundOn(false)
85 , bNewSecondSoundOn(false)
86 , bOldPlayFull(false)
87 , bNewPlayFull(false)
88 , bOldSecondPlayFull(false)
89 , bNewSecondPlayFull(false)
90 , eOldEffect(css::presentation::AnimationEffect_NONE)
91 , eNewEffect(css::presentation::AnimationEffect_NONE)
92 , eOldTextEffect(css::presentation::AnimationEffect_NONE)
93 , eNewTextEffect(css::presentation::AnimationEffect_NONE)
94 , eOldSpeed(css::presentation::AnimationSpeed_SLOW)
95 , eNewSpeed(css::presentation::AnimationSpeed_SLOW)
96 , eOldSecondEffect(css::presentation::AnimationEffect_NONE)
97 , eNewSecondEffect(css::presentation::AnimationEffect_NONE)
98 , eOldSecondSpeed(css::presentation::AnimationSpeed_SLOW)
99 , eNewSecondSpeed(css::presentation::AnimationSpeed_SLOW)
100 , eOldClickAction(css::presentation::ClickAction_NONE)
101 , eNewClickAction(css::presentation::ClickAction_NONE)
102 , nOldVerb(0)
103 , nNewVerb(0)
104 , bInfoCreated(bCreated)
108 void SetActive(bool bTheOldActive, bool bTheNewActive)
109 { bOldActive = bTheOldActive; bNewActive = bTheNewActive; }
110 void SetEffect(css::presentation::AnimationEffect eTheOldEffect, css::presentation::AnimationEffect eTheNewEffect)
111 { eOldEffect = eTheOldEffect; eNewEffect = eTheNewEffect; }
112 void SetTextEffect(css::presentation::AnimationEffect eTheOldEffect, css::presentation::AnimationEffect eTheNewEffect)
113 { eOldTextEffect = eTheOldEffect; eNewTextEffect = eTheNewEffect; }
114 void SetSpeed(css::presentation::AnimationSpeed eTheOldSpeed, css::presentation::AnimationSpeed eTheNewSpeed)
115 { eOldSpeed = eTheOldSpeed; eNewSpeed = eTheNewSpeed; }
116 void SetDim(bool bTheOldDim, bool bTheNewDim)
117 { bOldDimPrevious = bTheOldDim; bNewDimPrevious = bTheNewDim; }
118 void SetDimColor(Color aTheOldDimColor, Color aTheNewDimColor)
119 { aOldDimColor = aTheOldDimColor; aNewDimColor = aTheNewDimColor; }
120 void SetDimHide(bool bTheOldDimHide, bool bTheNewDimHide)
121 { bOldDimHide = bTheOldDimHide; bNewDimHide = bTheNewDimHide; }
122 void SetSoundOn(bool bTheOldSoundOn, bool bTheNewSoundOn)
123 { bOldSoundOn = bTheOldSoundOn; bNewSoundOn = bTheNewSoundOn; }
124 void SetSound(const OUString& aTheOldSound, const OUString& aTheNewSound)
125 { aOldSoundFile = aTheOldSound; aNewSoundFile = aTheNewSound; }
126 void SetPlayFull(bool bTheOldPlayFull, bool bTheNewPlayFull)
127 { bOldPlayFull = bTheOldPlayFull; bNewPlayFull = bTheNewPlayFull; }
128 void SetClickAction(css::presentation::ClickAction eTheOldAction, css::presentation::ClickAction eTheNewAction)
129 { eOldClickAction = eTheOldAction; eNewClickAction = eTheNewAction; }
130 void SetBookmark(const OUString& aTheOldBookmark, const OUString& aTheNewBookmark)
131 { aOldBookmark = aTheOldBookmark; aNewBookmark = aTheNewBookmark; }
132 void SetVerb(sal_uInt16 nTheOldVerb, sal_uInt16 nTheNewVerb)
133 { nOldVerb = nTheOldVerb; nNewVerb = nTheNewVerb; }
134 void SetSecondEffect(css::presentation::AnimationEffect eTheOldEffect, css::presentation::AnimationEffect eTheNewEffect)
135 { eOldSecondEffect = eTheOldEffect; eNewSecondEffect = eTheNewEffect; }
136 void SetSecondSpeed(css::presentation::AnimationSpeed eTheOldSpeed, css::presentation::AnimationSpeed eTheNewSpeed)
137 { eOldSecondSpeed = eTheOldSpeed; eNewSecondSpeed = eTheNewSpeed; }
138 void SetSecondSoundOn(bool bTheOldSoundOn, bool bTheNewSoundOn)
139 { bOldSecondSoundOn = bTheOldSoundOn; bNewSecondSoundOn = bTheNewSoundOn; }
140 void SetSecondPlayFull(bool bTheOldPlayFull, bool bTheNewPlayFull)
141 { bOldSecondPlayFull = bTheOldPlayFull; bNewSecondPlayFull = bTheNewPlayFull; }
143 virtual ~SdAnimationPrmsUndoAction() override;
144 virtual void Undo() override;
145 virtual void Redo() override;
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */