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 : #ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
20 : #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
21 :
22 : #include <com/sun/star/animations/XAnimate.hpp>
23 :
24 : #include "basecontainernode.hxx"
25 : #include "activitiesfactory.hxx"
26 : #include "shapeattributelayer.hxx"
27 : #include "shapeattributelayerholder.hxx"
28 : #include "attributableshape.hxx"
29 : #include "shapesubset.hxx"
30 :
31 : namespace slideshow {
32 : namespace internal {
33 :
34 : /** Common base class for all leaf animation nodes.
35 :
36 : This class basically holds the target shape
37 : */
38 0 : class AnimationBaseNode : public BaseNode
39 : {
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 );
46 :
47 : #if OSL_DEBUG_LEVEL >= 2 && defined(DBG_UTIL)
48 : virtual void showState() const;
49 : #endif
50 :
51 : protected:
52 : virtual void dispose() SAL_OVERRIDE;
53 :
54 : ::com::sun::star::uno::Reference<
55 0 : ::com::sun::star::animations::XAnimate> const& getXAnimateNode() const
56 0 : { return mxAnimateNode; }
57 :
58 : /// Create parameter struct for ActivitiesFactory
59 : ActivitiesFactory::CommonParameters fillCommonParameters() const;
60 0 : ::basegfx::B2DVector const& getSlideSize() const { return maSlideSize; }
61 : AttributableShapeSharedPtr getShape() const;
62 :
63 : private:
64 : virtual bool hasPendingAnimation() const SAL_OVERRIDE;
65 :
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;
72 :
73 : private:
74 : /** Returns true, if this is a subset animation, and
75 : the subset is autogenerated (e.g. from an
76 : iteration)
77 : */
78 0 : bool isDependentSubsettedShape() const
79 0 : { return mpShapeSubset && !mbIsIndependentSubset; }
80 :
81 : ShapeAttributeLayerHolder const & getAttributeLayerHolder() const
82 : { return maAttributeLayerHolder; }
83 :
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;
90 :
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;
97 : };
98 :
99 : } // namespace internal
100 : } // namespace presentation
101 :
102 : #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_ANIMATIONBASENODE_HXX
103 :
104 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|