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