Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / inc / doctreenodesupplier.hxx
blobcebf09db4d7d142a425e39f9f201ccaaedbbc740
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODESUPPLIER_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODESUPPLIER_HXX
23 #include "doctreenode.hxx"
26 /* Definition of DocTreeNodeSupplier interface */
28 namespace slideshow
30 namespace internal
32 /** Interface to retrieve DocTreeNodes from subsettable
33 shapes.
35 Shapes which implement the AttributableShape interface
36 also provides this interface, providing methods to
37 retrieve specific DocTreeNode objects from the shape. The
38 methods mainly distinguish various ways on how to specify
39 the actual DocTreeNode to return.
41 If a requested DocTreeNode is not available when one of
42 the methods below is called, an empty DocTreeNode will be
43 returned (the predicate DocTreeNode::isEmpty() will return
44 true). If, on the other hand, the shape cannot determine,
45 for internal reasons, the internal tree node structure,
46 all those methods will throw an
47 ShapeLoadFailedException. This is, in fact, a delayed error
48 that could also have been reported during shape
49 construction, but might be postponed until the missing
50 information is actually requested.
52 class DocTreeNodeSupplier
54 public:
55 /** Query number of tree nodes of the given type this
56 shape contains.
58 The value returned by this method minus one is the
59 maximum value permissible at the getTreeNode()
60 method, for the given node type.
62 @throws ShapeLoadFailedException, if tree node structure
63 cannot be determined.
65 virtual sal_Int32 getNumberOfTreeNodes( DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException;
67 /** Create DocTreeNode from shape.
69 This method creates a DocTreeNode from a shape, a
70 given node type and a running index into the shape's
71 DocTreeNodes of the given type.
73 @param nNodeIndex
74 Starting with 0, every DocTreeNode of the shape that
75 has type eNodeType is indexed. The DocTreeNode whose
76 index equals nNodeIndex will be returned.
78 @param eNodeType
79 Type of the node to return
81 @return the DocTreeNode found, or the empty
82 DocTreeNode, if nothing was found.
84 @throws ShapeLoadFailedException, if tree node structure
85 cannot be determined.
87 virtual DocTreeNode getTreeNode( sal_Int32 nNodeIndex,
88 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException;
90 /** Query number of tree nodes of the given type this
91 subset contains.
93 The value returned by this method minus one is the
94 maximum value permissible at the
95 getSubsetTreeNode() method, for the given node
96 type.
98 @param rParentNode
99 The parent node, below which the number of tree nodes
100 of the given type shall be counted.
102 @param eNodeType
103 Node type to count.
105 @throws ShapeLoadFailedException, if tree node structure
106 cannot be determined.
108 virtual sal_Int32 getNumberOfSubsetTreeNodes( const DocTreeNode& rParentNode,
109 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException;
111 /** Create DocTreeNode from shape subset.
113 This method creates a DocTreeNode from a shape, a
114 parent tree node, a given node type and a running
115 index into the shape's DocTreeNodes of the given type.
117 @param rParentNode
118 Parent node, below which the tree node with the given
119 type shall be selected.
121 @param nNodeIndex
122 Starting with 0, every DocTreeNode of the shape that
123 has type eNodeType is indexed. The DocTreeNode whose
124 index equals nNodeIndex will be returned.
126 @param eNodeType
127 Type of the node to return
129 @return the DocTreeNode found, or the empty
130 DocTreeNode, if nothing was found.
132 @throws ShapeLoadFailedException, if tree node structure
133 cannot be determined.
135 virtual DocTreeNode getSubsetTreeNode( const DocTreeNode& rParentNode,
136 sal_Int32 nNodeIndex,
137 DocTreeNode::NodeType eNodeType ) const = 0; // throw ShapeLoadFailedException;
139 protected:
140 ~DocTreeNodeSupplier() {}
146 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_DOCTREENODESUPPLIER_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */