1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doctreenodesupplier.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_DOCTREENODESUPPLIER_HXX
32 #define INCLUDED_SLIDESHOW_DOCTREENODESUPPLIER_HXX
34 #include "doctreenode.hxx"
37 /* Definition of DocTreeNodeSupplier interface */
43 /** Interface to retrieve DocTreeNodes from subsettable
46 Shapes which implement the AttributableShape interface
47 also provides this interface, providing methods to
48 retrieve specific DocTreeNode objects from the shape. The
49 methods mainly distinguish various ways on how to specify
50 the actual DocTreeNode to return.
52 If a requested DocTreeNode is not available when one of
53 the methods below is called, an empty DocTreeNode will be
54 returned (the predicate DocTreeNode::isEmpty() will return
55 true). If, on the other hand, the shape cannot determine,
56 for internal reasons, the internal tree node structure,
57 all those methods will throw an
58 ShapeLoadFailedException. This is, in fact, a delayed error
59 that could also have been reported during shape
60 construction, but might be postponed until the missing
61 information is actually requested.
63 class DocTreeNodeSupplier
66 /** Query number of tree nodes of the given type this
69 The value returned by this method minus one is the
70 maximum value permissible at the getTreeNode()
71 method, for the given node type.
73 @throws ShapeLoadFailedException, if tree node structure
76 virtual sal_Int32
getNumberOfTreeNodes( DocTreeNode::NodeType eNodeType
) const = 0; // throw ShapeLoadFailedException;
78 /** Create DocTreeNode from shape.
80 This method creates a DocTreeNode from a shape, a
81 given node type and a running index into the shape's
82 DocTreeNodes of the given type.
85 Starting with 0, every DocTreeNode of the shape that
86 has type eNodeType is indexed. The DocTreeNode whose
87 index equals nNodeIndex will be returned.
90 Type of the node to return
92 @return the DocTreeNode found, or the empty
93 DocTreeNode, if nothing was found.
95 @throws ShapeLoadFailedException, if tree node structure
98 virtual DocTreeNode
getTreeNode( sal_Int32 nNodeIndex
,
99 DocTreeNode::NodeType eNodeType
) const = 0; // throw ShapeLoadFailedException;
101 /** Query number of tree nodes of the given type this
104 The value returned by this method minus one is the
105 maximum value permissible at the
106 getSubsetTreeNode() method, for the given node
110 The parent node, below which the number of tree nodes
111 of the given type shall be counted.
116 @throws ShapeLoadFailedException, if tree node structure
117 cannot be determined.
119 virtual sal_Int32
getNumberOfSubsetTreeNodes( const DocTreeNode
& rParentNode
,
120 DocTreeNode::NodeType eNodeType
) const = 0; // throw ShapeLoadFailedException;
122 /** Create DocTreeNode from shape subset.
124 This method creates a DocTreeNode from a shape, a
125 parent tree node, a given node type and a running
126 index into the shape's DocTreeNodes of the given type.
129 Parent node, below which the tree node with the given
130 type shall be selected.
133 Starting with 0, every DocTreeNode of the shape that
134 has type eNodeType is indexed. The DocTreeNode whose
135 index equals nNodeIndex will be returned.
138 Type of the node to return
140 @return the DocTreeNode found, or the empty
141 DocTreeNode, if nothing was found.
143 @throws ShapeLoadFailedException, if tree node structure
144 cannot be determined.
146 virtual DocTreeNode
getSubsetTreeNode( const DocTreeNode
& rParentNode
,
147 sal_Int32 nNodeIndex
,
148 DocTreeNode::NodeType eNodeType
) const = 0; // throw ShapeLoadFailedException;
154 #endif /* INCLUDED_SLIDESHOW_DOCTREENODESUPPLIER_HXX */