1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_rendering_XAnimation_idl__
24#define __com_sun_star_rendering_XAnimation_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
30#include <com/sun/star/lang/IllegalArgumentException.idl>
31#endif
32#ifndef __com_sun_star_rendering_ViewState_idl__
33#include <com/sun/star/rendering/ViewState.idl>
34#endif
35#ifndef __com_sun_star_rendering_AnimationAttributes_idl__
36#include <com/sun/star/rendering/AnimationAttributes.idl>
37#endif
38#ifndef __com_sun_star_rendering_XCanvas_idl__
39#include <com/sun/star/rendering/XCanvas.idl>
40#endif
41
42
43module com { module sun { module star { module rendering {
44
45/* TODO: Have a property set here, to easily extend attributes? Think
46   that's advisable, because animations change the most. Implement
47   that with multiple inheritance interface types, please, not with
48   service description.
49*/
50
51/** This interface defines an animation sequence.<p>
52
53    This interface must be implemented by every animation object. It
54    is used by the <type>XCanvas</type> interface to render generic
55    animations.<p>
56
57    @since OpenOffice 2.0
58 */
59published interface XAnimation : ::com::sun::star::uno::XInterface
60{
61    /** Render the animation content at time t into the specified
62        canvas.<p>
63
64        Note that it is perfectly legal to e.g. map t in a nonlinear
65        fashion to internal frames, for example to achieve
66        acceleration or decceleration effects. It is required that the
67        render method has const semantics, i.e. when called with the
68        same parameter set, identical output must be generated. This
69        is because e.g. a Sprite might decide arbitrarily to render an
70        animation once and cache the result, or repaint it via
71        XAnimation::render everytime.<p>
72
73        The rendered content, although, must be exactly the same for
74        identical viewState, canvas and t values. Or, for that
75        matters, must call the same canvas methods in the same order
76        with the same parameter sets, for identical viewState and t
77        values. Furthermore, when viewState has the identity
78        transformation set, rendered output must be contained in a
79        rectangle with upper left corner at (0,0) and width and height
80        given by the AnimationAttributes' untransformedSize
81        member. Any content exceeding this box might get clipped off.<p>
82
83        @param canvas
84        The target canvas to render this animation to.
85
86        @param viewState
87        The view state to be used when rendering this animation to the
88        target canvas. The view transformation matrix must not be
89        singular.
90
91        @param t
92        Time instant for which animation content is requested. The
93        range must always be [0,1], where 0 denotes the very beginning, and
94        1 the end of the animation sequence.
95
96        @throws <type>com::sun::star::lang::IllegalArgumentException</type>
97        if one of the passed parameters does not lie in the specified,
98        permissible range.
99     */
100    void                    render( [in] XCanvas canvas, [in] ViewState viewState, [in] double t )
101        raises (com::sun::star::lang::IllegalArgumentException);
102
103    //-------------------------------------------------------------------------
104
105    /** Request the attribute information for this animation.<p>
106
107        This method returns the <type>AnimationAttributes</type>
108        structure, which defines more closely how to play this
109        animation.<p>
110
111        @returns the requested <type>AnimationAttributes</type>
112        structure.
113     */
114    AnimationAttributes		getAnimationAttributes();
115};
116
117}; }; }; };
118
119#endif
120