Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / animationnodes / animationtransformnode.cxx
blob394349f5b7075c3a6d1afd5143cb1b6843f97780
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
30 namespace internal {
32 void AnimationTransformNode::dispose()
34 mxTransformNode.clear();
35 AnimationBaseNode::dispose();
38 AnimationActivitySharedPtr AnimationTransformNode::createActivity() const
40 ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
42 const sal_Int16 nTransformType( mxTransformNode->getTransformType() );
44 const AttributableShapeSharedPtr& rShape( getShape() );
46 switch( nTransformType )
48 default:
49 ENSURE_OR_THROW(
50 false, "AnimationTransformNode::createTransformActivity(): "
51 "Unknown transform type" );
53 case animations::AnimationTransformType::TRANSLATE:
54 // FALLTHROUGH intended
55 case animations::AnimationTransformType::SCALE:
56 return ActivitiesFactory::createAnimateActivity(
57 aParms,
58 AnimationFactory::createPairPropertyAnimation(
59 rShape,
60 getContext().mpSubsettableShapeManager,
61 getSlideSize(),
62 nTransformType, 0 ),
63 getXAnimateNode() );
65 case animations::AnimationTransformType::ROTATE:
66 return ActivitiesFactory::createAnimateActivity(
67 aParms,
68 AnimationFactory::createNumberPropertyAnimation(
69 "Rotate",
70 rShape,
71 getContext().mpSubsettableShapeManager,
72 getSlideSize() ),
73 getXAnimateNode() );
75 case animations::AnimationTransformType::SKEWX:
76 return ActivitiesFactory::createAnimateActivity(
77 aParms,
78 AnimationFactory::createNumberPropertyAnimation(
79 "SkewX",
80 rShape,
81 getContext().mpSubsettableShapeManager,
82 getSlideSize() ),
83 getXAnimateNode() );
85 case animations::AnimationTransformType::SKEWY:
86 return ActivitiesFactory::createAnimateActivity(
87 aParms,
88 AnimationFactory::createNumberPropertyAnimation(
89 "SkewY",
90 rShape,
91 getContext().mpSubsettableShapeManager,
92 getSlideSize() ),
93 getXAnimateNode() );
97 } // namespace internal
98 } // namespace slideshow
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */