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 .
22 #include <canvas/debug.hxx>
23 #include <tools/diagnose_ex.h>
25 #include <comphelper/anytostring.hxx>
26 #include <cppuhelper/exc_hlp.hxx>
28 #include "slideanimations.hxx"
29 #include "animationnodefactory.hxx"
31 using namespace ::com::sun::star
;
37 SlideAnimations::SlideAnimations( const SlideShowContext
& rContext
,
38 const ::basegfx::B2DVector
& rSlideSize
) :
39 maContext( rContext
),
40 maSlideSize( rSlideSize
),
43 ENSURE_OR_THROW( maContext
.mpSubsettableShapeManager
,
44 "SlideAnimations::SlideAnimations(): Invalid SlideShowContext" );
47 SlideAnimations::~SlideAnimations()
51 SHOW_NODE_TREE( mpRootNode
);
55 mpRootNode
->dispose();
57 catch (uno::Exception
&)
59 OSL_FAIL( OUStringToOString(
60 comphelper::anyToString(
61 cppu::getCaughtException() ),
62 RTL_TEXTENCODING_UTF8
).getStr() );
67 bool SlideAnimations::importAnimations( const uno::Reference
< animations::XAnimationNode
>& xRootAnimationNode
)
69 mpRootNode
= AnimationNodeFactory::createAnimationNode(
74 SHOW_NODE_TREE( mpRootNode
);
76 return static_cast< bool >(mpRootNode
);
79 bool SlideAnimations::isAnimated() const
82 return false; // no animations there
84 // query root node about pending animations
85 return mpRootNode
->hasPendingAnimation();
88 bool SlideAnimations::start()
91 return false; // no animations there
94 if( !mpRootNode
->init() )
98 if( !mpRootNode
->resolve() )
104 void SlideAnimations::end()
107 return; // no animations there
110 mpRootNode
->deactivate();
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */