bump product version to 5.0.4.1
[LibreOffice.git] / slideshow / source / engine / animationnodes / animationbasenode.hxx
blob429d9815be202278f965775349022eb955795ed3
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 .
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 "shapeattributelayer.hxx"
27 #include "shapeattributelayerholder.hxx"
28 #include "attributableshape.hxx"
29 #include "shapesubset.hxx"
31 namespace slideshow {
32 namespace internal {
34 /** Common base class for all leaf animation nodes.
36 This class basically holds the target shape
38 class AnimationBaseNode : public BaseNode
40 public:
41 AnimationBaseNode(
42 ::com::sun::star::uno::Reference<
43 ::com::sun::star::animations::XAnimationNode> const& xNode,
44 ::boost::shared_ptr<BaseContainerNode> const& pParent,
45 NodeContext const& rContext );
47 #if OSL_DEBUG_LEVEL >= 2 && defined(DBG_UTIL)
48 virtual void showState() const;
49 #endif
51 protected:
52 virtual void dispose() SAL_OVERRIDE;
54 ::com::sun::star::uno::Reference<
55 ::com::sun::star::animations::XAnimate> const& getXAnimateNode() const
56 { return mxAnimateNode; }
58 /// Create parameter struct for ActivitiesFactory
59 ActivitiesFactory::CommonParameters fillCommonParameters() const;
60 ::basegfx::B2DVector const& getSlideSize() const { return maSlideSize; }
61 AttributableShapeSharedPtr getShape() const;
63 private:
64 virtual bool hasPendingAnimation() const SAL_OVERRIDE;
66 private: // state transition callbacks
67 virtual bool init_st() SAL_OVERRIDE;
68 virtual bool resolve_st() SAL_OVERRIDE;
69 virtual void activate_st() SAL_OVERRIDE;
70 virtual void deactivate_st( NodeState eDestState ) SAL_OVERRIDE;
71 virtual AnimationActivitySharedPtr createActivity() const = 0;
73 private:
74 /** Returns true, if this is a subset animation, and
75 the subset is autogenerated (e.g. from an
76 iteration)
78 bool isDependentSubsettedShape() const
79 { return mpShapeSubset && !mbIsIndependentSubset; }
81 ShapeAttributeLayerHolder const & getAttributeLayerHolder() const
82 { return maAttributeLayerHolder; }
84 private:
85 ::com::sun::star::uno::Reference<
86 ::com::sun::star::animations::XAnimate> mxAnimateNode;
87 ShapeAttributeLayerHolder maAttributeLayerHolder;
88 ::basegfx::B2DVector maSlideSize;
89 AnimationActivitySharedPtr mpActivity;
91 /// When valid, this node has a plain target shape
92 AttributableShapeSharedPtr mpShape;
93 /// When valid, this is a subsetted target shape
94 ShapeSubsetSharedPtr mpShapeSubset;
95 SubsettableShapeManagerSharedPtr mpSubsetManager;
96 bool mbIsIndependentSubset;
99 } // namespace internal
100 } // namespace presentation
102 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */