diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-07-26 06:36:34 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-07-26 06:36:34 +0000 |
commit | 3be6eaa58e89ba294753d2fb382fb6295ac697c4 (patch) | |
tree | a6be329b528e59530ab05a853c853aadbd8a6d20 /slideshow/source/engine | |
parent | c149ab7cac6409668da50fe73a707704ed97d55c (diff) |
INTEGRATION: CWS presfixes10 (1.3.8); FILE MERGED
2005/11/07 15:26:56 dbo 1.3.8.1: #i45197# revised code
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'slideshow/source/engine')
-rw-r--r-- | slideshow/source/engine/animationnodes/propertyanimationnode.cxx | 110 | ||||
-rw-r--r-- | slideshow/source/engine/animationnodes/propertyanimationnode.hxx | 49 |
2 files changed, 96 insertions, 63 deletions
diff --git a/slideshow/source/engine/animationnodes/propertyanimationnode.cxx b/slideshow/source/engine/animationnodes/propertyanimationnode.cxx index 7cf7939ddbcc..cb43e124ef93 100644 --- a/slideshow/source/engine/animationnodes/propertyanimationnode.cxx +++ b/slideshow/source/engine/animationnodes/propertyanimationnode.cxx @@ -4,9 +4,9 @@ * * $RCSfile: propertyanimationnode.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:46:10 $ + * last change: $Author: rt $ $Date: 2006-07-26 07:36:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -34,51 +34,81 @@ ************************************************************************/ // must be first -#include <canvas/debug.hxx> -#include <canvas/verbosetrace.hxx> +#include "canvas/debug.hxx" +#include "canvas/verbosetrace.hxx" +#include "propertyanimationnode.hxx" +#include "animationfactory.hxx" -#include <propertyanimationnode.hxx> +using namespace com::sun::star; +namespace presentation { +namespace internal { -using namespace ::com::sun::star; - -namespace presentation +AnimationActivitySharedPtr PropertyAnimationNode::createActivity() const { - namespace internal - { - PropertyAnimationNode::PropertyAnimationNode( const uno::Reference< animations::XAnimationNode >& xNode, - const BaseContainerNodeSharedPtr& rParent, - const NodeContext& rContext ) : - ActivityAnimationBaseNode( xNode, rParent, rContext ) - { - } + // Create AnimationActivity from common XAnimate parameters: + ActivitiesFactory::CommonParameters aParms( fillCommonParameters() ); + uno::Reference<animations::XAnimate> const& xAnimateNode =getXAnimateNode(); + rtl::OUString const attrName( xAnimateNode->getAttributeName() ); + AttributableShapeSharedPtr const pShape( getShape() ); + + switch (AnimationFactory::classifyAttributeName( attrName )) { + default: + case AnimationFactory::CLASS_UNKNOWN_PROPERTY: + ENSURE_AND_THROW( + false, + "Unexpected attribute class (unknown or empty attribute name)" ); + break; + + case AnimationFactory::CLASS_NUMBER_PROPERTY: + return ActivitiesFactory::createAnimateActivity( + aParms, + AnimationFactory::createNumberPropertyAnimation( + attrName, + pShape, + getContext().mpLayerManager ), + xAnimateNode ); - bool PropertyAnimationNode::init() - { - if( !ActivityAnimationBaseNode::init() ) - return false; + case AnimationFactory::CLASS_ENUM_PROPERTY: + return ActivitiesFactory::createAnimateActivity( + aParms, + AnimationFactory::createEnumPropertyAnimation( + attrName, + pShape, + getContext().mpLayerManager ), + xAnimateNode ); - try - { - // TODO(F2): For restart functionality, we must regenerate activities, - // since they are not able to reset their state (or implement _that_) - getActivity() = createActivity(); - } - catch( uno::Exception& ) - { - // catch and ignore. We later handle empty activities, but for - // other nodes to function properly, the core functionality of - // this node must remain up and running. - } + case AnimationFactory::CLASS_COLOR_PROPERTY: + return ActivitiesFactory::createAnimateActivity( + aParms, + AnimationFactory::createColorPropertyAnimation( + attrName, + pShape, + getContext().mpLayerManager ), + xAnimateNode ); - return true; - } + case AnimationFactory::CLASS_STRING_PROPERTY: + return ActivitiesFactory::createAnimateActivity( + aParms, + AnimationFactory::createStringPropertyAnimation( + attrName, + pShape, + getContext().mpLayerManager ), + xAnimateNode ); -#if defined(VERBOSE) && defined(DBG_UTIL) - const char* PropertyAnimationNode::getDescription() const - { - return "PropertyAnimationNode"; - } -#endif + case AnimationFactory::CLASS_BOOL_PROPERTY: + return ActivitiesFactory::createAnimateActivity( + aParms, + AnimationFactory::createBoolPropertyAnimation( + attrName, + pShape, + getContext().mpLayerManager ), + xAnimateNode ); } + + return AnimationActivitySharedPtr(); } + +} // namespace internal +} // namespace presentation + diff --git a/slideshow/source/engine/animationnodes/propertyanimationnode.hxx b/slideshow/source/engine/animationnodes/propertyanimationnode.hxx index 58c0697a7dde..c3126015bdba 100644 --- a/slideshow/source/engine/animationnodes/propertyanimationnode.hxx +++ b/slideshow/source/engine/animationnodes/propertyanimationnode.hxx @@ -4,9 +4,9 @@ * * $RCSfile: propertyanimationnode.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-09-07 20:46:25 $ + * last change: $Author: rt $ $Date: 2006-07-26 07:36:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -32,32 +32,35 @@ * MA 02111-1307 USA * ************************************************************************/ +#ifndef INCLUDED_SLIDESHOW_PROPERTYANIMATIONNODE_HXX +#define INCLUDED_SLIDESHOW_PROPERTYANIMATIONNODE_HXX -#ifndef _SLIDESHOW_PROPERTYANIMATIONNODE_HXX -#define _SLIDESHOW_PROPERTYANIMATIONNODE_HXX +#include "animationbasenode.hxx" -#include <activityanimationbasenode.hxx> +namespace presentation { +namespace internal { - -namespace presentation +class PropertyAnimationNode : public AnimationBaseNode { - namespace internal - { - class PropertyAnimationNode : public ActivityAnimationBaseNode - { - public: - PropertyAnimationNode( const ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode >& xNode, - const BaseContainerNodeSharedPtr& rParent, - const NodeContext& rContext ); - - virtual bool init(); +public: + PropertyAnimationNode( + ::com::sun::star::uno::Reference< + ::com::sun::star::animations::XAnimationNode> const& xNode, + ::boost::shared_ptr<BaseContainerNode> const& pParent, + NodeContext const& rContext ) + : AnimationBaseNode( xNode, pParent, rContext ) {} #if defined(VERBOSE) && defined(DBG_UTIL) - virtual const char* getDescription() const; + virtual const char* getDescription() const + { return "PropertyAnimationNode"; } #endif - }; - } -} -#endif /* _SLIDESHOW_PROPERTYANIMATIONNODE_HXX */ +private: + virtual AnimationActivitySharedPtr createActivity() const; +}; + +} // namespace internal +} // namespace presentation + +#endif /* INCLUDED_SLIDESHOW_PROPERTYANIMATIONNODE_HXX */ + |