Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / waitsymbol.hxx
blob438437fc93300e7f3ea3c63124cf134da5b9d17f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <memory>
32 #include <vector>
34 namespace slideshow {
35 namespace internal {
37 class EventMultiplexer;
38 typedef std::shared_ptr<class WaitSymbol> WaitSymbolSharedPtr;
40 /// On-screen 'hour glass' for when slideshow is unresponsive
41 class WaitSymbol : public ViewEventHandler
43 public:
44 WaitSymbol(const WaitSymbol&) = delete;
45 WaitSymbol& operator=(const WaitSymbol&) = delete;
47 static WaitSymbolSharedPtr create( const css::uno::Reference<css::rendering::XBitmap>& xBitmap,
48 ScreenUpdater& rScreenUpdater,
49 EventMultiplexer& rEventMultiplexer,
50 const UnoViewContainer& rViewContainer );
52 /** Shows the wait symbol.
54 void show() { setVisible(true); }
56 /** Hides the wait symbol.
58 void hide() { setVisible(false); }
60 private:
61 WaitSymbol( const css::uno::Reference<css::rendering::XBitmap>& xBitmap,
62 ScreenUpdater& rScreenUpdater,
63 const UnoViewContainer& rViewContainer );
65 // ViewEventHandler
66 virtual void viewAdded( const UnoViewSharedPtr& rView ) override;
67 virtual void viewRemoved( const UnoViewSharedPtr& rView ) override;
68 virtual void viewChanged( const UnoViewSharedPtr& rView ) override;
69 virtual void viewsChanged() override;
71 void setVisible( const bool bVisible );
72 ::basegfx::B2DPoint calcSpritePos( UnoViewSharedPtr const & rView ) const;
74 typedef ::std::vector<
75 ::std::pair<UnoViewSharedPtr,
76 cppcanvas::CustomSpriteSharedPtr> > ViewsVecT;
78 css::uno::Reference<css::rendering::XBitmap> mxBitmap;
80 ViewsVecT maViews;
81 ScreenUpdater& mrScreenUpdater;
82 bool mbVisible;
85 } // namespace internal
86 } // namespace presentation
88 #endif
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */