LibreOffice Module slideshow (master) 1
usereventqueue.hxx
Go to the documentation of this file.
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_SLIDESHOW_SOURCE_INC_USEREVENTQUEUE_HXX
21#define INCLUDED_SLIDESHOW_SOURCE_INC_USEREVENTQUEUE_HXX
22
23#include <com/sun/star/animations/XAnimationNode.hpp>
24
25#include "eventmultiplexer.hxx"
26#include "eventqueue.hxx"
27#include "shape.hxx"
28
29/* Definition of UserEventQueue class */
30
31namespace slideshow::internal {
32
33class AllAnimationEventHandler;
34class ShapeClickEventHandler;
35class ClickEventHandler;
36class CursorManager;
37class SkipEffectEventHandler;
38class RewindEffectEventHandler;
39class MouseEnterHandler;
40class MouseLeaveHandler;
41
58{
59public:
78 UserEventQueue( EventMultiplexer& rMultiplexer,
79 EventQueue& rEventQueue,
80 CursorManager& rCursorManager );
84
92 void clear();
93
102 void setAdvanceOnClick( bool bAdvanceOnClick );
103
112 const EventSharedPtr& rEvent,
113 const css::uno::Reference<css::animations::XAnimationNode>& xNode );
114
123 const EventSharedPtr& rEvent,
124 const css::uno::Reference<css::animations::XAnimationNode>& xNode );
125
134 const EventSharedPtr& rEvent,
135 const css::uno::Reference<css::animations::XAnimationNode>& xNode );
136
145 void registerShapeClickEvent( const EventSharedPtr& rEvent,
146 const ShapeSharedPtr& rShape );
147
161 EventSharedPtr const& pEvent,
162 const bool bSkipTriggersNextEffect);
163
177 void registerNextEffectEvent( const EventSharedPtr& rEvent );
178
191 const ShapeSharedPtr& rShape );
192
202 void registerMouseEnterEvent( const EventSharedPtr& rEvent,
203 const ShapeSharedPtr& rShape );
204
214 void registerMouseLeaveEvent( const EventSharedPtr& rEvent,
215 const ShapeSharedPtr& rShape );
216
222
223private:
229 template< typename Handler, typename Functor >
230 void registerEvent( ::std::shared_ptr< Handler >& rHandler,
231 const EventSharedPtr& rEvent,
232 const Functor& rRegistrationFunctor );
233
242 template< typename Handler, typename Arg, typename Functor >
243 void registerEvent( ::std::shared_ptr< Handler >& rHandler,
244 const EventSharedPtr& rEvent,
245 const Arg& rArg,
246 const Functor& rRegistrationFunctor );
247
250 CursorManager& mrCursorManager;
251
252 ::std::shared_ptr<AllAnimationEventHandler> mpAnimationStartEventHandler;
253 ::std::shared_ptr<AllAnimationEventHandler> mpAnimationEndEventHandler;
254 ::std::shared_ptr<AllAnimationEventHandler> mpAudioStoppedEventHandler;
255 ::std::shared_ptr<ShapeClickEventHandler> mpShapeClickEventHandler;
256 ::std::shared_ptr<ClickEventHandler> mpClickEventHandler;
257 ::std::shared_ptr<SkipEffectEventHandler> mpSkipEffectEventHandler;
258 ::std::shared_ptr<ShapeClickEventHandler> mpShapeDoubleClickEventHandler;
259 ::std::shared_ptr<MouseEnterHandler> mpMouseEnterHandler;
260 ::std::shared_ptr<MouseLeaveHandler> mpMouseLeaveHandler;
261
263};
264
265} // namespace presentation::internal
266
267#endif // INCLUDED_SLIDESHOW_SOURCE_INC_USEREVENTQUEUE_HXX
268
269/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class multiplexes user-activated and slide-show global events.
This class handles events in a presentation.
Definition: eventqueue.hxx:41
This class schedules user-activated events.
void clear()
Clear all registered events.
UserEventQueue(EventMultiplexer &rMultiplexer, EventQueue &rEventQueue, CursorManager &rCursorManager)
Create a user event queue.
void registerEvent(::std::shared_ptr< Handler > &rHandler, const EventSharedPtr &rEvent, const Arg &rArg, const Functor &rRegistrationFunctor)
Generically register an event on one of the handlers.
::std::shared_ptr< ShapeClickEventHandler > mpShapeClickEventHandler
void registerSkipEffectEvent(EventSharedPtr const &pEvent, const bool bSkipTriggersNextEffect)
Registers an event that is fired when the current effects(s) are skipped, .e.g.
::std::shared_ptr< AllAnimationEventHandler > mpAnimationEndEventHandler
UserEventQueue(const UserEventQueue &)=delete
UserEventQueue & operator=(const UserEventQueue &)=delete
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.
::std::shared_ptr< AllAnimationEventHandler > mpAnimationStartEventHandler
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.
::std::shared_ptr< SkipEffectEventHandler > mpSkipEffectEventHandler
void callSkipEffectEventHandler()
Typically skipping the current effect is triggered by mouse clicks or key presses that trigger the ne...
::std::shared_ptr< AllAnimationEventHandler > mpAudioStoppedEventHandler
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.
::std::shared_ptr< ClickEventHandler > mpClickEventHandler
void registerMouseEnterEvent(const EventSharedPtr &rEvent, const ShapeSharedPtr &rShape)
Register an event that is fired when the mouse enters the area of the given shape.
::std::shared_ptr< MouseEnterHandler > mpMouseEnterHandler
::std::shared_ptr< ShapeClickEventHandler > mpShapeDoubleClickEventHandler
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.
::std::shared_ptr< MouseLeaveHandler > mpMouseLeaveHandler
void setAdvanceOnClick(bool bAdvanceOnClick)
Set advance on click behaviour.
void registerEvent(::std::shared_ptr< Handler > &rHandler, const EventSharedPtr &rEvent, const Functor &rRegistrationFunctor)
Generically register an event on one of the handlers.
::std::shared_ptr< Event > EventSharedPtr
Definition: event.hxx:76
::std::shared_ptr< Shape > ShapeSharedPtr