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 #ifndef _SD_TRANSITIONPRESET_HXX 25 #define _SD_TRANSITIONPRESET_HXX 26 27 #ifndef BOOST_SHARED_PTR_HPP_INCLUDED 28 #include <boost/shared_ptr.hpp> 29 #endif 30 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 31 32 #ifndef _UTL_STLTYPES_HXX_ 33 #include <comphelper/stl_types.hxx> 34 #endif 35 36 #include <list> 37 #include <hash_map> 38 39 namespace com { namespace sun { namespace star { 40 namespace animations { class XAnimationNode; } 41 namespace uno { template<class X> class Reference; } 42 } } } 43 44 class SdPage; 45 class String; 46 47 namespace sd { 48 49 class TransitionPreset; 50 typedef boost::shared_ptr< TransitionPreset > TransitionPresetPtr; 51 typedef std::list< TransitionPresetPtr > TransitionPresetList; 52 typedef std::hash_map< rtl::OUString, rtl::OUString, comphelper::UStringHash, comphelper::UStringEqual > UStringMap; 53 54 class TransitionPreset 55 { 56 public: 57 static const TransitionPresetList& getTransitionPresetList(); 58 static bool importTransitionPresetList( TransitionPresetList& rList ); 59 60 void apply( SdPage* pSlide ) const; 61 getTransition() const62 sal_Int16 getTransition() const { return mnTransition; } getSubtype() const63 sal_Int16 getSubtype() const { return mnSubtype; } getDirection() const64 sal_Bool getDirection() const { return mbDirection; } getFadeColor() const65 sal_Int32 getFadeColor() const { return mnFadeColor; } 66 getUIName() const67 const rtl::OUString& getUIName() const { return maUIName; } getPresetId() const68 const rtl::OUString& getPresetId() const { return maPresetId; } 69 70 private: 71 TransitionPreset( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode ); 72 73 sal_Int16 mnTransition; 74 sal_Int16 mnSubtype; 75 sal_Bool mbDirection; 76 sal_Int32 mnFadeColor; 77 rtl::OUString maPresetId; 78 rtl::OUString maUIName; 79 80 static sd::TransitionPresetList* mpTransitionPresetList; 81 82 static bool importTransitionsFile( TransitionPresetList& rList, 83 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, 84 UStringMap& rTransitionNameMape, 85 String aFilaname ); 86 }; 87 88 } 89 90 #endif // _SD_TRANSITIONPRESET_HXX 91 92