1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_POINTERSYMBOL_HXX
12 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_POINTERSYMBOL_HXX
14 #include <com/sun/star/rendering/XBitmap.hpp>
15 #include <cppcanvas/customsprite.hxx>
17 #include "com/sun/star/uno/Reference.hxx"
19 #include "vieweventhandler.hxx"
20 #include "screenupdater.hxx"
21 #include "eventmultiplexer.hxx"
22 #include "unoview.hxx"
24 #include <boost/shared_ptr.hpp>
25 #include <boost/bind.hpp>
26 #include <boost/utility.hpp>
29 using namespace com::sun::star
;
34 class EventMultiplexer
;
35 typedef boost::shared_ptr
<class PointerSymbol
> PointerSymbolSharedPtr
;
37 /// On-screen 'laser pointer' from the Impress remote control
38 class PointerSymbol
: public ViewEventHandler
,
39 private ::boost::noncopyable
42 static PointerSymbolSharedPtr
create( const ::com::sun::star::uno::Reference
<
43 ::com::sun::star::rendering::XBitmap
>& xBitmap
,
44 ScreenUpdater
& rScreenUpdater
,
45 EventMultiplexer
& rEventMultiplexer
,
46 const UnoViewContainer
& rViewContainer
);
48 /** Shows the pointer symbol.
50 void show() { setVisible(true); }
52 /** Hides the pointer symbol.
54 void hide() { setVisible(false); }
55 /** Use this method to update the pointer's position
57 void setVisible( const bool bVisible
);
58 void viewsChanged(const ::com::sun::star::geometry::RealPoint2D pos
);
61 PointerSymbol( const ::com::sun::star::uno::Reference
<
62 ::com::sun::star::rendering::XBitmap
>& xBitmap
,
63 ScreenUpdater
& rScreenUpdater
,
64 const UnoViewContainer
& rViewContainer
);
67 virtual void viewAdded( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
68 virtual void viewRemoved( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
69 virtual void viewChanged( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
70 virtual void viewsChanged() SAL_OVERRIDE
;
72 ::basegfx::B2DPoint
calcSpritePos( UnoViewSharedPtr
const & rView
) const;
74 template <typename func_type
>
75 void for_each_sprite( func_type
const & func
) const
77 ViewsVecT::const_iterator
iPos( maViews
.begin() );
78 const ViewsVecT::const_iterator
iEnd( maViews
.end() );
79 for ( ; iPos
!= iEnd
; ++iPos
)
84 typedef ::std::vector
<
85 ::std::pair
<UnoViewSharedPtr
,
86 cppcanvas::CustomSpriteSharedPtr
> > ViewsVecT
;
88 ::com::sun::star::uno::Reference
<
89 ::com::sun::star::rendering::XBitmap
> mxBitmap
;
92 ScreenUpdater
& mrScreenUpdater
;
93 ::com::sun::star::geometry::RealPoint2D maPos
;
97 } // namespace internal
98 } // namespace presentation
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */