1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef OOX_PPT_ANIMATIONPERSIST
26 #define OOX_PPT_ANIMATIONPERSIST
27 
28 #include <list>
29 #include <boost/shared_ptr.hpp>
30 #include <boost/array.hpp>
31 
32 #include <rtl/ustring.hxx>
33 
34 #include <com/sun/star/uno/Any.hxx>
35 #include <com/sun/star/drawing/XShape.hpp>
36 
37 #include "oox/drawingml/drawingmltypes.hxx"
38 #include "oox/ppt/slidepersist.hxx"
39 
40 namespace oox { namespace ppt {
41 
42 	enum {
43 		NP_TO = 0,
44 		NP_FROM, NP_BY, NP_USERDATA, NP_ATTRIBUTENAME,
45 		NP_ACCELERATION, NP_AUTOREVERSE, NP_DECELERATE, NP_DURATION, NP_FILL,
46 		NP_REPEATCOUNT, NP_REPEATDURATION, NP_RESTART,
47 		NP_DIRECTION, NP_COLORINTERPOLATION, NP_CALCMODE, NP_TRANSFORMTYPE,
48 		NP_PATH,
49 		NP_ENDSYNC, NP_ITERATETYPE, NP_ITERATEINTERVAL,
50 		NP_SUBITEM, NP_TARGET, NP_COMMAND, NP_PARAMETER,
51 		NP_VALUES, NP_FORMULA, NP_KEYTIMES, NP_DISPLAY,
52 		_NP_SIZE
53 	};
54 
55 	typedef boost::array< ::com::sun::star::uno::Any, _NP_SIZE > NodePropertyMap;
56 
57 
58 	/** data for CT_TLShapeTargetElement */
59 	struct ShapeTargetElement
60 	{
ShapeTargetElementoox::ppt::ShapeTargetElement61 		ShapeTargetElement()
62 			: mnType( 0 )
63 			{}
64 		void convert( ::com::sun::star::uno::Any & aAny, sal_Int16 & rSubType ) const;
65 
66 		sal_Int32               mnType;
67 		sal_Int32               mnRangeType;
68 		drawingml::IndexRange   maRange;
69 		::rtl::OUString msSubShapeId;
70 	};
71 
72 
73 	/** data for CT_TLTimeTargetElement */
74 	struct AnimTargetElement
75 	{
AnimTargetElementoox::ppt::AnimTargetElement76 		AnimTargetElement()
77 			: mnType( 0 )
78 			{}
79 		/** convert to a set of properties */
80 		::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide, sal_Int16 & nSubType) const;
81 
82 		sal_Int32                  mnType;
83 		::rtl::OUString            msValue;
84 
85 	  ShapeTargetElement         maShapeTarget;
86 	};
87 
88 	typedef boost::shared_ptr< AnimTargetElement > AnimTargetElementPtr;
89 
90     struct AnimationCondition;
91 
92 	typedef ::std::list< AnimationCondition > AnimationConditionList;
93 
94 	/** data for CT_TLTimeCondition */
95 	struct AnimationCondition
96 	{
AnimationConditionoox::ppt::AnimationCondition97 		AnimationCondition()
98 			: mnType( 0 )
99 			{}
100 
101 		::com::sun::star::uno::Any convert(const SlidePersistPtr & pSlide) const;
102 		static ::com::sun::star::uno::Any convertList(const SlidePersistPtr & pSlide, const AnimationConditionList & l);
103 
getTargetoox::ppt::AnimationCondition104 		AnimTargetElementPtr &     getTarget()
105 			{ if(!mpTarget) mpTarget.reset( new AnimTargetElement ); return mpTarget; }
106 		::com::sun::star::uno::Any maValue;
107 		sal_Int32                  mnType;
108 	private:
109 		AnimTargetElementPtr       mpTarget;
110 	};
111 
112 
113 	struct TimeAnimationValue
114 	{
115 		::rtl::OUString            msFormula;
116 		::rtl::OUString            msTime;
117 		::com::sun::star::uno::Any maValue;
118 	};
119 
120 	typedef ::std::list< TimeAnimationValue > TimeAnimationValueList;
121 
122 } }
123 
124 
125 
126 
127 
128 #endif
129