xref: /trunk/main/sd/inc/TransitionPreset.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SD_TRANSITIONPRESET_HXX
29 #define _SD_TRANSITIONPRESET_HXX
30 
31 #ifndef BOOST_SHARED_PTR_HPP_INCLUDED
32 #include <boost/shared_ptr.hpp>
33 #endif
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 
36 #ifndef _UTL_STLTYPES_HXX_
37 #include <comphelper/stl_types.hxx>
38 #endif
39 
40 #include <list>
41 #include <hash_map>
42 
43 namespace com { namespace sun { namespace star {
44 	namespace animations { class XAnimationNode; }
45 	namespace uno { template<class X> class Reference; }
46 } } }
47 
48 class SdPage;
49 class String;
50 
51 namespace sd {
52 
53 class TransitionPreset;
54 typedef boost::shared_ptr< TransitionPreset > TransitionPresetPtr;
55 typedef std::list< TransitionPresetPtr > TransitionPresetList;
56 typedef std::hash_map< rtl::OUString, rtl::OUString, comphelper::UStringHash, comphelper::UStringEqual > UStringMap;
57 
58 class TransitionPreset
59 {
60 public:
61 	static const TransitionPresetList& getTransitionPresetList();
62 	static bool importTransitionPresetList( TransitionPresetList& rList );
63 
64 	void apply( SdPage* pSlide ) const;
65 
66 	sal_Int16 getTransition() const { return mnTransition; }
67 	sal_Int16 getSubtype() const { return mnSubtype; }
68 	sal_Bool getDirection() const { return mbDirection; }
69 	sal_Int32 getFadeColor() const { return mnFadeColor; }
70 
71 	const rtl::OUString& getUIName() const { return maUIName; }
72 	const rtl::OUString& getPresetId() const { return maPresetId; }
73 
74 private:
75 	TransitionPreset( const ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode >& xNode );
76 
77 	sal_Int16 mnTransition;
78 	sal_Int16 mnSubtype;
79 	sal_Bool mbDirection;
80 	sal_Int32 mnFadeColor;
81 	rtl::OUString maPresetId;
82 	rtl::OUString maUIName;
83 
84 	static sd::TransitionPresetList* mpTransitionPresetList;
85 
86     static bool importTransitionsFile( TransitionPresetList& rList,
87                                        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
88                                        UStringMap& rTransitionNameMape,
89                                        String aFilaname );
90 };
91 
92 }
93 
94 #endif // _SD_TRANSITIONPRESET_HXX
95 
96