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/.
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 #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_WAITSYMBOL_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_WAITSYMBOL_HXX
23 #include <com/sun/star/rendering/XBitmap.hpp>
24 #include <cppcanvas/customsprite.hxx>
26 #include "vieweventhandler.hxx"
27 #include "screenupdater.hxx"
28 #include "eventmultiplexer.hxx"
29 #include "unoview.hxx"
31 #include <boost/shared_ptr.hpp>
32 #include <boost/bind.hpp>
33 #include <boost/utility.hpp>
39 class EventMultiplexer
;
40 typedef boost::shared_ptr
<class WaitSymbol
> WaitSymbolSharedPtr
;
42 /// On-screen 'hour glass' for when slideshow is unresponsive
43 class WaitSymbol
: public ViewEventHandler
,
44 private ::boost::noncopyable
47 static WaitSymbolSharedPtr
create( const ::com::sun::star::uno::Reference
<
48 ::com::sun::star::rendering::XBitmap
>& xBitmap
,
49 ScreenUpdater
& rScreenUpdater
,
50 EventMultiplexer
& rEventMultiplexer
,
51 const UnoViewContainer
& rViewContainer
);
53 /** Shows the wait symbol.
55 void show() { setVisible(true); }
57 /** Hides the wait symbol.
59 void hide() { setVisible(false); }
62 WaitSymbol( const ::com::sun::star::uno::Reference
<
63 ::com::sun::star::rendering::XBitmap
>& xBitmap
,
64 ScreenUpdater
& rScreenUpdater
,
65 const UnoViewContainer
& rViewContainer
);
68 virtual void viewAdded( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
69 virtual void viewRemoved( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
70 virtual void viewChanged( const UnoViewSharedPtr
& rView
) SAL_OVERRIDE
;
71 virtual void viewsChanged() SAL_OVERRIDE
;
73 void setVisible( const bool bVisible
);
74 ::basegfx::B2DPoint
calcSpritePos( UnoViewSharedPtr
const & rView
) const;
76 template <typename func_type
>
77 void for_each_sprite( func_type
const & func
) const
79 ViewsVecT::const_iterator
iPos( maViews
.begin() );
80 const ViewsVecT::const_iterator
iEnd( maViews
.end() );
81 for ( ; iPos
!= iEnd
; ++iPos
)
86 typedef ::std::vector
<
87 ::std::pair
<UnoViewSharedPtr
,
88 cppcanvas::CustomSpriteSharedPtr
> > ViewsVecT
;
90 ::com::sun::star::uno::Reference
<
91 ::com::sun::star::rendering::XBitmap
> mxBitmap
;
94 ScreenUpdater
& mrScreenUpdater
;
98 } // namespace internal
99 } // namespace presentation
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */