1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XSprite_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_rendering_XSprite_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 34*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 35*cdf0e10cSrcweir#endif 36*cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealPoint2D_idl__ 37*cdf0e10cSrcweir#include <com/sun/star/geometry/RealPoint2D.idl> 38*cdf0e10cSrcweir#endif 39*cdf0e10cSrcweir#ifndef __com_sun_star_geometry_AffineMatrix2D_idl__ 40*cdf0e10cSrcweir#include <com/sun/star/geometry/AffineMatrix2D.idl> 41*cdf0e10cSrcweir#endif 42*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_ViewState_idl__ 43*cdf0e10cSrcweir#include <com/sun/star/rendering/ViewState.idl> 44*cdf0e10cSrcweir#endif 45*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_RenderState_idl__ 46*cdf0e10cSrcweir#include <com/sun/star/rendering/RenderState.idl> 47*cdf0e10cSrcweir#endif 48*cdf0e10cSrcweir 49*cdf0e10cSrcweirmodule com { module sun { module star { module rendering { 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir/** Interface to control a sprite object.<p> 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir This is the basic interface to control a sprite object on a 54*cdf0e10cSrcweir <type>XSpriteCanvas</type>. Sprites are moving, back-buffered 55*cdf0e10cSrcweir objects.<p> 56*cdf0e10cSrcweir */ 57*cdf0e10cSrcweirpublished interface XSprite : ::com::sun::star::uno::XInterface 58*cdf0e10cSrcweir{ 59*cdf0e10cSrcweir /** Set overall transparency of the sprite.<p> 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir This method is useful for e.g. fading in/out of animations.<p> 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir Please note that if this sprite is not animated, the 64*cdf0e10cSrcweir associated <type>XSpriteCanvas</type> does not update changed 65*cdf0e10cSrcweir sprites automatically, but has to be told to do so via 66*cdf0e10cSrcweir <member>XSpriteCanvas::updateScreen()</member>.<p> 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir @param nAlpha 69*cdf0e10cSrcweir New global alpha value to composite this sprite with the 70*cdf0e10cSrcweir background. Valid range is [0,1]. 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 73*cdf0e10cSrcweir if nAlpha is not within the permissible range. 74*cdf0e10cSrcweir */ 75*cdf0e10cSrcweir void setAlpha( [in] double nAlpha ) 76*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir //------------------------------------------------------------------------- 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir /** Move sprite to the specified position.<p> 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir The position specified here is first transformed by the 83*cdf0e10cSrcweir combined view and render transformation. The resulting 84*cdf0e10cSrcweir position is then used as the output position (also in device 85*cdf0e10cSrcweir coordinates) of the rendered sprite content.<p> 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir Please note that if this sprite is not animated, the 88*cdf0e10cSrcweir associated <type>XSpriteCanva</type> does not update changed sprites 89*cdf0e10cSrcweir automatically, but has to be told to do so via 90*cdf0e10cSrcweir <member>XSpriteCanvas::updateScreen()</member>.<p> 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir @param aNewPos 93*cdf0e10cSrcweir The new position, in user coordinate space, to move the sprite to. 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir @param aViewState 96*cdf0e10cSrcweir The viewstate to be used when interpreting aNewPos. 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir @param aRenderState 99*cdf0e10cSrcweir The renderstate to be used when interpreting aNewPos. 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 102*cdf0e10cSrcweir if one of the view and renderstate parameters are outside the 103*cdf0e10cSrcweir specified range. 104*cdf0e10cSrcweir */ 105*cdf0e10cSrcweir void move( [in] ::com::sun::star::geometry::RealPoint2D aNewPos, [in] ViewState aViewState, [in] RenderState aRenderState ) 106*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir //------------------------------------------------------------------------- 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir /** Apply a local transformation to the sprite.<p> 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir The given transformation matrix locally transforms the sprite 113*cdf0e10cSrcweir shape. If this transformation contains translational 114*cdf0e10cSrcweir components, be aware that sprite content moved beyond the 115*cdf0e10cSrcweir sprite area (a box from (0,0) to (spriteWidth,spriteHeight)) 116*cdf0e10cSrcweir might (but need not) be clipped. Use 117*cdf0e10cSrcweir <member>XSprite::move</member> to change the sprite location 118*cdf0e10cSrcweir on screen. The canvas implementations are free, if they have a 119*cdf0e10cSrcweir cached representation of the sprite at hand, to transform only 120*cdf0e10cSrcweir this cached representation (e.g. a bitmap), instead of 121*cdf0e10cSrcweir re-rendering the sprite from first principles. This is usually 122*cdf0e10cSrcweir the case for an implementation of a <type>XCustomSprite</type> 123*cdf0e10cSrcweir interface, since it typically has no other cached pictorial 124*cdf0e10cSrcweir information at hand.<p> 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir Please note that if this sprite is not animated, the 127*cdf0e10cSrcweir associated <type>XSpriteCanvas</type> does not update changed 128*cdf0e10cSrcweir sprites automatically, but has to be told to do so via 129*cdf0e10cSrcweir <member>XSpriteCanvas::updateScreen()</member>.<p> 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir @param aTransformation 132*cdf0e10cSrcweir The transformation to apply to the sprite shape. 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir @throws <type>com::sun::star::lang::IllegalArgumentException</type> 135*cdf0e10cSrcweir if the given transformation matrix is singular. 136*cdf0e10cSrcweir */ 137*cdf0e10cSrcweir void transform( [in] com::sun::star::geometry::AffineMatrix2D aTransformation ) 138*cdf0e10cSrcweir raises (com::sun::star::lang::IllegalArgumentException); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir //------------------------------------------------------------------------- 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir /** Apply a clipping to the shape output.<p> 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir The given clip poly-polygon is always interpreted in device 145*cdf0e10cSrcweir coordinate space. As the sprite has its own local coordinate 146*cdf0e10cSrcweir system, with its origin on screen being equal to its current 147*cdf0e10cSrcweir position, the clip poly-polygon's origin will always coincide 148*cdf0e10cSrcweir with the sprite's origin. Furthermore, if any sprite 149*cdf0e10cSrcweir transformation is set via transform(), the clip is subject to 150*cdf0e10cSrcweir this transformation, too. The implementation is free, if it 151*cdf0e10cSrcweir has a cached representation of the sprite at hand, to 152*cdf0e10cSrcweir clip-output only this cached representation (e.g. a bitmap), 153*cdf0e10cSrcweir instead of re-rendering the sprite from first principles. This 154*cdf0e10cSrcweir is usually the case for an implementation of a 155*cdf0e10cSrcweir <type>XCustomSprite</type> interface, since it typically has 156*cdf0e10cSrcweir no other cached pictorial information at hand.<p> 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir Please note that if this sprite is not animated, the 159*cdf0e10cSrcweir associated <type>XSpriteCanvas</type> does not update changed 160*cdf0e10cSrcweir sprites automatically, but has to be told to do so via 161*cdf0e10cSrcweir <member>XSpriteCanvas::updateScreen()</member>.<p> 162*cdf0e10cSrcweir 163*cdf0e10cSrcweir Specifying an empty interface denotes no clipping, 164*cdf0e10cSrcweir i.e. everything contained in the sprite will be visible 165*cdf0e10cSrcweir (subject to device-dependent constraints, of 166*cdf0e10cSrcweir course). Specifying an empty XPolyPolygon2D, i.e. a 167*cdf0e10cSrcweir poly-polygon containing zero polygons, or an XPolyPolygon2D 168*cdf0e10cSrcweir with any number of empty sub-polygons, denotes the NULL 169*cdf0e10cSrcweir clip. That means, nothing from the sprite will be visible.<p> 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir @param aClip 172*cdf0e10cSrcweir The clip poly-polygon to apply. 173*cdf0e10cSrcweir */ 174*cdf0e10cSrcweir void clip( [in] XPolyPolygon2D aClip ); 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir //------------------------------------------------------------------------- 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir /** Set sprite priority.<p> 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir The sprite priority determines the order of rendering relative 181*cdf0e10cSrcweir to all other sprites of the associated canvas. The higher the 182*cdf0e10cSrcweir priority, the later will the sprite be rendered, or, in other 183*cdf0e10cSrcweir words, the closer to the screen surface the sprite is shown.<p> 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir @param nPriority 186*cdf0e10cSrcweir New sprite priority value to serve as the sort key when 187*cdf0e10cSrcweir determining sprite rendering order. Avoid NaNs and other 188*cdf0e10cSrcweir irregular floating point values here, the order position for 189*cdf0e10cSrcweir sprites with such a priority value is undefined. 190*cdf0e10cSrcweir */ 191*cdf0e10cSrcweir void setPriority( [in] double nPriority ); 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir //------------------------------------------------------------------------- 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir /** Make the sprite visible.<p> 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir This method makes the sprite visible on the canvas it was 198*cdf0e10cSrcweir created on.<p> 199*cdf0e10cSrcweir */ 200*cdf0e10cSrcweir void show(); 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir //------------------------------------------------------------------------- 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir /** Make the sprite invisible.<p> 205*cdf0e10cSrcweir 206*cdf0e10cSrcweir This method makes the sprite invisible.<p> 207*cdf0e10cSrcweir */ 208*cdf0e10cSrcweir void hide(); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir}; 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir}; }; }; }; 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir#endif 215