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#ifndef __com_sun_star_awt_grid_XGridSelection_idl__
24#define __com_sun_star_awt_grid_XGridSelection_idl__
25
26#include <com/sun/star/awt/grid/XGridSelectionListener.idl>
27#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
28
29//=============================================================================
30
31module com {  module sun {  module star {  module awt { module grid {
32
33//=============================================================================
34
35/** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>.
36
37    @since OpenOffice 3.4
38 */
39published interface XGridRowSelection
40{
41	/** Selects all rows.
42	*/
43	void selectAllRows();
44
45	/** selects a given row
46
47        @param RowIndex
48            denotes the index of the row to select
49
50        @raises ::com::sun::star::lang::IndexOutOfBoundsException
51            if <code>RowIndex</code> does not denote a valid row index
52    */
53	void selectRow( [in] long RowIndex )
54        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
55
56	/** Deselects all selected rows.
57	*/
58	void deselectAllRows();
59
60	/** removes the selection for a given row
61
62        @param RowIndex
63            denotes the index of the row to deselect
64	*/
65	void deselectRow( [in] long RowIndex )
66        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
67
68	/** Returns the indices of all selected rows.
69		@returns
70			a sequence of indices.
71	*/
72	sequence< long > getSelectedRows();
73
74	/** Returns whether rows are selected.
75		@returns
76            <true/> if and only if at least one row is selected.
77	*/
78	boolean hasSelectedRows();
79
80	/** Returns whether a specific row is selected.
81
82        @param RowIndex
83			the index of a row. If the value does not denote a valid row index, i.e. is smaller than <code>0</code>
84            or greater than the number of rows, this is silently ignored, and <false/> is returned.
85
86		@returns
87			<true/> if and only if there is a row with the given index, and it is selected currently.
88	*/
89	boolean isRowSelected( [in] long RowIndex );
90
91    /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes.
92		@param listener
93			the listener to add.
94	*/
95	void addSelectionListener( [in] XGridSelectionListener  listener);
96
97	/** Removes a listener previously added with <method>addSelectionListener()</method>.
98		@param listener
99			the listener to remove.
100	*/
101	void removeSelectionListener( [in] XGridSelectionListener listener);
102};
103
104//=============================================================================
105
106}; }; }; }; };
107
108#endif
109