Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _CPPCANVAS_SPRITE_HXX
21 : #define _CPPCANVAS_SPRITE_HXX
22 :
23 : #include <com/sun/star/uno/Reference.hxx>
24 :
25 : #include <boost/shared_ptr.hpp>
26 :
27 : namespace basegfx
28 : {
29 : class B2DHomMatrix;
30 : class B2DPolyPolygon;
31 : class B2DPoint;
32 : }
33 :
34 : namespace com { namespace sun { namespace star { namespace rendering
35 : {
36 : class XSprite;
37 : } } } }
38 :
39 :
40 : /* Definition of Sprite class */
41 :
42 : namespace cppcanvas
43 : {
44 :
45 : class Sprite
46 : {
47 : public:
48 0 : virtual ~Sprite() {}
49 :
50 : virtual void setAlpha( const double& rAlpha ) = 0;
51 :
52 : /** Set the sprite position on screen
53 :
54 : This method differs from the XSprite::move() insofar, as
55 : no viewstate/renderstate transformations are applied to
56 : the specified position. The given position is interpreted
57 : in device coordinates (i.e. screen pixel)
58 : */
59 : virtual void movePixel( const ::basegfx::B2DPoint& rNewPos ) = 0;
60 :
61 : /** Set the sprite position on screen
62 :
63 : This method sets the sprite position in the view
64 : coordinate system of the parent canvas
65 : */
66 : virtual void move( const ::basegfx::B2DPoint& rNewPos ) = 0;
67 :
68 : virtual void transform( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
69 :
70 : /** Set output clipping
71 :
72 : This method differs from the XSprite::clip() insofar, as
73 : no viewstate/renderstate transformations are applied to
74 : the specified clip polygon. The given polygon is
75 : interpreted in device coordinates (i.e. screen pixel)
76 : */
77 : virtual void setClipPixel( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
78 :
79 : /** Set output clipping
80 :
81 : This method applies the clip poly-polygon interpreted in
82 : the view coordinate system of the parent canvas.
83 : */
84 : virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
85 :
86 : virtual void setClip() = 0;
87 :
88 : virtual void show() = 0;
89 : virtual void hide() = 0;
90 :
91 : /** Change the sprite priority
92 :
93 : @param fPriority
94 : New sprite priority. The higher the priority, the further
95 : towards the viewer the sprite appears. That is, sprites
96 : with higher priority appear before ones with lower
97 : priority.
98 : */
99 : virtual void setPriority( double fPriority ) = 0;
100 :
101 : virtual ::com::sun::star::uno::Reference<
102 : ::com::sun::star::rendering::XSprite > getUNOSprite() const = 0;
103 : };
104 :
105 : typedef ::boost::shared_ptr< ::cppcanvas::Sprite > SpriteSharedPtr;
106 : }
107 :
108 : #endif /* _CPPCANVAS_SPRITE_HXX */
109 :
110 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|