1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_accessibility_XAccessibleSelection_idl__
29#define __com_sun_star_accessibility_XAccessibleSelection_idl__
30
31#ifndef __com_sun_star_uno_XInterface_idl__
32#include <com/sun/star/uno/XInterface.idl>
33#endif
34#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
35#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
36#endif
37
38module com { module sun { module star { module accessibility {
39
40 published interface XAccessible;
41
42/** Implement this interface to represent a selection of accessible objects.
43
44    <p>This interface is the standard mechanism to obtain and modify the
45    currently selected children.  Every object that has children that can be
46    selected should support this interface.</p>
47
48    <p>The <type>XAccessibleSelection</type> interface has to be implemented
49    in conjunction with the <type>XAccessibleContext</type> interface that
50    provides the children on which the first operates.</p>
51
52    <p>It depends on the class implementing this interface, whether it
53    supports single or multi selection.</p>
54
55    @since OOo 1.1.2
56*/
57published interface XAccessibleSelection : ::com::sun::star::uno::XInterface
58{
59    /** Selects the specified <type>Accessible</type> child of the
60        object.
61
62        <p>Depending on the implementing class the child is added to the
63        current set a selected children (multi selection) or a previously
64        selected child is deselected first (single selection).</p>
65
66        @param nChildIndex
67            Index of the child which is to add to the selection.  This index
68            referes to all the children of this object.
69        @throws ::com::sun::star::lang::IndexOutOfBoundsException
70            if the given index does not lie in the valid range of 0 up to
71            the result of
72            <member>XAccessibleContext::getAccessibleChildCount()</member>-1.
73    */
74    void selectAccessibleChild ([in] long nChildIndex)
75        raises (::com::sun::star::lang::IndexOutOfBoundsException);
76
77    /** Determines if the specified child of this object is selected.
78
79        @param nChildIndex
80            Index of the child for which to detect whether it is selected.
81            This index referes to all the children of this object.
82
83        @return
84            Returns <TRUE/> if the specified child is selected and <FALSE/>
85            if it is not selected.
86        @throws ::com::sun::star::lang::IndexOutOfBoundsException
87            if the given index does not lie in the valid range of 0 up to
88            the result of
89            <member>XAccessibleContext::getAccessibleChildCount()</member>-1.
90    */
91    boolean isAccessibleChildSelected ([in] long nChildIndex)
92        raises (::com::sun::star::lang::IndexOutOfBoundsException);
93
94    /** Clears the selection, so that no children of the
95        object are selected.
96    */
97    [oneway] void clearAccessibleSelection ();
98
99    /** Select all children.
100
101        <p>Causes every child of the object to be selected if the object
102        supports multiple selections.  If multiple selection is not
103        supported then the first child, if it exists, is selected and all
104        other children are deselected.</p>
105    */
106    [oneway] void selectAllAccessibleChildren ();
107
108    /** Returns the number of Accessible children that are currently
109        selected.
110
111        <p>This number specifies the valid interval of indices that can be
112        used as arguments for the methods
113        <member>XAccessibleSelection::getSelectedChild</member> and
114        <member>XAccessibleSelection::deselectSelectedChild</member>.</p>
115
116        @return
117            Returns the number of selected children of this object or 0 if
118            no child is selected.
119    */
120    long getSelectedAccessibleChildCount ();
121
122    /** Returns the specified selected Accessible child.
123
124        @param nSelectedChildIndex
125            This index refers only to the selected children, not to all the
126            children of this object.  Even if all children are selected, the
127            indices enumerating the selected children need not be the same
128            as those enumerating all children.  If only single selection is
129            supported the only valid value is 0.
130
131        @return
132            If the index is valid, i.e. not negative and lower than the
133            number of selected children, then a valid reference to the
134            corresponding <type>XAccessible</type> child is returned.
135            Otherwise an exception is thrown.
136        @throws ::com::sun::star::lang::IndexOutOfBoundsException
137            if the given index does not lie in the valid range of 0 up to
138            the result of
139            <member>XAccessibleRelationSet::getAccessibleChildCount()</member>-1.
140    */
141    XAccessible getSelectedAccessibleChild ([in] long nSelectedChildIndex)
142        raises (::com::sun::star::lang::IndexOutOfBoundsException);
143
144    /** Removes the specified child from the set of this object's
145        selected children.  Note that not all applications support
146        deselection: calls to this method may be silently ignored.
147
148        @param nChildIndex
149            This index refers to all children not just the selected ones.
150            If the specified child is not selected or it can not be
151            deselected for any reason then the method call is silently
152            ignored.
153        @throws ::com::sun::star::lang::IndexOutOfBoundsException
154            if the given index does not lie in the valid range of 0 up to,
155            but not including, the result of
156            <member scope="XAccessibleContext">getAccessibleChildCount()</member>.
157    */
158    void deselectAccessibleChild ([in] long nChildIndex)
159        raises (::com::sun::star::lang::IndexOutOfBoundsException);
160};
161
162}; }; }; };
163
164#endif
165