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 .
19 #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
20 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
22 #include <com/sun/star/animations/XAnimate.hpp>
24 #include <basecontainernode.hxx>
25 #include <activitiesfactory.hxx>
26 #include <shapeattributelayerholder.hxx>
27 #include <attributableshape.hxx>
28 #include <shapesubset.hxx>
30 namespace slideshow::internal
{
32 /** Common base class for all leaf animation nodes.
34 This class basically holds the target shape
36 class AnimationBaseNode
: public BaseNode
40 css::uno::Reference
<css::animations::XAnimationNode
> const& xNode
,
41 BaseContainerNodeSharedPtr
const& pParent
,
42 NodeContext
const& rContext
);
45 virtual void showState() const override
;
47 virtual void removeEffect() override
;
50 virtual void dispose() override
;
52 css::uno::Reference
<css::animations::XAnimate
> const& getXAnimateNode() const
53 { return mxAnimateNode
; }
55 /// Create parameter struct for ActivitiesFactory
56 ActivitiesFactory::CommonParameters
fillCommonParameters() const;
57 ::basegfx::B2DVector
const& getSlideSize() const { return maSlideSize
; }
58 AttributableShapeSharedPtr
const & getShape() const;
61 virtual bool hasPendingAnimation() const override
;
62 virtual bool enqueueActivity() const;
64 private: // state transition callbacks
65 virtual bool init_st() override
;
66 virtual bool resolve_st() override
;
67 virtual void activate_st() override
;
68 virtual void deactivate_st( NodeState eDestState
) override
;
69 virtual AnimationActivitySharedPtr
createActivity() const = 0;
72 /** Returns true, if this is a subset animation, and
73 the subset is autogenerated (e.g. from an
76 bool isDependentSubsettedShape() const
77 { return mpShapeSubset
&& !mbIsIndependentSubset
; }
80 css::uno::Reference
<css::animations::XAnimate
> mxAnimateNode
;
81 ShapeAttributeLayerHolder maAttributeLayerHolder
;
82 ::basegfx::B2DVector maSlideSize
;
84 /// When valid, this node has a plain target shape
85 AttributableShapeSharedPtr mpShape
;
86 /// When valid, this is a subsetted target shape
87 ShapeSubsetSharedPtr mpShapeSubset
;
88 SubsettableShapeManagerSharedPtr mpSubsetManager
;
89 bool mbPreservedVisibility
;
90 bool mbIsIndependentSubset
;
93 AnimationActivitySharedPtr mpActivity
;
96 } // namespace presentation::internal
98 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */