1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_slideshow.hxx"
26
27 // must be first
28 #include <canvas/debug.hxx>
29 #include <canvas/verbosetrace.hxx>
30 #include <com/sun/star/animations/AnimationTransformType.hpp>
31
32 #include "animationtransformnode.hxx"
33 #include "animationfactory.hxx"
34 #include "activitiesfactory.hxx"
35
36 using namespace com::sun::star;
37
38 namespace slideshow {
39 namespace internal {
40
dispose()41 void AnimationTransformNode::dispose()
42 {
43 mxTransformNode.clear();
44 AnimationBaseNode::dispose();
45 }
46
createActivity() const47 AnimationActivitySharedPtr AnimationTransformNode::createActivity() const
48 {
49 ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
50
51 const sal_Int16 nTransformType( mxTransformNode->getTransformType() );
52
53 const AttributableShapeSharedPtr& rShape( getShape() );
54
55 switch( nTransformType )
56 {
57 default:
58 ENSURE_OR_THROW(
59 false, "AnimationTransformNode::createTransformActivity(): "
60 "Unknown transform type" );
61
62 case animations::AnimationTransformType::TRANSLATE:
63 // FALLTHROUGH intended
64 case animations::AnimationTransformType::SCALE:
65 return ActivitiesFactory::createAnimateActivity(
66 aParms,
67 AnimationFactory::createPairPropertyAnimation(
68 rShape,
69 getContext().mpSubsettableShapeManager,
70 getSlideSize(),
71 nTransformType ),
72 getXAnimateNode() );
73
74 case animations::AnimationTransformType::ROTATE:
75 return ActivitiesFactory::createAnimateActivity(
76 aParms,
77 AnimationFactory::createNumberPropertyAnimation(
78 ::rtl::OUString(
79 RTL_CONSTASCII_USTRINGPARAM("Rotate") ),
80 rShape,
81 getContext().mpSubsettableShapeManager,
82 getSlideSize() ),
83 getXAnimateNode() );
84
85 case animations::AnimationTransformType::SKEWX:
86 return ActivitiesFactory::createAnimateActivity(
87 aParms,
88 AnimationFactory::createNumberPropertyAnimation(
89 ::rtl::OUString(
90 RTL_CONSTASCII_USTRINGPARAM("SkewX") ),
91 rShape,
92 getContext().mpSubsettableShapeManager,
93 getSlideSize() ),
94 getXAnimateNode() );
95
96 case animations::AnimationTransformType::SKEWY:
97 return ActivitiesFactory::createAnimateActivity(
98 aParms,
99 AnimationFactory::createNumberPropertyAnimation(
100 ::rtl::OUString(
101 RTL_CONSTASCII_USTRINGPARAM("SkewY") ),
102 rShape,
103 getContext().mpSubsettableShapeManager,
104 getSlideSize() ),
105 getXAnimateNode() );
106 }
107 }
108
109 } // namespace internal
110 } // namespace slideshow
111