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_XAnimatedSprite_idl__
28*cdf0e10cSrcweir#define __com_sun_star_rendering_XAnimatedSprite_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_rendering_ViewState_idl__
40*cdf0e10cSrcweir#include <com/sun/star/rendering/ViewState.idl>
41*cdf0e10cSrcweir#endif
42*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_RenderState_idl__
43*cdf0e10cSrcweir#include <com/sun/star/rendering/RenderState.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XSprite_idl__
46*cdf0e10cSrcweir#include <com/sun/star/rendering/XSprite.idl>
47*cdf0e10cSrcweir#endif
48*cdf0e10cSrcweir
49*cdf0e10cSrcweir
50*cdf0e10cSrcweirmodule com { module sun { module star { module rendering {
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir/** This interface can be used to control an animated sprite object.<p>
53*cdf0e10cSrcweir
54*cdf0e10cSrcweir    This interface can be used to control an animated sprite object on
55*cdf0e10cSrcweir    an XSpriteCanvas. Sprites are moving, animated objects.<p>
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir    @since OOo 2.0
58*cdf0e10cSrcweir */
59*cdf0e10cSrcweirpublished interface XAnimatedSprite : XSprite
60*cdf0e10cSrcweir{
61*cdf0e10cSrcweir    /**	Start animation sequence of this sprite.<p>
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir        The speed of the animation is given in cycles per second
64*cdf0e10cSrcweir        (where a cycle is defined as one full animation run, i.e. the
65*cdf0e10cSrcweir        full [0,1] range of the <member>XAnimation::render</member>'s
66*cdf0e10cSrcweir        t parameter, or a full sequence of sprite bitmaps drawn). Once
67*cdf0e10cSrcweir        an animation is running, the associated
68*cdf0e10cSrcweir        <type>XSpriteCanvas</type> handles screen updates
69*cdf0e10cSrcweir        automatically. That means, changes to position or alpha are
70*cdf0e10cSrcweir        reflected on screen automatically. Please note further that
71*cdf0e10cSrcweir        sprite visibility and animation are unrelated, i.e. a hidden
72*cdf0e10cSrcweir        sprite can have a running animation, which then displays in
73*cdf0e10cSrcweir        the middle of the animation sequence, when a show() is called
74*cdf0e10cSrcweir        later on.<p>
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir        @param nSpeed
77*cdf0e10cSrcweir        The speed of the animation in cycles per second (where a cycle
78*cdf0e10cSrcweir        is defined as one full animation run, i.e. the full [0,1]
79*cdf0e10cSrcweir        range of the <member>XAnimation::render</member>'s t
80*cdf0e10cSrcweir        parameter, or a full sequence of sprite bitmaps drawn).
81*cdf0e10cSrcweir     */
82*cdf0e10cSrcweir    void startAnimation( [in] double nSpeed );
83*cdf0e10cSrcweir
84*cdf0e10cSrcweir    //-------------------------------------------------------------------------
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir    /** Stop the animation sequence.<p>
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir        A subsequent <member>XAnimatedSprite::startAnimation</member>
89*cdf0e10cSrcweir        will commence the sequence at the point where it was stopped
90*cdf0e10cSrcweir        with here. Once an animation is stopped, the associated
91*cdf0e10cSrcweir        <type>XSpriteCanvas</type> does not update changed sprites
92*cdf0e10cSrcweir        anymore.<p>
93*cdf0e10cSrcweir    */
94*cdf0e10cSrcweir    void stopAnimation();
95*cdf0e10cSrcweir
96*cdf0e10cSrcweir    //-------------------------------------------------------------------------
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir    /** Reset the animation sequence to start with the first frame.<p>
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir        If the animation is currently running, the next frame that is
101*cdf0e10cSrcweir        drawn after this method has finished, will be the first
102*cdf0e10cSrcweir        one. Please note that if an animation is not started, the
103*cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
104*cdf0e10cSrcweir        sprites automatically.<p>
105*cdf0e10cSrcweir     */
106*cdf0e10cSrcweir    void resetAnimation();
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir    //-------------------------------------------------------------------------
109*cdf0e10cSrcweir
110*cdf0e10cSrcweir    /** Issue an additional render call to this sprite's
111*cdf0e10cSrcweir        animation.<p>
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir        This method has no effect when called for a bitmap-sequence
114*cdf0e10cSrcweir        sprite. Please note that if an animation is not started, the
115*cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
116*cdf0e10cSrcweir        sprites automatically, but has to be told to do so via
117*cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
118*cdf0e10cSrcweir     */
119*cdf0e10cSrcweir    void updateAnimation();
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir    //-------------------------------------------------------------------------
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir    /** Changes the view state in place for this sprite's
124*cdf0e10cSrcweir        animation.<p>
125*cdf0e10cSrcweir
126*cdf0e10cSrcweir        The state given here is used when calling the
127*cdf0e10cSrcweir        <member>XAnimation::render()</member> method, or when drawing
128*cdf0e10cSrcweir        the sprite's bitmaps, respectively. There's no need to call
129*cdf0e10cSrcweir        <member>XSpriteCanvas::updateAnimation()</member> after this
130*cdf0e10cSrcweir        method, as it automatically rerenders, if necessary. Please
131*cdf0e10cSrcweir        note that if an animation is not started, the associated
132*cdf0e10cSrcweir        <type>XSpriteCanvas</type> does not update changed sprites
133*cdf0e10cSrcweir        automatically, but has to be told to do so via
134*cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
135*cdf0e10cSrcweir
136*cdf0e10cSrcweir        @param aViewState
137*cdf0e10cSrcweir        The state given here is used when calling the
138*cdf0e10cSrcweir        <member>XAnimation::render()</member> method, or when drawing
139*cdf0e10cSrcweir        the sprite's bitmaps, respectively.
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
142*cdf0e10cSrcweir        if the view transformation matrix is singular.
143*cdf0e10cSrcweir    */
144*cdf0e10cSrcweir    void setViewState( [in] ViewState aViewState )
145*cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir    //-------------------------------------------------------------------------
148*cdf0e10cSrcweir
149*cdf0e10cSrcweir    /** Changes all of the sprite's attributes at one atomic
150*cdf0e10cSrcweir        instance.<p>
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir        This is useful at times where one does not want multiple
153*cdf0e10cSrcweir        redraws for every state change.<p>
154*cdf0e10cSrcweir
155*cdf0e10cSrcweir        Please note that if an animation is not started, the
156*cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
157*cdf0e10cSrcweir        sprites automatically, but has to be told to do so via
158*cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
159*cdf0e10cSrcweir
160*cdf0e10cSrcweir        @param aNewPos
161*cdf0e10cSrcweir        New left,top output position of the sprite. This position gets
162*cdf0e10cSrcweir        transformed by the view and render state.
163*cdf0e10cSrcweir
164*cdf0e10cSrcweir        @param aViewState
165*cdf0e10cSrcweir        New view state of the sprite, and part of the transformation
166*cdf0e10cSrcweir        that is applied to aNewPos. The view transformation matrix
167*cdf0e10cSrcweir        must not be singular.
168*cdf0e10cSrcweir
169*cdf0e10cSrcweir        @param aRenderState
170*cdf0e10cSrcweir        New render state of the sprite, and part of the transformation
171*cdf0e10cSrcweir        that is applied to aNewPos. The render transformation matrix
172*cdf0e10cSrcweir        must not be singular.
173*cdf0e10cSrcweir
174*cdf0e10cSrcweir        @param nAlpha
175*cdf0e10cSrcweir        New alpha value of the sprite. This value must be within the
176*cdf0e10cSrcweir        [0,1] range.
177*cdf0e10cSrcweir
178*cdf0e10cSrcweir        @param bUpdateAnimation
179*cdf0e10cSrcweir        Whether this method should implicitely call
180*cdf0e10cSrcweir        <member>XSpriteCanvas::updateAnimation</member> or not.
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
183*cdf0e10cSrcweir        if one of the passed parameters does not lie in the specified,
184*cdf0e10cSrcweir        permissible range.
185*cdf0e10cSrcweir     */
186*cdf0e10cSrcweir    void setAll( [in] ::com::sun::star::geometry::RealPoint2D	aNewPos,
187*cdf0e10cSrcweir                 [in] ViewState                                         aViewState,
188*cdf0e10cSrcweir                 [in] RenderState                                       aRenderState,
189*cdf0e10cSrcweir                 [in] double                                            nAlpha,
190*cdf0e10cSrcweir                 [in] boolean											bUpdateAnimation )
191*cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
192*cdf0e10cSrcweir};
193*cdf0e10cSrcweir
194*cdf0e10cSrcweir}; }; }; };
195*cdf0e10cSrcweir
196*cdf0e10cSrcweir#endif
197