1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <com/sun/star/animations/AnimationTransformType.hpp>
23 #include "animationtransformnode.hxx"
24 #include <animationfactory.hxx>
25 #include <activitiesfactory.hxx>
27 using namespace com::sun::star
;
29 namespace slideshow::internal
{
31 void AnimationTransformNode::dispose()
33 mxTransformNode
.clear();
34 AnimationBaseNode::dispose();
37 AnimationActivitySharedPtr
AnimationTransformNode::createActivity() const
39 ActivitiesFactory::CommonParameters
aParms( fillCommonParameters() );
41 const sal_Int16
nTransformType( mxTransformNode
->getTransformType() );
43 const AttributableShapeSharedPtr
& rShape( getShape() );
45 switch( nTransformType
)
48 throw css::uno::RuntimeException(
49 u
"AnimationTransformNode::createTransformActivity(): "
50 "Unknown transform type"_ustr
);
52 case animations::AnimationTransformType::TRANSLATE
:
53 case animations::AnimationTransformType::SCALE
:
54 return ActivitiesFactory::createAnimateActivity(
56 AnimationFactory::createPairPropertyAnimation(
58 getContext().mpSubsettableShapeManager
,
63 case animations::AnimationTransformType::ROTATE
:
64 return ActivitiesFactory::createAnimateActivity(
66 AnimationFactory::createNumberPropertyAnimation(
69 getContext().mpSubsettableShapeManager
,
71 getContext().mpBox2DWorld
),
74 case animations::AnimationTransformType::SKEWX
:
75 return ActivitiesFactory::createAnimateActivity(
77 AnimationFactory::createNumberPropertyAnimation(
80 getContext().mpSubsettableShapeManager
,
82 getContext().mpBox2DWorld
),
85 case animations::AnimationTransformType::SKEWY
:
86 return ActivitiesFactory::createAnimateActivity(
88 AnimationFactory::createNumberPropertyAnimation(
91 getContext().mpSubsettableShapeManager
,
93 getContext().mpBox2DWorld
),
98 } // namespace slideshow::internal
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */