1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SD_TRANSITIONPRESET_HXX 25cdf0e10cSrcweir #define _SD_TRANSITIONPRESET_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef BOOST_SHARED_PTR_HPP_INCLUDED 28cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #ifndef _UTL_STLTYPES_HXX_ 33cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include <list> 37cdf0e10cSrcweir #include <hash_map> 38cdf0e10cSrcweir 39cdf0e10cSrcweir namespace com { namespace sun { namespace star { 40cdf0e10cSrcweir namespace animations { class XAnimationNode; } 41cdf0e10cSrcweir namespace uno { template<class X> class Reference; } 42cdf0e10cSrcweir } } } 43cdf0e10cSrcweir 44cdf0e10cSrcweir class SdPage; 45cdf0e10cSrcweir class String; 46cdf0e10cSrcweir 47cdf0e10cSrcweir namespace sd { 48cdf0e10cSrcweir 49cdf0e10cSrcweir class TransitionPreset; 50cdf0e10cSrcweir typedef boost::shared_ptr< TransitionPreset > TransitionPresetPtr; 51cdf0e10cSrcweir typedef std::list< TransitionPresetPtr > TransitionPresetList; 52cdf0e10cSrcweir typedef std::hash_map< rtl::OUString, rtl::OUString, comphelper::UStringHash, comphelper::UStringEqual > UStringMap; 53cdf0e10cSrcweir 54cdf0e10cSrcweir class TransitionPreset 55cdf0e10cSrcweir { 56cdf0e10cSrcweir public: 57cdf0e10cSrcweir static const TransitionPresetList& getTransitionPresetList(); 58cdf0e10cSrcweir static bool importTransitionPresetList( TransitionPresetList& rList ); 59cdf0e10cSrcweir 60cdf0e10cSrcweir void apply( SdPage* pSlide ) const; 61cdf0e10cSrcweir getTransition() const62cdf0e10cSrcweir sal_Int16 getTransition() const { return mnTransition; } getSubtype() const63cdf0e10cSrcweir sal_Int16 getSubtype() const { return mnSubtype; } getDirection() const64cdf0e10cSrcweir sal_Bool getDirection() const { return mbDirection; } getFadeColor() const65cdf0e10cSrcweir sal_Int32 getFadeColor() const { return mnFadeColor; } 66cdf0e10cSrcweir getUIName() const67cdf0e10cSrcweir const rtl::OUString& getUIName() const { return maUIName; } getPresetId() const68cdf0e10cSrcweir const rtl::OUString& getPresetId() const { return maPresetId; } 69cdf0e10cSrcweir 70cdf0e10cSrcweir private: 71cdf0e10cSrcweir TransitionPreset( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode ); 72cdf0e10cSrcweir 73cdf0e10cSrcweir sal_Int16 mnTransition; 74cdf0e10cSrcweir sal_Int16 mnSubtype; 75cdf0e10cSrcweir sal_Bool mbDirection; 76cdf0e10cSrcweir sal_Int32 mnFadeColor; 77cdf0e10cSrcweir rtl::OUString maPresetId; 78cdf0e10cSrcweir rtl::OUString maUIName; 79cdf0e10cSrcweir 80cdf0e10cSrcweir static sd::TransitionPresetList* mpTransitionPresetList; 81cdf0e10cSrcweir 82cdf0e10cSrcweir static bool importTransitionsFile( TransitionPresetList& rList, 83cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 84cdf0e10cSrcweir UStringMap& rTransitionNameMape, 85cdf0e10cSrcweir String aFilaname ); 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir } 89cdf0e10cSrcweir 90cdf0e10cSrcweir #endif // _SD_TRANSITIONPRESET_HXX 91cdf0e10cSrcweir 92