xref: /AOO41X/main/slideshow/source/inc/tools.hxx (revision aaef562f9b4401da6d8a910634bb68eaaacb4ebd)
1*aaef562fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*aaef562fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*aaef562fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*aaef562fSAndrew Rist  * distributed with this work for additional information
6*aaef562fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*aaef562fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*aaef562fSAndrew Rist  * "License"); you may not use this file except in compliance
9*aaef562fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*aaef562fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*aaef562fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*aaef562fSAndrew Rist  * software distributed under the License is distributed on an
15*aaef562fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*aaef562fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*aaef562fSAndrew Rist  * specific language governing permissions and limitations
18*aaef562fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*aaef562fSAndrew Rist  *************************************************************/
21*aaef562fSAndrew Rist 
22*aaef562fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_SLIDESHOW_TOOLS_HXX
25cdf0e10cSrcweir #define INCLUDED_SLIDESHOW_TOOLS_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <cppcanvas/color.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "shapeattributelayer.hxx"
33cdf0e10cSrcweir #include "shape.hxx"
34cdf0e10cSrcweir #include "rgbcolor.hxx"
35cdf0e10cSrcweir #include "hslcolor.hxx"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
38cdf0e10cSrcweir #include <boost/current_function.hpp>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <functional>
41cdf0e10cSrcweir #include <cstdlib>
42cdf0e10cSrcweir #include <string.h> // for strcmp
43cdf0e10cSrcweir #include <algorithm>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 
49cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace beans {
50cdf0e10cSrcweir     struct NamedValue;
51cdf0e10cSrcweir } } } }
52cdf0e10cSrcweir namespace basegfx
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     class B2DRange;
55cdf0e10cSrcweir     class B2DVector;
56cdf0e10cSrcweir     class B2IVector;
57cdf0e10cSrcweir     class B2DHomMatrix;
58cdf0e10cSrcweir }
59cdf0e10cSrcweir namespace cppcanvas{ class Canvas; }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir class GDIMetaFile;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir /* Definition of some animation tools */
64cdf0e10cSrcweir namespace slideshow
65cdf0e10cSrcweir {
66cdf0e10cSrcweir     namespace internal
67cdf0e10cSrcweir     {
68cdf0e10cSrcweir         class UnoView;
69cdf0e10cSrcweir         class Shape;
70cdf0e10cSrcweir         class ShapeAttributeLayer;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir         typedef ::boost::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir         // xxx todo: remove with boost::hash when 1.33 is available
75cdf0e10cSrcweir         template <typename T>
76cdf0e10cSrcweir         struct hash : ::std::unary_function<T, ::std::size_t>
77cdf0e10cSrcweir         {
78cdf0e10cSrcweir             ::std::size_t operator()( T const& val ) const {
79cdf0e10cSrcweir                 return hash_value(val);
80cdf0e10cSrcweir             }
81cdf0e10cSrcweir         };
82cdf0e10cSrcweir         template <typename T>
83cdf0e10cSrcweir         inline ::std::size_t hash_value( T * const& p )
84cdf0e10cSrcweir         {
85cdf0e10cSrcweir             ::std::size_t d = static_cast< ::std::size_t >(
86cdf0e10cSrcweir                 reinterpret_cast< ::std::ptrdiff_t >(p) );
87cdf0e10cSrcweir             return d + (d >> 3);
88cdf0e10cSrcweir         }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir         // xxx todo: shift to namespace com::sun::star::uno when
91cdf0e10cSrcweir         //           1.33 is available
92cdf0e10cSrcweir         template <typename T>
93cdf0e10cSrcweir         inline ::std::size_t hash_value(
94cdf0e10cSrcweir             ::com::sun::star::uno::Reference<T> const& x )
95cdf0e10cSrcweir         {
96cdf0e10cSrcweir             // normalize to object root, because _only_ XInterface is defined
97cdf0e10cSrcweir             // to be stable during object lifetime:
98cdf0e10cSrcweir             ::com::sun::star::uno::Reference<
99cdf0e10cSrcweir                   ::com::sun::star::uno::XInterface> const xRoot(
100cdf0e10cSrcweir                       x, ::com::sun::star::uno::UNO_QUERY );
101cdf0e10cSrcweir             return hash<void *>()(xRoot.get());
102cdf0e10cSrcweir         }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         /** Cycle mode of intrinsic animations
105cdf0e10cSrcweir          */
106cdf0e10cSrcweir         enum CycleMode
107cdf0e10cSrcweir         {
108cdf0e10cSrcweir             /// loop the animation back to back
109cdf0e10cSrcweir             CYCLE_LOOP,
110cdf0e10cSrcweir             /// loop, but play backwards from end to start
111cdf0e10cSrcweir             CYCLE_PINGPONGLOOP
112cdf0e10cSrcweir         };
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         // Value extraction from Any
116cdf0e10cSrcweir         // =========================
117cdf0e10cSrcweir 
118cdf0e10cSrcweir         /// extract unary double value from Any
119cdf0e10cSrcweir 		bool extractValue( double&								o_rValue,
120cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
121cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
122cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
123cdf0e10cSrcweir 
124cdf0e10cSrcweir         /// extract int from Any
125cdf0e10cSrcweir         bool extractValue( sal_Int32&							o_rValue,
126cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
127cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
128cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
129cdf0e10cSrcweir 
130cdf0e10cSrcweir         /// extract enum/constant group value from Any
131cdf0e10cSrcweir         bool extractValue( sal_Int16&							o_rValue,
132cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
133cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
134cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
135cdf0e10cSrcweir 
136cdf0e10cSrcweir         /// extract color value from Any
137cdf0e10cSrcweir         bool extractValue( RGBColor&							o_rValue,
138cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
139cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
140cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
141cdf0e10cSrcweir 
142cdf0e10cSrcweir         /// extract color value from Any
143cdf0e10cSrcweir         bool extractValue( HSLColor&							o_rValue,
144cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
145cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
146cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir         /// extract plain string from Any
149cdf0e10cSrcweir         bool extractValue( ::rtl::OUString&						o_rValue,
150cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
151cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
152cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
153cdf0e10cSrcweir 
154cdf0e10cSrcweir         /// extract bool value from Any
155cdf0e10cSrcweir         bool extractValue( bool&								o_rValue,
156cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
157cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
158cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
159cdf0e10cSrcweir 
160cdf0e10cSrcweir         /// extract double 2-tuple from Any
161cdf0e10cSrcweir         bool extractValue( basegfx::B2DTuple&					o_rPair,
162cdf0e10cSrcweir                            const ::com::sun::star::uno::Any& 	rSourceAny,
163cdf0e10cSrcweir                            const boost::shared_ptr<Shape>&		rShape,
164cdf0e10cSrcweir                            const basegfx::B2DVector&			rSlideBounds );
165cdf0e10cSrcweir 
166cdf0e10cSrcweir         /** Search a sequence of NamedValues for a given element.
167cdf0e10cSrcweir 
168cdf0e10cSrcweir         	@return true, if the sequence contains the specified
169cdf0e10cSrcweir         	element.
170cdf0e10cSrcweir          */
171cdf0e10cSrcweir         bool findNamedValue( ::com::sun::star::uno::Sequence<
172cdf0e10cSrcweir                              	::com::sun::star::beans::NamedValue > const& rSequence,
173cdf0e10cSrcweir                              const ::com::sun::star::beans::NamedValue&	rSearchKey );
174cdf0e10cSrcweir 
175cdf0e10cSrcweir         /** Search a sequence of NamedValues for an element with a given name.
176cdf0e10cSrcweir 
177cdf0e10cSrcweir         	@param o_pRet
178cdf0e10cSrcweir             If non-NULL, receives the full NamedValue found (if it was
179cdf0e10cSrcweir             found, that is).
180cdf0e10cSrcweir 
181cdf0e10cSrcweir         	@return true, if the sequence contains the specified
182cdf0e10cSrcweir         	element.
183cdf0e10cSrcweir          */
184cdf0e10cSrcweir         bool findNamedValue( ::com::sun::star::beans::NamedValue* 		o_pRet,
185cdf0e10cSrcweir                              const ::com::sun::star::uno::Sequence<
186cdf0e10cSrcweir                              	::com::sun::star::beans::NamedValue >& 	rSequence,
187cdf0e10cSrcweir                              const ::rtl::OUString&						rSearchString );
188cdf0e10cSrcweir 
189cdf0e10cSrcweir         basegfx::B2DRange calcRelativeShapeBounds( const basegfx::B2DVector& rPageSize,
190cdf0e10cSrcweir                                                    const basegfx::B2DRange&  rShapeBounds );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir         /** Get the shape transformation from the attribute set
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 	        @param rBounds
195cdf0e10cSrcweir             Original shape bound rect (to substitute default attribute
196cdf0e10cSrcweir             layer values)
197cdf0e10cSrcweir 
198cdf0e10cSrcweir             @param pAttr
199cdf0e10cSrcweir             Attribute set. Might be NULL (then, rBounds is used to set
200cdf0e10cSrcweir             a simple scale and translate of the unit rect to rBounds).
201cdf0e10cSrcweir         */
202cdf0e10cSrcweir         basegfx::B2DHomMatrix getShapeTransformation(
203cdf0e10cSrcweir             const basegfx::B2DRange&                      rBounds,
204cdf0e10cSrcweir             const boost::shared_ptr<ShapeAttributeLayer>& pAttr );
205cdf0e10cSrcweir 
206cdf0e10cSrcweir         /** Get a shape's sprite transformation from the attribute set
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	        @param rPixelSize
209cdf0e10cSrcweir             Pixel size of the sprite
210cdf0e10cSrcweir 
211cdf0e10cSrcweir             @param rOrigSize
212cdf0e10cSrcweir             Original shape size (i.e. the size of the actual sprite
213cdf0e10cSrcweir             content, in the user coordinate system)
214cdf0e10cSrcweir 
215cdf0e10cSrcweir             @param pAttr
216cdf0e10cSrcweir             Attribute set. Might be NULL (then, rBounds is used to set
217cdf0e10cSrcweir             a simple scale and translate of the unit rect to rBounds).
218cdf0e10cSrcweir 
219cdf0e10cSrcweir             @return the transformation to be applied to the sprite.
220cdf0e10cSrcweir         */
221cdf0e10cSrcweir         basegfx::B2DHomMatrix getSpriteTransformation(
222cdf0e10cSrcweir             const basegfx::B2DVector&                     rPixelSize,
223cdf0e10cSrcweir             const basegfx::B2DVector&                     rOrigSize,
224cdf0e10cSrcweir             const boost::shared_ptr<ShapeAttributeLayer>& pAttr );
225cdf0e10cSrcweir 
226cdf0e10cSrcweir         /** Calc update area for a shape.
227cdf0e10cSrcweir 
228cdf0e10cSrcweir         	This method calculates the 'covered' area for the shape,
229cdf0e10cSrcweir         	i.e. the rectangle that is affected when rendering the
230cdf0e10cSrcweir         	shape. Apart from applying the given transformation to the
231cdf0e10cSrcweir         	shape rectangle, this method also takes attributes into
232cdf0e10cSrcweir         	account, which further scale the output (e.g. character
233cdf0e10cSrcweir         	sizes).
234cdf0e10cSrcweir 
235cdf0e10cSrcweir             @param rUnitBounds
236cdf0e10cSrcweir             Shape bounds, in the unit rect coordinate space
237cdf0e10cSrcweir 
238cdf0e10cSrcweir             @param rShapeTransform
239cdf0e10cSrcweir             Transformation matrix the shape should undergo.
240cdf0e10cSrcweir 
241cdf0e10cSrcweir             @param pAttr
242cdf0e10cSrcweir             Current shape attributes
243cdf0e10cSrcweir          */
244cdf0e10cSrcweir         basegfx::B2DRange getShapeUpdateArea(
245cdf0e10cSrcweir             const basegfx::B2DRange&                      rUnitBounds,
246cdf0e10cSrcweir             const basegfx::B2DHomMatrix&                  rShapeTransform,
247cdf0e10cSrcweir             const boost::shared_ptr<ShapeAttributeLayer>& pAttr );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir         /** Calc update area for a shape.
250cdf0e10cSrcweir 
251cdf0e10cSrcweir         	This method calculates the 'covered' area for the shape,
252cdf0e10cSrcweir         	i.e. the rectangle that is affected when rendering the
253cdf0e10cSrcweir         	shape. The difference from the other getShapeUpdateArea()
254cdf0e10cSrcweir         	method is the fact that this one works without
255cdf0e10cSrcweir         	ShapeAttributeLayer, and only scales up the given shape
256cdf0e10cSrcweir         	user coordinate bound rect. The method is typically used
257cdf0e10cSrcweir         	to retrieve user coordinate system bound rects for shapes
258cdf0e10cSrcweir         	which are smaller than the default unit bound rect
259cdf0e10cSrcweir         	(because e.g. of subsetting)
260cdf0e10cSrcweir 
261cdf0e10cSrcweir             @param rUnitBounds
262cdf0e10cSrcweir             Shape bounds, in the unit rect coordinate space
263cdf0e10cSrcweir 
264cdf0e10cSrcweir             @param rShapeBounds
265cdf0e10cSrcweir             Current shape bounding box in user coordinate space.
266cdf0e10cSrcweir          */
267cdf0e10cSrcweir         basegfx::B2DRange getShapeUpdateArea( const basegfx::B2DRange& rUnitBounds,
268cdf0e10cSrcweir                                               const basegfx::B2DRange& rShapeBounds );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir         /** Calc output position and size of shape, according to given
271cdf0e10cSrcweir             attribute layer.
272cdf0e10cSrcweir 
273cdf0e10cSrcweir             Rotations, shears etc. and not taken into account,
274cdf0e10cSrcweir             i.e. the returned rectangle is NOT the bounding box. Use
275cdf0e10cSrcweir             it as if aBounds.getMinimum() is the output position and
276cdf0e10cSrcweir             aBounds.getRange() the scaling of the shape.
277cdf0e10cSrcweir          */
278cdf0e10cSrcweir         basegfx::B2DRange getShapePosSize(
279cdf0e10cSrcweir             const basegfx::B2DRange&                      rOrigBounds,
280cdf0e10cSrcweir             const boost::shared_ptr<ShapeAttributeLayer>& pAttr );
281cdf0e10cSrcweir 
282cdf0e10cSrcweir         /** Convert a plain UNO API 32 bit int to RGBColor
283cdf0e10cSrcweir          */
284cdf0e10cSrcweir         RGBColor unoColor2RGBColor( sal_Int32 );
285cdf0e10cSrcweir         /** Convert an IntSRGBA to plain UNO API 32 bit int
286cdf0e10cSrcweir          */
287cdf0e10cSrcweir         sal_Int32 RGBAColor2UnoColor( cppcanvas::Color::IntSRGBA );
288cdf0e10cSrcweir 
289cdf0e10cSrcweir         /** Fill a plain rectangle on the given canvas with the given color
290cdf0e10cSrcweir          */
291cdf0e10cSrcweir         void fillRect( const boost::shared_ptr< cppcanvas::Canvas >& rCanvas,
292cdf0e10cSrcweir                        const basegfx::B2DRange&                      rRect,
293cdf0e10cSrcweir                        cppcanvas::Color::IntSRGBA                    aFillColor );
294cdf0e10cSrcweir 
295cdf0e10cSrcweir         /** Init canvas with default background (white)
296cdf0e10cSrcweir          */
297cdf0e10cSrcweir         void initSlideBackground( const boost::shared_ptr< cppcanvas::Canvas >& rCanvas,
298cdf0e10cSrcweir                                   const basegfx::B2IVector&                     rSize );
299cdf0e10cSrcweir 
300cdf0e10cSrcweir         /// Gets a random ordinal [0,n)
301cdf0e10cSrcweir         inline ::std::size_t getRandomOrdinal( const ::std::size_t n )
302cdf0e10cSrcweir         {
303cdf0e10cSrcweir             return static_cast< ::std::size_t >(
304cdf0e10cSrcweir                 double(n) * rand() / (RAND_MAX + 1.0) );
305cdf0e10cSrcweir         }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir         /// To work around ternary operator in initializer lists
308cdf0e10cSrcweir         /// (Solaris compiler problems)
309cdf0e10cSrcweir         template <typename T>
310cdf0e10cSrcweir         inline T const & ternary_op(
311cdf0e10cSrcweir             const bool cond, T const & arg1, T const & arg2 )
312cdf0e10cSrcweir         {
313cdf0e10cSrcweir             if (cond)
314cdf0e10cSrcweir                 return arg1;
315cdf0e10cSrcweir             else
316cdf0e10cSrcweir                 return arg2;
317cdf0e10cSrcweir         }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir         template <typename ValueType>
320cdf0e10cSrcweir         inline bool getPropertyValue(
321cdf0e10cSrcweir             ValueType & rValue,
322cdf0e10cSrcweir             com::sun::star::uno::Reference<
323cdf0e10cSrcweir             com::sun::star::beans::XPropertySet> const & xPropSet,
324cdf0e10cSrcweir             rtl::OUString const & propName )
325cdf0e10cSrcweir         {
326cdf0e10cSrcweir             try {
327cdf0e10cSrcweir                 const com::sun::star::uno::Any& a(
328cdf0e10cSrcweir                     xPropSet->getPropertyValue( propName ) );
329cdf0e10cSrcweir                 bool const bRet = (a >>= rValue);
330cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 0
331cdf0e10cSrcweir                 if( !bRet )
332cdf0e10cSrcweir                     OSL_TRACE( "%s: while retrieving property %s, cannot extract Any of type %s\n",
333cdf0e10cSrcweir                                ::rtl::OUStringToOString( propName,
334cdf0e10cSrcweir                                                          RTL_TEXTENCODING_ASCII_US ).getStr(),
335cdf0e10cSrcweir                                BOOST_CURRENT_FUNCTION,
336cdf0e10cSrcweir                                ::rtl::OUStringToOString( a.getValueTypeRef()->pTypeName,
337cdf0e10cSrcweir                                                          RTL_TEXTENCODING_ASCII_US ).getStr() );
338cdf0e10cSrcweir #endif
339cdf0e10cSrcweir                 return bRet;
340cdf0e10cSrcweir             }
341cdf0e10cSrcweir             catch (com::sun::star::uno::RuntimeException &)
342cdf0e10cSrcweir             {
343cdf0e10cSrcweir                 throw;
344cdf0e10cSrcweir             }
345cdf0e10cSrcweir             catch (com::sun::star::uno::Exception &)
346cdf0e10cSrcweir             {
347cdf0e10cSrcweir                 return false;
348cdf0e10cSrcweir             }
349cdf0e10cSrcweir         }
350cdf0e10cSrcweir 
351cdf0e10cSrcweir         template <typename ValueType>
352cdf0e10cSrcweir         inline bool getPropertyValue(
353cdf0e10cSrcweir             com::sun::star::uno::Reference< ValueType >& rIfc,
354cdf0e10cSrcweir             com::sun::star::uno::Reference<
355cdf0e10cSrcweir             com::sun::star::beans::XPropertySet> const & xPropSet,
356cdf0e10cSrcweir             rtl::OUString const & propName )
357cdf0e10cSrcweir         {
358cdf0e10cSrcweir             try
359cdf0e10cSrcweir             {
360cdf0e10cSrcweir                 const com::sun::star::uno::Any& a(
361cdf0e10cSrcweir                     xPropSet->getPropertyValue( propName ));
362cdf0e10cSrcweir                 rIfc.set( a,
363cdf0e10cSrcweir                           com::sun::star::uno::UNO_QUERY );
364cdf0e10cSrcweir 
365cdf0e10cSrcweir                 bool const bRet = rIfc.is();
366cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 0
367cdf0e10cSrcweir                 if( !bRet )
368cdf0e10cSrcweir                     OSL_TRACE( "%s: while retrieving property %s, cannot extract Any of type %s to interface\n",
369cdf0e10cSrcweir                                ::rtl::OUStringToOString( propName,
370cdf0e10cSrcweir                                                          RTL_TEXTENCODING_ASCII_US ).getStr(),
371cdf0e10cSrcweir                                BOOST_CURRENT_FUNCTION,
372cdf0e10cSrcweir                                ::rtl::OUStringToOString( a.getValueTypeRef()->pTypeName,
373cdf0e10cSrcweir                                                          RTL_TEXTENCODING_ASCII_US ).getStr() );
374cdf0e10cSrcweir #endif
375cdf0e10cSrcweir                 return bRet;
376cdf0e10cSrcweir             }
377cdf0e10cSrcweir             catch (com::sun::star::uno::RuntimeException &)
378cdf0e10cSrcweir             {
379cdf0e10cSrcweir                 throw;
380cdf0e10cSrcweir             }
381cdf0e10cSrcweir             catch (com::sun::star::uno::Exception &)
382cdf0e10cSrcweir             {
383cdf0e10cSrcweir                 return false;
384cdf0e10cSrcweir             }
385cdf0e10cSrcweir         }
386cdf0e10cSrcweir 
387cdf0e10cSrcweir         /// Get the content of the BoundRect shape property
388cdf0e10cSrcweir         basegfx::B2DRange getAPIShapeBounds( const ::com::sun::star::uno::Reference<
389cdf0e10cSrcweir                                                 ::com::sun::star::drawing::XShape >& xShape );
390cdf0e10cSrcweir 
391cdf0e10cSrcweir         /// Get the content of the ZOrder shape property
392cdf0e10cSrcweir         double getAPIShapePrio( const ::com::sun::star::uno::Reference<
393cdf0e10cSrcweir                                       ::com::sun::star::drawing::XShape >& xShape );
394cdf0e10cSrcweir 
395cdf0e10cSrcweir         basegfx::B2IVector getSlideSizePixel( const basegfx::B2DVector&         rSize,
396cdf0e10cSrcweir                                               const boost::shared_ptr<UnoView>& pView );
397cdf0e10cSrcweir     }
398cdf0e10cSrcweir }
399cdf0e10cSrcweir 
400cdf0e10cSrcweir #endif /* INCLUDED_SLIDESHOW_TOOLS_HXX */
401