LibreOffice Module sd (master) 1
slideshowviewimpl.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#pragma once
21
24#include <com/sun/star/awt/XWindowListener.hpp>
25#include <com/sun/star/util/XModifyListener.hpp>
26#include <com/sun/star/awt/XPaintListener.hpp>
27#include <com/sun/star/presentation/XSlideShowView.hpp>
30
31#include <slideshow.hxx>
32
33namespace com::sun::star::awt { class XPointer; }
34namespace com::sun::star::awt { class XWindow; }
35namespace com::sun::star::awt { class XWindowPeer; }
36namespace com::sun::star::awt { struct WindowEvent; }
37namespace com::sun::star::rendering { class XSpriteCanvas; }
38class SdDrawDocument;
39
40namespace sd
41{
42
43struct WrappedMouseEvent : public css::lang::EventObject
44{
46 {
50 EXITED
51 };
52
54 css::awt::MouseEvent maEvent;
55};
56
57struct WrappedMouseMotionEvent : public css::lang::EventObject
58{
60 {
62 MOVED
63 };
64
66 css::awt::MouseEvent maEvent;
67};
68
69// SlideShowViewPaintListeners
70typedef ::comphelper::OInterfaceContainerHelper4< css::awt::XPaintListener > SlideShowViewPaintListeners;
71
72
73// SlideShowViewMouseListeners
74typedef ::comphelper::OInterfaceContainerHelper4< css::awt::XMouseListener > SlideShowViewMouseListeners_Base;
75
77{
78public:
79 void notify(std::unique_lock<std::mutex>& rGuard, const WrappedMouseEvent& rEvent);
80};
81
82
83// SlideShowViewMouseMotionListeners
84typedef ::comphelper::OInterfaceContainerHelper4< css::awt::XMouseMotionListener > SlideShowViewMouseMotionListeners_Base;
85
87{
88public:
89 void notify( std::unique_lock<std::mutex>& rGuard, const WrappedMouseMotionEvent& rEvent );
90};
91
92// SlideShowView
93class ShowWindow;
94class SlideshowImpl;
95
96typedef comphelper::WeakComponentImplHelper< css::presentation::XSlideShowView,
97 css::awt::XWindowListener,
98 css::awt::XMouseListener,
99 css::awt::XMouseMotionListener > SlideShowView_Base;
100
102{
103public:
104 SlideShowView( ShowWindow& rOutputWindow,
105 SdDrawDocument* pDoc,
106 AnimationMode eAnimationMode,
107 SlideshowImpl* pSlideShow,
108 bool bFullScreen );
109
111
113 virtual void disposing(std::unique_lock<std::mutex>&) override;
114
116 virtual void SAL_CALL disposing( const css::lang::EventObject& ) override;
117
119 void paint( const css::awt::PaintEvent& e );
120
121 // XSlideShowView methods
122 virtual css::uno::Reference< css::rendering::XSpriteCanvas > SAL_CALL getCanvas( ) override;
123 virtual void SAL_CALL clear( ) override;
124 virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation( ) override;
125 virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset( ) override;
126 virtual void SAL_CALL addTransformationChangedListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) override;
127 virtual void SAL_CALL removeTransformationChangedListener( const css::uno::Reference< css::util::XModifyListener >& xListener ) override;
128 virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
129 virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
130 virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
131 virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
132 virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
133 virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
134 virtual void SAL_CALL setMouseCursor( sal_Int16 nPointerShape ) override;
135 virtual css::awt::Rectangle SAL_CALL getCanvasArea( ) override;
136
137 // XWindowListener methods
138 virtual void SAL_CALL windowResized( const css::awt::WindowEvent& e ) override;
139 virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& e ) override;
140 virtual void SAL_CALL windowShown( const css::lang::EventObject& e ) override;
141 virtual void SAL_CALL windowHidden( const css::lang::EventObject& e ) override;
142
143 // XMouseListener implementation
144 virtual void SAL_CALL mousePressed( const css::awt::MouseEvent& e ) override;
145 virtual void SAL_CALL mouseReleased( const css::awt::MouseEvent& e ) override;
146 virtual void SAL_CALL mouseEntered( const css::awt::MouseEvent& e ) override;
147 virtual void SAL_CALL mouseExited( const css::awt::MouseEvent& e ) override;
148
149 // XMouseMotionListener implementation
150 virtual void SAL_CALL mouseDragged( const css::awt::MouseEvent& e ) override;
151 virtual void SAL_CALL mouseMoved( const css::awt::MouseEvent& e ) override;
152
153protected:
154 virtual ~SlideShowView() override {}
155
156private:
157 void updateimpl( std::unique_lock<std::mutex>& rGuard, SlideshowImpl* pSlideShow );
158
159 void disposingImpl( std::unique_lock<std::mutex>& );
160
162 css::uno::Reference< css::awt::XWindow > mxWindow;
163 css::uno::Reference< css::awt::XWindowPeer > mxWindowPeer;
164 css::uno::Reference< css::awt::XPointer > mxPointer;
167 std::vector< css::uno::WeakReference< css::util::XModifyListener > >
177 css::geometry::IntegerSize2D mTranslationOffset;
178};
179
180} // namespace ::sd
181
182/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void notify(std::unique_lock< std::mutex > &rGuard, const WrappedMouseEvent &rEvent)
void notify(std::unique_lock< std::mutex > &rGuard, const WrappedMouseMotionEvent &rEvent)
void paint(const css::awt::PaintEvent &e)
virtual void SAL_CALL removeTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
virtual css::geometry::IntegerSize2D SAL_CALL getTranslationOffset() override
virtual void SAL_CALL mousePressed(const css::awt::MouseEvent &e) override
css::uno::Reference< css::awt::XWindowPeer > mxWindowPeer
virtual css::awt::Rectangle SAL_CALL getCanvasArea() override
virtual void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual void SAL_CALL mouseExited(const css::awt::MouseEvent &e) override
std::vector< css::uno::WeakReference< css::util::XModifyListener > > maViewListeners
virtual void SAL_CALL mouseMoved(const css::awt::MouseEvent &e) override
SlideShowViewMouseListeners maMouseListeners
SlideShowView(ShowWindow &rOutputWindow, SdDrawDocument *pDoc, AnimationMode eAnimationMode, SlideshowImpl *pSlideShow, bool bFullScreen)
virtual void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
SlideShowViewPaintListeners maPaintListeners
virtual void SAL_CALL mouseReleased(const css::awt::MouseEvent &e) override
css::uno::Reference< css::awt::XPointer > mxPointer
::cppcanvas::SpriteCanvasSharedPtr mpCanvas
virtual void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
virtual css::uno::Reference< css::rendering::XSpriteCanvas > SAL_CALL getCanvas() override
virtual ~SlideShowView() override
virtual void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener > &xListener) override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
virtual void SAL_CALL mouseDragged(const css::awt::MouseEvent &e) override
AnimationMode meAnimationMode
virtual void SAL_CALL mouseEntered(const css::awt::MouseEvent &e) override
css::geometry::IntegerSize2D mTranslationOffset
void updateimpl(std::unique_lock< std::mutex > &rGuard, SlideshowImpl *pSlideShow)
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
virtual void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener > &xListener) override
css::uno::Reference< css::awt::XWindow > mxWindow
virtual void SAL_CALL clear() override
virtual void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener > &xListener) override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
virtual css::geometry::AffineMatrix2D SAL_CALL getTransformation() override
virtual void disposing(std::unique_lock< std::mutex > &) override
Dispose all internal references.
void disposingImpl(std::unique_lock< std::mutex > &)
SlideShowViewMouseMotionListeners maMouseMotionListeners
SdDrawDocument * mpDoc
virtual void SAL_CALL setMouseCursor(sal_Int16 nPointerShape) override
virtual void SAL_CALL addTransformationChangedListener(const css::uno::Reference< css::util::XModifyListener > &xListener) override
SlideshowImpl * mpSlideShow
ShowWindow & mrOutputWindow
virtual void SAL_CALL disposing(const css::lang::EventObject &) override
Disposing our broadcaster.
std::shared_ptr< ::cppcanvas::SpriteCanvas > SpriteCanvasSharedPtr
comphelper::WeakComponentImplHelper< css::presentation::XSlideShowView, css::awt::XWindowListener, css::awt::XMouseListener, css::awt::XMouseMotionListener > SlideShowView_Base
::comphelper::OInterfaceContainerHelper4< css::awt::XPaintListener > SlideShowViewPaintListeners
AnimationMode
Definition: slideshow.hxx:71
::comphelper::OInterfaceContainerHelper4< css::awt::XMouseMotionListener > SlideShowViewMouseMotionListeners_Base
::comphelper::OInterfaceContainerHelper4< css::awt::XMouseListener > SlideShowViewMouseListeners_Base
css::awt::MouseEvent maEvent
css::awt::MouseEvent maEvent