Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : :
21 : : // must be first
22 : : #include <canvas/debug.hxx>
23 : : #include <canvas/verbosetrace.hxx>
24 : : #include <com/sun/star/animations/AnimationTransformType.hpp>
25 : :
26 : : #include "animationtransformnode.hxx"
27 : : #include "animationfactory.hxx"
28 : : #include "activitiesfactory.hxx"
29 : :
30 : : using namespace com::sun::star;
31 : :
32 : : namespace slideshow {
33 : : namespace internal {
34 : :
35 : 0 : void AnimationTransformNode::dispose()
36 : : {
37 : 0 : mxTransformNode.clear();
38 : 0 : AnimationBaseNode::dispose();
39 : 0 : }
40 : :
41 : 0 : AnimationActivitySharedPtr AnimationTransformNode::createActivity() const
42 : : {
43 : 0 : ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
44 : :
45 : 0 : const sal_Int16 nTransformType( mxTransformNode->getTransformType() );
46 : :
47 : 0 : const AttributableShapeSharedPtr& rShape( getShape() );
48 : :
49 : 0 : switch( nTransformType )
50 : : {
51 : : default:
52 : 0 : ENSURE_OR_THROW(
53 : : false, "AnimationTransformNode::createTransformActivity(): "
54 : : "Unknown transform type" );
55 : :
56 : : case animations::AnimationTransformType::TRANSLATE:
57 : : // FALLTHROUGH intended
58 : : case animations::AnimationTransformType::SCALE:
59 : : return ActivitiesFactory::createAnimateActivity(
60 : : aParms,
61 : : AnimationFactory::createPairPropertyAnimation(
62 : : rShape,
63 : 0 : getContext().mpSubsettableShapeManager,
64 : 0 : getSlideSize(),
65 : : nTransformType ),
66 : 0 : getXAnimateNode() );
67 : :
68 : : case animations::AnimationTransformType::ROTATE:
69 : : return ActivitiesFactory::createAnimateActivity(
70 : : aParms,
71 : : AnimationFactory::createNumberPropertyAnimation(
72 : : ::rtl::OUString(
73 : : RTL_CONSTASCII_USTRINGPARAM("Rotate") ),
74 : : rShape,
75 : 0 : getContext().mpSubsettableShapeManager,
76 : 0 : getSlideSize() ),
77 : 0 : getXAnimateNode() );
78 : :
79 : : case animations::AnimationTransformType::SKEWX:
80 : : return ActivitiesFactory::createAnimateActivity(
81 : : aParms,
82 : : AnimationFactory::createNumberPropertyAnimation(
83 : : ::rtl::OUString(
84 : : RTL_CONSTASCII_USTRINGPARAM("SkewX") ),
85 : : rShape,
86 : 0 : getContext().mpSubsettableShapeManager,
87 : 0 : getSlideSize() ),
88 : 0 : getXAnimateNode() );
89 : :
90 : : case animations::AnimationTransformType::SKEWY:
91 : : return ActivitiesFactory::createAnimateActivity(
92 : : aParms,
93 : : AnimationFactory::createNumberPropertyAnimation(
94 : : ::rtl::OUString(
95 : : RTL_CONSTASCII_USTRINGPARAM("SkewY") ),
96 : : rShape,
97 : 0 : getContext().mpSubsettableShapeManager,
98 : 0 : getSlideSize() ),
99 : 0 : getXAnimateNode() );
100 : 0 : }
101 : : }
102 : :
103 : : } // namespace internal
104 : : } // namespace slideshow
105 : :
106 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|