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 INCLUDED_SLIDESHOW_NODETOOLS_HXX
25 #define INCLUDED_SLIDESHOW_NODETOOLS_HXX
26 
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/beans/NamedValue.hpp>
29 #include <com/sun/star/drawing/XShape.hpp>
30 
31 #include "shapemanager.hxx"
32 #include "basenode.hxx"
33 #include "doctreenode.hxx"
34 #include "attributableshape.hxx"
35 
36 
37 #if defined(VERBOSE) && defined(DBG_UTIL)
38 # define DEBUG_NODES_SHOWTREE(a) debugNodesShowTree(a);
39 # define DEBUG_NODES_SHOWTREE_WITHIN(a) debugNodesShowTreeWithin(a);
40 #else
41 # define DEBUG_NODES_SHOWTREE(a)
42 # define DEBUG_NODES_SHOWTREE_WITHIN(a)
43 #endif
44 
45 namespace slideshow
46 {
47     namespace internal
48     {
49 
50         // Tools
51         //=========================================================================
52 
53 #if defined(VERBOSE) && defined(DBG_UTIL)
54         int& debugGetCurrentOffset();
55         void debugNodesShowTree( const BaseNode* );
56         void debugNodesShowTreeWithin( const BaseNode* );
57 #endif
58 
59         /** Look up an AttributableShape from ShapeManager.
60 
61         	This method retrieves an AttributableShape pointer, given
62         	an XShape and a LayerManager.
63 
64             Throws a runtime exception if there's no such shape, or if
65             it does not implement the AttributableShape interface.
66          */
67         AttributableShapeSharedPtr lookupAttributableShape( const ShapeManagerSharedPtr& 				rShapeManager,
68                                                             const ::com::sun::star::uno::Reference<
69                                                             	::com::sun::star::drawing::XShape >& 	xShape 			);
70 
71         /** Predicate whether a Begin, Duration or End timing is
72             indefinite, i.e. either contains no value, or the
73             value Timing_INDEFINITE.
74         */
75         bool isIndefiniteTiming( const ::com::sun::star::uno::Any& rAny );
76 
77         /// Extract the node type from the user data
78         bool getNodeType( sal_Int16& 								 o_rNodeType,
79                           const ::com::sun::star::uno::Sequence<
80 	                          ::com::sun::star::beans::NamedValue >& rValues );
81     }
82 }
83 
84 #endif /* INCLUDED_SLIDESHOW_NODETOOLS_HXX */
85