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_DOCTREENODESUPPLIER_HXX 25 #define INCLUDED_SLIDESHOW_DOCTREENODESUPPLIER_HXX 26 27 #include "doctreenode.hxx" 28 29 30 /* Definition of DocTreeNodeSupplier interface */ 31 32 namespace slideshow 33 { 34 namespace internal 35 { 36 /** Interface to retrieve DocTreeNodes from subsettable 37 shapes. 38 39 Shapes which implement the AttributableShape interface 40 also provides this interface, providing methods to 41 retrieve specific DocTreeNode objects from the shape. The 42 methods mainly distinguish various ways on how to specify 43 the actual DocTreeNode to return. 44 45 If a requested DocTreeNode is not available when one of 46 the methods below is called, an empty DocTreeNode will be 47 returned (the predicate DocTreeNode::isEmpty() will return 48 true). If, on the other hand, the shape cannot determine, 49 for internal reasons, the internal tree node structure, 50 all those methods will throw an 51 ShapeLoadFailedException. This is, in fact, a delayed error 52 that could also have been reported during shape 53 construction, but might be postponed until the missing 54 information is actually requested. 55 */ 56 class DocTreeNodeSupplier 57 { 58 public: 59 /** Query number of tree nodes of the given type this 60 shape contains. 61 62 The value returned by this method minus one is the 63 maximum value permissible at the getTreeNode() 64 method, for the given node type. 65 66 @throws ShapeLoadFailedException, if tree node structure 67 cannot be determined. 68 */ 69 virtual sal_Int32 getNumberOfTreeNodes( DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException; 70 71 /** Create DocTreeNode from shape. 72 73 This method creates a DocTreeNode from a shape, a 74 given node type and a running index into the shape's 75 DocTreeNodes of the given type. 76 77 @param nNodeIndex 78 Starting with 0, every DocTreeNode of the shape that 79 has type eNodeType is indexed. The DocTreeNode whose 80 index equals nNodeIndex will be returned. 81 82 @param eNodeType 83 Type of the node to return 84 85 @return the DocTreeNode found, or the empty 86 DocTreeNode, if nothing was found. 87 88 @throws ShapeLoadFailedException, if tree node structure 89 cannot be determined. 90 */ 91 virtual DocTreeNode getTreeNode( sal_Int32 nNodeIndex, 92 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException; 93 94 /** Query number of tree nodes of the given type this 95 subset contains. 96 97 The value returned by this method minus one is the 98 maximum value permissible at the 99 getSubsetTreeNode() method, for the given node 100 type. 101 102 @param rParentNode 103 The parent node, below which the number of tree nodes 104 of the given type shall be counted. 105 106 @param eNodeType 107 Node type to count. 108 109 @throws ShapeLoadFailedException, if tree node structure 110 cannot be determined. 111 */ 112 virtual sal_Int32 getNumberOfSubsetTreeNodes( const DocTreeNode& rParentNode, 113 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException; 114 115 /** Create DocTreeNode from shape subset. 116 117 This method creates a DocTreeNode from a shape, a 118 parent tree node, a given node type and a running 119 index into the shape's DocTreeNodes of the given type. 120 121 @param rParentNode 122 Parent node, below which the tree node with the given 123 type shall be selected. 124 125 @param nNodeIndex 126 Starting with 0, every DocTreeNode of the shape that 127 has type eNodeType is indexed. The DocTreeNode whose 128 index equals nNodeIndex will be returned. 129 130 @param eNodeType 131 Type of the node to return 132 133 @return the DocTreeNode found, or the empty 134 DocTreeNode, if nothing was found. 135 136 @throws ShapeLoadFailedException, if tree node structure 137 cannot be determined. 138 */ 139 virtual DocTreeNode getSubsetTreeNode( const DocTreeNode& rParentNode, 140 sal_Int32 nNodeIndex, 141 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException; 142 }; 143 144 } 145 } 146 147 #endif /* INCLUDED_SLIDESHOW_DOCTREENODESUPPLIER_HXX */ 148