xref: /aoo41x/main/oox/inc/oox/ppt/timenode.hxx (revision e3508121)
1*e3508121SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*e3508121SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*e3508121SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*e3508121SAndrew Rist  * distributed with this work for additional information
6*e3508121SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*e3508121SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*e3508121SAndrew Rist  * "License"); you may not use this file except in compliance
9*e3508121SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*e3508121SAndrew Rist  *
11*e3508121SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*e3508121SAndrew Rist  *
13*e3508121SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*e3508121SAndrew Rist  * software distributed under the License is distributed on an
15*e3508121SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e3508121SAndrew Rist  * KIND, either express or implied.  See the License for the
17*e3508121SAndrew Rist  * specific language governing permissions and limitations
18*e3508121SAndrew Rist  * under the License.
19*e3508121SAndrew Rist  *
20*e3508121SAndrew Rist  *************************************************************/
21*e3508121SAndrew Rist 
22*e3508121SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #ifndef OOX_DRAWINGML_TIMENODE_HXX
26cdf0e10cSrcweir #define OOX_DRAWINGML_TIMENODE_HXX
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
29cdf0e10cSrcweir #include <vector>
30cdf0e10cSrcweir #include <list>
31cdf0e10cSrcweir #include <rtl/ustring.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
34cdf0e10cSrcweir #include <com/sun/star/animations/XAnimationNode.hpp>
35cdf0e10cSrcweir #include "oox/helper/propertymap.hxx"
36cdf0e10cSrcweir #include "oox/ppt/slidetransition.hxx"
37cdf0e10cSrcweir #include "oox/ppt/slidepersist.hxx"
38cdf0e10cSrcweir #include "oox/ppt/animationspersist.hxx"
39cdf0e10cSrcweir #include "oox/ppt/timenode.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir namespace oox { namespace ppt {
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 	class TimeNode;
44cdf0e10cSrcweir 	class SlideTransition;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir 	typedef boost::shared_ptr< TimeNode > TimeNodePtr;
47cdf0e10cSrcweir 	typedef ::std::list< TimeNodePtr > TimeNodePtrList;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	class TimeNode
50cdf0e10cSrcweir 	{
51cdf0e10cSrcweir 	public:
52cdf0e10cSrcweir         typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any > UserDataMap;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 		TimeNode( sal_Int16 nNodeType );
55cdf0e10cSrcweir 		virtual ~TimeNode();
56cdf0e10cSrcweir 
getNodeProperties()57cdf0e10cSrcweir 		NodePropertyMap & getNodeProperties() { return maNodeProperties; }
getUserData()58cdf0e10cSrcweir         UserDataMap & getUserData() { return maUserData; }
addChild(const TimeNodePtr & pChildPtr)59cdf0e10cSrcweir 		void addChild( const TimeNodePtr & pChildPtr )
60cdf0e10cSrcweir             { maChildren.push_back( pChildPtr ); }
61cdf0e10cSrcweir 
getChildren()62cdf0e10cSrcweir         TimeNodePtrList & getChildren()
63cdf0e10cSrcweir             { return maChildren; }
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 		void setId( sal_Int32 nId );
getId() const66cdf0e10cSrcweir 		const ::rtl::OUString & getId() const { return msId; }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir         void addNode(
69cdf0e10cSrcweir             const ::oox::core::XmlFilterBase& rFilter,
70cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode,
71cdf0e10cSrcweir             const SlidePersistPtr & slide);
72cdf0e10cSrcweir 		// data setters
73cdf0e10cSrcweir 		void setTo( const ::com::sun::star::uno::Any & aTo );
74cdf0e10cSrcweir 		void setFrom( const ::com::sun::star::uno::Any & aFrom );
75cdf0e10cSrcweir 		void setBy( const ::com::sun::star::uno::Any & aBy );
setTransitionFilter(const SlideTransition & aTransition)76cdf0e10cSrcweir 		void setTransitionFilter( const SlideTransition & aTransition)
77cdf0e10cSrcweir 			{ maTransitionFilter = aTransition; }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         void setNode(
80cdf0e10cSrcweir             const ::oox::core::XmlFilterBase& rFilter,
81cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode,
82cdf0e10cSrcweir             const SlidePersistPtr & pSlide );
83cdf0e10cSrcweir 
getTarget()84cdf0e10cSrcweir 		AnimTargetElementPtr getTarget()
85cdf0e10cSrcweir 			{
86cdf0e10cSrcweir 				if( !mpTarget )
87cdf0e10cSrcweir 					mpTarget.reset( new AnimTargetElement );
88cdf0e10cSrcweir 				return mpTarget;
89cdf0e10cSrcweir 			}
90cdf0e10cSrcweir 
getStartCondition()91cdf0e10cSrcweir 		AnimationConditionList &getStartCondition()
92cdf0e10cSrcweir 			{ return maStCondList; }
getEndCondition()93cdf0e10cSrcweir 		AnimationConditionList &getEndCondition()
94cdf0e10cSrcweir 			{ return maEndCondList; }
getNextCondition()95cdf0e10cSrcweir 		AnimationConditionList &getNextCondition()
96cdf0e10cSrcweir 			{ return maNextCondList; }
getPrevCondition()97cdf0e10cSrcweir 		AnimationConditionList &getPrevCondition()
98cdf0e10cSrcweir 			{ return maPrevCondList; }
getEndSyncValue()99cdf0e10cSrcweir 		AnimationCondition & getEndSyncValue()
100cdf0e10cSrcweir 			{ mbHasEndSyncValue = true; return maEndSyncValue; }
101cdf0e10cSrcweir 	protected:
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 		static rtl::OUString getServiceName( sal_Int16 nNodeType );
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >
106cdf0e10cSrcweir         createAndInsert(
107cdf0e10cSrcweir             const ::oox::core::XmlFilterBase& rFilter,
108cdf0e10cSrcweir             const rtl::OUString& rServiceName,
109cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& rxNode );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	private:
112cdf0e10cSrcweir 		const sal_Int16 mnNodeType;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir         TimeNodePtrList maChildren;
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 		rtl::OUString	msId;
117cdf0e10cSrcweir 		NodePropertyMap	           maNodeProperties;
118cdf0e10cSrcweir         UserDataMap                maUserData; // a sequence to be stored as "UserData" property
119cdf0e10cSrcweir 		SlideTransition            maTransitionFilter;
120cdf0e10cSrcweir 		AnimTargetElementPtr       mpTarget;
121cdf0e10cSrcweir 		bool                       mbHasEndSyncValue; // set to true if we try to get the endSync.
122cdf0e10cSrcweir 		AnimationCondition         maEndSyncValue;
123cdf0e10cSrcweir 	    AnimationConditionList     maStCondList, maEndCondList;
124cdf0e10cSrcweir 		AnimationConditionList     maPrevCondList, maNextCondList;
125cdf0e10cSrcweir 	};
126cdf0e10cSrcweir 
127cdf0e10cSrcweir } }
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 
130cdf0e10cSrcweir #endif
131