1*d1766043SAndrew Rist/**************************************************************
2*d1766043SAndrew Rist *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XAnimatedSprite_idl__
24cdf0e10cSrcweir#define __com_sun_star_rendering_XAnimatedSprite_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
30cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
31cdf0e10cSrcweir#endif
32cdf0e10cSrcweir#ifndef __com_sun_star_geometry_RealPoint2D_idl__
33cdf0e10cSrcweir#include <com/sun/star/geometry/RealPoint2D.idl>
34cdf0e10cSrcweir#endif
35cdf0e10cSrcweir#ifndef __com_sun_star_rendering_ViewState_idl__
36cdf0e10cSrcweir#include <com/sun/star/rendering/ViewState.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir#ifndef __com_sun_star_rendering_RenderState_idl__
39cdf0e10cSrcweir#include <com/sun/star/rendering/RenderState.idl>
40cdf0e10cSrcweir#endif
41cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XSprite_idl__
42cdf0e10cSrcweir#include <com/sun/star/rendering/XSprite.idl>
43cdf0e10cSrcweir#endif
44cdf0e10cSrcweir
45cdf0e10cSrcweir
46cdf0e10cSrcweirmodule com { module sun { module star { module rendering {
47cdf0e10cSrcweir
48cdf0e10cSrcweir/** This interface can be used to control an animated sprite object.<p>
49cdf0e10cSrcweir
50cdf0e10cSrcweir    This interface can be used to control an animated sprite object on
51cdf0e10cSrcweir    an XSpriteCanvas. Sprites are moving, animated objects.<p>
52cdf0e10cSrcweir
53cdf0e10cSrcweir    @since OOo 2.0
54cdf0e10cSrcweir */
55cdf0e10cSrcweirpublished interface XAnimatedSprite : XSprite
56cdf0e10cSrcweir{
57cdf0e10cSrcweir    /**	Start animation sequence of this sprite.<p>
58cdf0e10cSrcweir
59cdf0e10cSrcweir        The speed of the animation is given in cycles per second
60cdf0e10cSrcweir        (where a cycle is defined as one full animation run, i.e. the
61cdf0e10cSrcweir        full [0,1] range of the <member>XAnimation::render</member>'s
62cdf0e10cSrcweir        t parameter, or a full sequence of sprite bitmaps drawn). Once
63cdf0e10cSrcweir        an animation is running, the associated
64cdf0e10cSrcweir        <type>XSpriteCanvas</type> handles screen updates
65cdf0e10cSrcweir        automatically. That means, changes to position or alpha are
66cdf0e10cSrcweir        reflected on screen automatically. Please note further that
67cdf0e10cSrcweir        sprite visibility and animation are unrelated, i.e. a hidden
68cdf0e10cSrcweir        sprite can have a running animation, which then displays in
69cdf0e10cSrcweir        the middle of the animation sequence, when a show() is called
70cdf0e10cSrcweir        later on.<p>
71cdf0e10cSrcweir
72cdf0e10cSrcweir        @param nSpeed
73cdf0e10cSrcweir        The speed of the animation in cycles per second (where a cycle
74cdf0e10cSrcweir        is defined as one full animation run, i.e. the full [0,1]
75cdf0e10cSrcweir        range of the <member>XAnimation::render</member>'s t
76cdf0e10cSrcweir        parameter, or a full sequence of sprite bitmaps drawn).
77cdf0e10cSrcweir     */
78cdf0e10cSrcweir    void startAnimation( [in] double nSpeed );
79cdf0e10cSrcweir
80cdf0e10cSrcweir    //-------------------------------------------------------------------------
81cdf0e10cSrcweir
82cdf0e10cSrcweir    /** Stop the animation sequence.<p>
83cdf0e10cSrcweir
84cdf0e10cSrcweir        A subsequent <member>XAnimatedSprite::startAnimation</member>
85cdf0e10cSrcweir        will commence the sequence at the point where it was stopped
86cdf0e10cSrcweir        with here. Once an animation is stopped, the associated
87cdf0e10cSrcweir        <type>XSpriteCanvas</type> does not update changed sprites
88cdf0e10cSrcweir        anymore.<p>
89cdf0e10cSrcweir    */
90cdf0e10cSrcweir    void stopAnimation();
91cdf0e10cSrcweir
92cdf0e10cSrcweir    //-------------------------------------------------------------------------
93cdf0e10cSrcweir
94cdf0e10cSrcweir    /** Reset the animation sequence to start with the first frame.<p>
95cdf0e10cSrcweir
96cdf0e10cSrcweir        If the animation is currently running, the next frame that is
97cdf0e10cSrcweir        drawn after this method has finished, will be the first
98cdf0e10cSrcweir        one. Please note that if an animation is not started, the
99cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
100cdf0e10cSrcweir        sprites automatically.<p>
101cdf0e10cSrcweir     */
102cdf0e10cSrcweir    void resetAnimation();
103cdf0e10cSrcweir
104cdf0e10cSrcweir    //-------------------------------------------------------------------------
105cdf0e10cSrcweir
106cdf0e10cSrcweir    /** Issue an additional render call to this sprite's
107cdf0e10cSrcweir        animation.<p>
108cdf0e10cSrcweir
109cdf0e10cSrcweir        This method has no effect when called for a bitmap-sequence
110cdf0e10cSrcweir        sprite. Please note that if an animation is not started, the
111cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
112cdf0e10cSrcweir        sprites automatically, but has to be told to do so via
113cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
114cdf0e10cSrcweir     */
115cdf0e10cSrcweir    void updateAnimation();
116cdf0e10cSrcweir
117cdf0e10cSrcweir    //-------------------------------------------------------------------------
118cdf0e10cSrcweir
119cdf0e10cSrcweir    /** Changes the view state in place for this sprite's
120cdf0e10cSrcweir        animation.<p>
121cdf0e10cSrcweir
122cdf0e10cSrcweir        The state given here is used when calling the
123cdf0e10cSrcweir        <member>XAnimation::render()</member> method, or when drawing
124cdf0e10cSrcweir        the sprite's bitmaps, respectively. There's no need to call
125cdf0e10cSrcweir        <member>XSpriteCanvas::updateAnimation()</member> after this
126cdf0e10cSrcweir        method, as it automatically rerenders, if necessary. Please
127cdf0e10cSrcweir        note that if an animation is not started, the associated
128cdf0e10cSrcweir        <type>XSpriteCanvas</type> does not update changed sprites
129cdf0e10cSrcweir        automatically, but has to be told to do so via
130cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
131cdf0e10cSrcweir
132cdf0e10cSrcweir        @param aViewState
133cdf0e10cSrcweir        The state given here is used when calling the
134cdf0e10cSrcweir        <member>XAnimation::render()</member> method, or when drawing
135cdf0e10cSrcweir        the sprite's bitmaps, respectively.
136cdf0e10cSrcweir
137cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
138cdf0e10cSrcweir        if the view transformation matrix is singular.
139cdf0e10cSrcweir    */
140cdf0e10cSrcweir    void setViewState( [in] ViewState aViewState )
141cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
142cdf0e10cSrcweir
143cdf0e10cSrcweir    //-------------------------------------------------------------------------
144cdf0e10cSrcweir
145cdf0e10cSrcweir    /** Changes all of the sprite's attributes at one atomic
146cdf0e10cSrcweir        instance.<p>
147cdf0e10cSrcweir
148cdf0e10cSrcweir        This is useful at times where one does not want multiple
149cdf0e10cSrcweir        redraws for every state change.<p>
150cdf0e10cSrcweir
151cdf0e10cSrcweir        Please note that if an animation is not started, the
152cdf0e10cSrcweir        associated <type>XSpriteCanvas</type> does not update changed
153cdf0e10cSrcweir        sprites automatically, but has to be told to do so via
154cdf0e10cSrcweir        <member>XSpriteCanvas::updateScreen()</member>.<p>
155cdf0e10cSrcweir
156cdf0e10cSrcweir        @param aNewPos
157cdf0e10cSrcweir        New left,top output position of the sprite. This position gets
158cdf0e10cSrcweir        transformed by the view and render state.
159cdf0e10cSrcweir
160cdf0e10cSrcweir        @param aViewState
161cdf0e10cSrcweir        New view state of the sprite, and part of the transformation
162cdf0e10cSrcweir        that is applied to aNewPos. The view transformation matrix
163cdf0e10cSrcweir        must not be singular.
164cdf0e10cSrcweir
165cdf0e10cSrcweir        @param aRenderState
166cdf0e10cSrcweir        New render state of the sprite, and part of the transformation
167cdf0e10cSrcweir        that is applied to aNewPos. The render transformation matrix
168cdf0e10cSrcweir        must not be singular.
169cdf0e10cSrcweir
170cdf0e10cSrcweir        @param nAlpha
171cdf0e10cSrcweir        New alpha value of the sprite. This value must be within the
172cdf0e10cSrcweir        [0,1] range.
173cdf0e10cSrcweir
174cdf0e10cSrcweir        @param bUpdateAnimation
175cdf0e10cSrcweir        Whether this method should implicitely call
176cdf0e10cSrcweir        <member>XSpriteCanvas::updateAnimation</member> or not.
177cdf0e10cSrcweir
178cdf0e10cSrcweir        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
179cdf0e10cSrcweir        if one of the passed parameters does not lie in the specified,
180cdf0e10cSrcweir        permissible range.
181cdf0e10cSrcweir     */
182cdf0e10cSrcweir    void setAll( [in] ::com::sun::star::geometry::RealPoint2D	aNewPos,
183cdf0e10cSrcweir                 [in] ViewState                                         aViewState,
184cdf0e10cSrcweir                 [in] RenderState                                       aRenderState,
185cdf0e10cSrcweir                 [in] double                                            nAlpha,
186cdf0e10cSrcweir                 [in] boolean											bUpdateAnimation )
187cdf0e10cSrcweir        raises (com::sun::star::lang::IllegalArgumentException);
188cdf0e10cSrcweir};
189cdf0e10cSrcweir
190cdf0e10cSrcweir}; }; }; };
191cdf0e10cSrcweir
192cdf0e10cSrcweir#endif
193