bump product version to 5.0.4.1
[LibreOffice.git] / sdext / source / presenter / PresenterSprite.hxx
blob594caa6e775797ab2b7dccebf29789f649c8ecbb
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_SDEXT_SOURCE_PRESENTER_PRESENTERSPRITE_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSPRITE_HXX
23 #include <com/sun/star/rendering/XCustomSprite.hpp>
24 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
25 #include <boost/noncopyable.hpp>
27 namespace sdext { namespace presenter {
29 /** A wrapper around a css::rendering::XCustomSprite that allows
30 not only setting values like size, location, and transformation but also
31 provides read access to them.
32 It also handles the showing and hiding of a sprite. This includes not
33 to show the sprite when its size is not yet defined (results in a crash)
34 and hiding a sprite before disposing it (results in zombie sprites.)
36 class PresenterSprite
37 : private ::boost::noncopyable
39 public:
40 PresenterSprite();
41 virtual ~PresenterSprite();
43 /** The given sprite canvas is used as factory to create the sprite that
44 is wrapped by objects of this class.
45 It is also used to call updateScreen() at (wrapped by the Update() method).
47 void SetFactory (
48 const css::uno::Reference<css::rendering::XSpriteCanvas>& rxSpriteFactory);
50 css::uno::Reference<css::rendering::XCanvas> GetCanvas();
52 void Show();
53 void Hide();
55 void Resize (const css::geometry::RealSize2D& rSize);
56 void MoveTo (const css::geometry::RealPoint2D& rLocation);
58 void Update();
60 private:
61 css::uno::Reference<css::rendering::XSpriteCanvas> mxSpriteFactory;
62 css::uno::Reference<css::rendering::XCustomSprite> mxSprite;
63 css::geometry::RealSize2D maSize;
64 css::geometry::RealPoint2D maLocation;
65 bool mbIsVisible;
66 double mnPriority;
67 double mnAlpha;
69 void ProvideSprite();
70 void DisposeSprite();
73 } }
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */