1*ebfcd9afSAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*ebfcd9afSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*ebfcd9afSAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*ebfcd9afSAndrew Rist * distributed with this work for additional information
6*ebfcd9afSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*ebfcd9afSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*ebfcd9afSAndrew Rist * "License"); you may not use this file except in compliance
9*ebfcd9afSAndrew Rist * with the License.  You may obtain a copy of the License at
10*ebfcd9afSAndrew Rist *
11*ebfcd9afSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*ebfcd9afSAndrew Rist *
13*ebfcd9afSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*ebfcd9afSAndrew Rist * software distributed under the License is distributed on an
15*ebfcd9afSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ebfcd9afSAndrew Rist * KIND, either express or implied.  See the License for the
17*ebfcd9afSAndrew Rist * specific language governing permissions and limitations
18*ebfcd9afSAndrew Rist * under the License.
19*ebfcd9afSAndrew Rist *
20*ebfcd9afSAndrew Rist *************************************************************/
21*ebfcd9afSAndrew Rist
22*ebfcd9afSAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_awt_grid_XGridSelection_idl__
24cdf0e10cSrcweir#define __com_sun_star_awt_grid_XGridSelection_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#include <com/sun/star/awt/grid/XGridSelectionListener.idl>
27cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
28cdf0e10cSrcweir
29cdf0e10cSrcweir//=============================================================================
30cdf0e10cSrcweir
31cdf0e10cSrcweirmodule com {  module sun {  module star {  module awt { module grid {
32cdf0e10cSrcweir
33cdf0e10cSrcweir//=============================================================================
34cdf0e10cSrcweir
35cdf0e10cSrcweir/** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>.
36cdf0e10cSrcweir
37cdf0e10cSrcweir    @since OpenOffice.org 3.4
38cdf0e10cSrcweir */
39cdf0e10cSrcweirpublished interface XGridRowSelection
40cdf0e10cSrcweir{
41cdf0e10cSrcweir	/** Selects all rows.
42cdf0e10cSrcweir	*/
43cdf0e10cSrcweir	void selectAllRows();
44cdf0e10cSrcweir
45cdf0e10cSrcweir	/** selects a given row
46cdf0e10cSrcweir
47cdf0e10cSrcweir        @param RowIndex
48cdf0e10cSrcweir            denotes the index of the row to select
49cdf0e10cSrcweir
50cdf0e10cSrcweir        @raises ::com::sun::star::lang::IndexOutOfBoundsException
51cdf0e10cSrcweir            if <code>RowIndex</code> does not denote a valid row index
52cdf0e10cSrcweir    */
53cdf0e10cSrcweir	void selectRow( [in] long RowIndex )
54cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
55cdf0e10cSrcweir
56cdf0e10cSrcweir	/** Deselects all selected rows.
57cdf0e10cSrcweir	*/
58cdf0e10cSrcweir	void deselectAllRows();
59cdf0e10cSrcweir
60cdf0e10cSrcweir	/** removes the selection for a given row
61cdf0e10cSrcweir
62cdf0e10cSrcweir        @param RowIndex
63cdf0e10cSrcweir            denotes the index of the row to deselect
64cdf0e10cSrcweir	*/
65cdf0e10cSrcweir	void deselectRow( [in] long RowIndex )
66cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
67cdf0e10cSrcweir
68cdf0e10cSrcweir	/** Returns the indicies of all selected rows.
69cdf0e10cSrcweir		@returns
70cdf0e10cSrcweir			a sequence of indicies.
71cdf0e10cSrcweir	*/
72cdf0e10cSrcweir	sequence< long > getSelectedRows();
73cdf0e10cSrcweir
74cdf0e10cSrcweir	/** Returns whether rows are selected.
75cdf0e10cSrcweir		@returns
76cdf0e10cSrcweir            <true/> if and only if at least one row is selected.
77cdf0e10cSrcweir	*/
78cdf0e10cSrcweir	boolean hasSelectedRows();
79cdf0e10cSrcweir
80cdf0e10cSrcweir	/** Returns whether a specific row is selected.
81cdf0e10cSrcweir
82cdf0e10cSrcweir        @param RowIndex
83cdf0e10cSrcweir			the index of a row. If the value does not denote a valid row index, i.e. is smaller than <code>0</code>
84cdf0e10cSrcweir            or greater than the number of rows, this is silently ignored, and <false/> is returned.
85cdf0e10cSrcweir
86cdf0e10cSrcweir		@returns
87cdf0e10cSrcweir			<true/> if and only if there is a row with the given index, and it is selected currently.
88cdf0e10cSrcweir	*/
89cdf0e10cSrcweir	boolean isRowSelected( [in] long RowIndex );
90cdf0e10cSrcweir
91cdf0e10cSrcweir    /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes.
92cdf0e10cSrcweir		@param listener
93cdf0e10cSrcweir			the listener to add.
94cdf0e10cSrcweir	*/
95cdf0e10cSrcweir	void addSelectionListener( [in] XGridSelectionListener  listener);
96cdf0e10cSrcweir
97cdf0e10cSrcweir	/** Removes a listener previously added with <method>addSelectionListener()</method>.
98cdf0e10cSrcweir		@param listener
99cdf0e10cSrcweir			the listener to remove.
100cdf0e10cSrcweir	*/
101cdf0e10cSrcweir	void removeSelectionListener( [in] XGridSelectionListener listener);
102cdf0e10cSrcweir};
103cdf0e10cSrcweir
104cdf0e10cSrcweir//=============================================================================
105cdf0e10cSrcweir
106cdf0e10cSrcweir}; }; }; }; };
107cdf0e10cSrcweir
108cdf0e10cSrcweir#endif
109