23#include <com/sun/star/drawing/XShape.hpp>
24#include <com/sun/star/animations/XAnimationNode.hpp>
25#include <com/sun/star/animations/Timing.hpp>
26#include <com/sun/star/animations/EventTrigger.hpp>
27#include <com/sun/star/animations/Event.hpp>
43 double nAdditionalDelay )
50 animations::Timing eTiming;
55 if (rEventDescription >>= eTiming) {
57 case animations::Timing_INDEFINITE:
59 case animations::Timing_MEDIA:
60 OSL_FAIL(
"MEDIA timing not yet implemented!" );
66 else if (rEventDescription >>=
aEvent) {
70 if (
aEvent.Offset.hasValue() && !(
aEvent.Offset >>= nDelay2)) {
71 OSL_FAIL(
"offset values apart from DOUBLE not "
72 "recognized in animations::Event!" );
82 auto event2shape = [&] () {
83 if (
aEvent.Source >>= xShape)
90 case animations::EventTrigger::NONE:
93 case animations::EventTrigger::ON_BEGIN:
94 OSL_FAIL(
"event trigger ON_BEGIN not yet implemented!" );
96 case animations::EventTrigger::ON_END:
97 OSL_FAIL(
"event trigger ON_END not yet implemented!" );
99 case animations::EventTrigger::BEGIN_EVENT:
101 if (
aEvent.Source >>= xNode) {
103 nDelay2 + nAdditionalDelay,
104 "generateEvent, BEGIN_EVENT");
109 OSL_FAIL(
"could not extract source XAnimationNode "
110 "for BEGIN_EVENT!" );
113 case animations::EventTrigger::END_EVENT:
115 if (
aEvent.Source >>= xNode) {
117 nDelay2 + nAdditionalDelay,
118 "generateEvent, END_EVENT");
123 OSL_FAIL(
"could not extract source XAnimationNode "
127 case animations::EventTrigger::ON_CLICK:
133 nDelay2 + nAdditionalDelay,
134 "generateEvent, ON_CLICK");
139 OSL_FAIL(
"could not extract source XAnimationNode "
143 case animations::EventTrigger::ON_DBL_CLICK:
149 nDelay2 + nAdditionalDelay,
150 "generateEvent, ON_DBL_CLICK");
155 OSL_FAIL(
"could not extract source XAnimationNode "
156 "for ON_DBL_CLICK!" );
159 case animations::EventTrigger::ON_MOUSE_ENTER:
165 nDelay2 + nAdditionalDelay,
166 "generateEvent, ON_MOUSE_ENTER");
171 OSL_FAIL(
"could not extract source XAnimationNode "
172 "for ON_MOUSE_ENTER!" );
175 case animations::EventTrigger::ON_MOUSE_LEAVE:
181 nDelay2 + nAdditionalDelay,
182 "generateEvent, ON_MOUSE_LEAVE");
187 OSL_FAIL(
"could not extract source XAnimationNode "
188 "for ON_MOUSE_LEAVE!" );
191 case animations::EventTrigger::ON_PREV:
192 OSL_FAIL(
"event trigger ON_PREV not yet implemented, "
193 "mapped to ON_NEXT!" );
195 case animations::EventTrigger::ON_NEXT:
197 nDelay2 + nAdditionalDelay,
198 "generateEvent, ON_NEXT");
201 case animations::EventTrigger::ON_STOP_AUDIO:
203 if (
aEvent.Source >>= xNode) {
205 nDelay2 + nAdditionalDelay,
206 "generateEvent, ON_STOP_AUDIO");
211 OSL_FAIL(
"could not extract source XAnimationNode "
212 "for ON_STOP_AUDIO!" );
215 case animations::EventTrigger::REPEAT:
216 OSL_FAIL(
"event trigger REPEAT not yet implemented!" );
220 else if (rEventDescription >>= aSequence) {
221 OSL_FAIL(
"sequence of timing primitives "
222 "not yet implemented!" );
224 else if (rEventDescription >>= nDelay1) {
226 nDelay1 + nAdditionalDelay,
227 "generateEvent with delay");
::std::function< void()> FunctorT
bool addEvent(const EventSharedPtr &event)
Add the given event to the queue.
void registerNextEffectEvent(const EventSharedPtr &rEvent)
Register an event that is fired to show the next event.
void registerShapeClickEvent(const EventSharedPtr &rEvent, const ShapeSharedPtr &rShape)
Register an event that is fired when a shape is clicked.
void registerAnimationStartEvent(const EventSharedPtr &rEvent, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
Register an event that will be fired when the given animation node starts.
void registerMouseLeaveEvent(const EventSharedPtr &rEvent, const ShapeSharedPtr &rShape)
Register an event that is fired when the mouse leaves the area of the given shape.
void registerShapeDoubleClickEvent(const EventSharedPtr &rEvent, const ShapeSharedPtr &rShape)
Register an event that is fired on a double mouse click on a shape.
void registerAudioStoppedEvent(const EventSharedPtr &rEvent, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
Register an event that will be fired when audio output stopped for the given animation node.
void registerMouseEnterEvent(const EventSharedPtr &rEvent, const ShapeSharedPtr &rShape)
Register an event that is fired when the mouse enters the area of the given shape.
void registerAnimationEndEvent(const EventSharedPtr &rEvent, const css::uno::Reference< css::animations::XAnimationNode > &xNode)
Register an event that will be fired when the given animation node ends its active duration.
#define makeDelay(f, t, d)
#define ENSURE_OR_THROW(c, m)
::std::shared_ptr< Event > EventSharedPtr
::std::shared_ptr< Shape > ShapeSharedPtr
EventSharedPtr generateEvent(uno::Any const &rEventDescription, Delay::FunctorT const &rFunctor, SlideShowContext const &rContext, double nAdditionalDelay)
Common arguments for slideshow objects.
EventQueue & mrEventQueue
std::shared_ptr< SubsettableShapeManager > & mpSubsettableShapeManager
UserEventQueue & mrUserEventQueue