Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / cppcanvas / sprite.hxx
blob52b967ee0231c1ef5aeeca3ab3635b247bd87e35
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_CPPCANVAS_SPRITE_HXX
21 #define INCLUDED_CPPCANVAS_SPRITE_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <memory>
26 namespace basegfx
28 class B2DHomMatrix;
29 class B2DPolyPolygon;
30 class B2DPoint;
33 namespace com { namespace sun { namespace star { namespace rendering
35 class XSprite;
36 } } } }
39 /* Definition of Sprite class */
41 namespace cppcanvas
44 class Sprite
46 public:
47 virtual ~Sprite() {}
49 virtual void setAlpha( const double& rAlpha ) = 0;
51 /** Set the sprite position on screen
53 This method differs from the XSprite::move() insofar, as
54 no viewstate/renderstate transformations are applied to
55 the specified position. The given position is interpreted
56 in device coordinates (i.e. screen pixel)
58 virtual void movePixel( const ::basegfx::B2DPoint& rNewPos ) = 0;
60 /** Set the sprite position on screen
62 This method sets the sprite position in the view
63 coordinate system of the parent canvas
65 virtual void move( const ::basegfx::B2DPoint& rNewPos ) = 0;
67 virtual void transform( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
69 /** Set output clipping
71 This method differs from the XSprite::clip() insofar, as
72 no viewstate/renderstate transformations are applied to
73 the specified clip polygon. The given polygon is
74 interpreted in device coordinates (i.e. screen pixel)
76 virtual void setClipPixel( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
78 /** Set output clipping
80 This method applies the clip poly-polygon interpreted in
81 the view coordinate system of the parent canvas.
83 virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
85 virtual void setClip() = 0;
87 virtual void show() = 0;
88 virtual void hide() = 0;
90 /** Change the sprite priority
92 @param fPriority
93 New sprite priority. The higher the priority, the further
94 towards the viewer the sprite appears. That is, sprites
95 with higher priority appear before ones with lower
96 priority.
98 virtual void setPriority( double fPriority ) = 0;
101 typedef std::shared_ptr< ::cppcanvas::Sprite > SpriteSharedPtr;
104 #endif // INCLUDED_CPPCANVAS_SPRITE_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */