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 "propertyanimationnode.hxx"
22 #include <animationfactory.hxx>
24 using namespace com::sun::star
;
26 namespace slideshow::internal
{
28 AnimationActivitySharedPtr
PropertyAnimationNode::createActivity() const
30 // Create AnimationActivity from common XAnimate parameters:
31 ActivitiesFactory::CommonParameters
aParms( fillCommonParameters() );
32 uno::Reference
<animations::XAnimate
> const& xAnimateNode
=getXAnimateNode();
33 OUString
const attrName( xAnimateNode
->getAttributeName() );
34 AttributableShapeSharedPtr
const pShape( getShape() );
36 switch (AnimationFactory::classifyAttributeName( attrName
)) {
38 case AnimationFactory::CLASS_UNKNOWN_PROPERTY
:
41 "Unexpected attribute class (unknown or empty attribute name)" );
44 case AnimationFactory::CLASS_NUMBER_PROPERTY
:
45 return ActivitiesFactory::createAnimateActivity(
47 AnimationFactory::createNumberPropertyAnimation(
50 getContext().mpSubsettableShapeManager
,
52 getContext().mpBox2DWorld
),
55 case AnimationFactory::CLASS_ENUM_PROPERTY
:
56 return ActivitiesFactory::createAnimateActivity(
58 AnimationFactory::createEnumPropertyAnimation(
61 getContext().mpSubsettableShapeManager
,
63 getContext().mpBox2DWorld
, 0 ),
66 case AnimationFactory::CLASS_COLOR_PROPERTY
:
67 return ActivitiesFactory::createAnimateActivity(
69 AnimationFactory::createColorPropertyAnimation(
72 getContext().mpSubsettableShapeManager
,
74 getContext().mpBox2DWorld
),
77 case AnimationFactory::CLASS_STRING_PROPERTY
:
78 return ActivitiesFactory::createAnimateActivity(
80 AnimationFactory::createStringPropertyAnimation(
83 getContext().mpSubsettableShapeManager
,
85 getContext().mpBox2DWorld
, 0 ),
88 case AnimationFactory::CLASS_BOOL_PROPERTY
:
89 return ActivitiesFactory::createAnimateActivity(
91 AnimationFactory::createBoolPropertyAnimation(
94 getContext().mpSubsettableShapeManager
,
96 getContext().mpBox2DWorld
, 0 ),
100 return AnimationActivitySharedPtr();
103 } // namespace slideshow::internal
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */