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