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/sprite.hxx>
26 #include <vieweventhandler.hxx>
27 #include <screenupdater.hxx>
28 #include <eventmultiplexer.hxx>
29 #include <unoview.hxx>
34 namespace slideshow::internal
{
36 class EventMultiplexer
;
37 typedef std::shared_ptr
<class WaitSymbol
> WaitSymbolSharedPtr
;
39 /// On-screen 'hour glass' for when slideshow is unresponsive
40 class WaitSymbol
: public ViewEventHandler
43 WaitSymbol(const WaitSymbol
&) = delete;
44 WaitSymbol
& operator=(const WaitSymbol
&) = delete;
46 static WaitSymbolSharedPtr
create( const css::uno::Reference
<css::rendering::XBitmap
>& xBitmap
,
47 ScreenUpdater
& rScreenUpdater
,
48 EventMultiplexer
& rEventMultiplexer
,
49 const UnoViewContainer
& rViewContainer
);
51 /** Shows the wait symbol.
53 void show() { setVisible(true); }
55 /** Hides the wait symbol.
57 void hide() { setVisible(false); }
60 WaitSymbol( css::uno::Reference
<css::rendering::XBitmap
> xBitmap
,
61 ScreenUpdater
& rScreenUpdater
,
62 const UnoViewContainer
& rViewContainer
);
65 virtual void viewAdded( const UnoViewSharedPtr
& rView
) override
;
66 virtual void viewRemoved( const UnoViewSharedPtr
& rView
) override
;
67 virtual void viewChanged( const UnoViewSharedPtr
& rView
) override
;
68 virtual void viewsChanged() override
;
70 void setVisible( const bool bVisible
);
71 ::basegfx::B2DPoint
calcSpritePos( UnoViewSharedPtr
const & rView
) const;
73 typedef ::std::vector
<
74 ::std::pair
<UnoViewSharedPtr
,
75 cppcanvas::CustomSpriteSharedPtr
> > ViewsVecT
;
77 css::uno::Reference
<css::rendering::XBitmap
> mxBitmap
;
80 ScreenUpdater
& mrScreenUpdater
;
84 } // namespace presentation::internal
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */