# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Interface Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.2
# Namespace: com.sun.star.rendering
from typing_extensions import Literal
import typing
from ..uno.x_interface import XInterface as XInterface_8f010a43
if typing.TYPE_CHECKING:
    from .animation_attributes import AnimationAttributes as AnimationAttributes_5c8f108d
    from .view_state import ViewState as ViewState_cab30c62
    from .x_canvas import XCanvas as XCanvas_b19b0b7a

class XAnimation(XInterface_8f010a43):
    """
    This interface defines an animation sequence.
    
    This interface must be implemented by every animation object. It is used by the XCanvas interface to render generic animations.
    
    **since**
    
        OOo 2.0

    See Also:
        `API XAnimation <https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1rendering_1_1XAnimation.html>`_
    """
    __pyunointerface__: Literal['com.sun.star.rendering.XAnimation']

    def getAnimationAttributes(self) -> 'AnimationAttributes_5c8f108d':
        """
        Request the attribute information for this animation.
        
        This method returns the AnimationAttributes structure, which defines more closely how to play this animation.
        """
    def render(self, canvas: 'XCanvas_b19b0b7a', viewState: 'ViewState_cab30c62', t: float) -> None:
        """
        Render the animation content at time t into the specified canvas.
        
        Note that it is perfectly legal to e.g. map t in a nonlinear fashion to internal frames, for example to achieve acceleration or deceleration effects. It is required that the render method has const semantics, i.e. when called with the same parameter set, identical output must be generated. This is because e.g. a Sprite might decide arbitrarily to render an animation once and cache the result, or repaint it via XAnimation.render every time.
        
        The rendered content, although, must be exactly the same for identical viewState, canvas and t values. Or, for that matters, must call the same canvas methods in the same order with the same parameter sets, for identical viewState and t values. Furthermore, when viewState has the identity transformation set, rendered output must be contained in a rectangle with upper left corner at (0,0) and width and height given by the AnimationAttributes' untransformedSize member. Any content exceeding this box might get clipped off.

        Raises:
            com.sun.star.lang.IllegalArgumentException: ``IllegalArgumentException``
        """

