Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / animationnodes / propertyanimationnode.cxx
blobc893bb027f366cd93e3c6adf2a0d680452e391ed
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 "propertyanimationnode.hxx"
22 #include <animationfactory.hxx>
24 using namespace com::sun::star;
26 namespace slideshow {
27 namespace internal {
29 AnimationActivitySharedPtr PropertyAnimationNode::createActivity() const
31 // Create AnimationActivity from common XAnimate parameters:
32 ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
33 uno::Reference<animations::XAnimate> const& xAnimateNode =getXAnimateNode();
34 OUString const attrName( xAnimateNode->getAttributeName() );
35 AttributableShapeSharedPtr const pShape( getShape() );
37 switch (AnimationFactory::classifyAttributeName( attrName )) {
38 default:
39 case AnimationFactory::CLASS_UNKNOWN_PROPERTY:
40 ENSURE_OR_THROW(
41 false,
42 "Unexpected attribute class (unknown or empty attribute name)" );
43 break;
45 case AnimationFactory::CLASS_NUMBER_PROPERTY:
46 return ActivitiesFactory::createAnimateActivity(
47 aParms,
48 AnimationFactory::createNumberPropertyAnimation(
49 attrName,
50 pShape,
51 getContext().mpSubsettableShapeManager,
52 getSlideSize() ),
53 xAnimateNode );
55 case AnimationFactory::CLASS_ENUM_PROPERTY:
56 return ActivitiesFactory::createAnimateActivity(
57 aParms,
58 AnimationFactory::createEnumPropertyAnimation(
59 attrName,
60 pShape,
61 getContext().mpSubsettableShapeManager,
62 getSlideSize(), 0 ),
63 xAnimateNode );
65 case AnimationFactory::CLASS_COLOR_PROPERTY:
66 return ActivitiesFactory::createAnimateActivity(
67 aParms,
68 AnimationFactory::createColorPropertyAnimation(
69 attrName,
70 pShape,
71 getContext().mpSubsettableShapeManager,
72 getSlideSize() ),
73 xAnimateNode );
75 case AnimationFactory::CLASS_STRING_PROPERTY:
76 return ActivitiesFactory::createAnimateActivity(
77 aParms,
78 AnimationFactory::createStringPropertyAnimation(
79 attrName,
80 pShape,
81 getContext().mpSubsettableShapeManager,
82 getSlideSize(), 0 ),
83 xAnimateNode );
85 case AnimationFactory::CLASS_BOOL_PROPERTY:
86 return ActivitiesFactory::createAnimateActivity(
87 aParms,
88 AnimationFactory::createBoolPropertyAnimation(
89 attrName,
90 pShape,
91 getContext().mpSubsettableShapeManager,
92 getSlideSize(), 0 ),
93 xAnimateNode );
96 return AnimationActivitySharedPtr();
99 } // namespace internal
100 } // namespace slideshow
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */