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