fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / slideshow / source / engine / animationnodes / propertyanimationnode.cxx
blobc589d73eb08075826e2d1c8dfb293077b6c58a49
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 // must be first
22 #include <canvas/debug.hxx>
23 #include <canvas/verbosetrace.hxx>
25 #include "propertyanimationnode.hxx"
26 #include "animationfactory.hxx"
28 using namespace com::sun::star;
30 namespace slideshow {
31 namespace internal {
33 AnimationActivitySharedPtr PropertyAnimationNode::createActivity() const
35 // Create AnimationActivity from common XAnimate parameters:
36 ActivitiesFactory::CommonParameters aParms( fillCommonParameters() );
37 uno::Reference<animations::XAnimate> const& xAnimateNode =getXAnimateNode();
38 OUString const attrName( xAnimateNode->getAttributeName() );
39 AttributableShapeSharedPtr const pShape( getShape() );
41 switch (AnimationFactory::classifyAttributeName( attrName )) {
42 default:
43 case AnimationFactory::CLASS_UNKNOWN_PROPERTY:
44 ENSURE_OR_THROW(
45 false,
46 "Unexpected attribute class (unknown or empty attribute name)" );
47 break;
49 case AnimationFactory::CLASS_NUMBER_PROPERTY:
50 return ActivitiesFactory::createAnimateActivity(
51 aParms,
52 AnimationFactory::createNumberPropertyAnimation(
53 attrName,
54 pShape,
55 getContext().mpSubsettableShapeManager,
56 getSlideSize() ),
57 xAnimateNode );
59 case AnimationFactory::CLASS_ENUM_PROPERTY:
60 return ActivitiesFactory::createAnimateActivity(
61 aParms,
62 AnimationFactory::createEnumPropertyAnimation(
63 attrName,
64 pShape,
65 getContext().mpSubsettableShapeManager,
66 getSlideSize() ),
67 xAnimateNode );
69 case AnimationFactory::CLASS_COLOR_PROPERTY:
70 return ActivitiesFactory::createAnimateActivity(
71 aParms,
72 AnimationFactory::createColorPropertyAnimation(
73 attrName,
74 pShape,
75 getContext().mpSubsettableShapeManager,
76 getSlideSize() ),
77 xAnimateNode );
79 case AnimationFactory::CLASS_STRING_PROPERTY:
80 return ActivitiesFactory::createAnimateActivity(
81 aParms,
82 AnimationFactory::createStringPropertyAnimation(
83 attrName,
84 pShape,
85 getContext().mpSubsettableShapeManager,
86 getSlideSize() ),
87 xAnimateNode );
89 case AnimationFactory::CLASS_BOOL_PROPERTY:
90 return ActivitiesFactory::createAnimateActivity(
91 aParms,
92 AnimationFactory::createBoolPropertyAnimation(
93 attrName,
94 pShape,
95 getContext().mpSubsettableShapeManager,
96 getSlideSize() ),
97 xAnimateNode );
100 return AnimationActivitySharedPtr();
103 } // namespace internal
104 } // namespace slideshow
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */