diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-22 13:00:38 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-03-22 13:00:38 +0100 |
commit | 8da1858b9454d955701607559a702eb89089ea61 (patch) | |
tree | bd5ba54d47305cfecdb73116bed968e7f2588dd2 | |
parent | gridfixes: pulled and merged DEV300m101 (diff) | |
download | core-8da1858b9454d955701607559a702eb89089ea61.tar.gz core-8da1858b9454d955701607559a702eb89089ea61.zip |
gridfixes: #i117398# cleaned up the row selection API
- made explicit that it is about row selection, leaving room for a future selection of columns
- some changes for consistency
- do not derive XGridControl from XGrid(Row)Selection, those two are orthogonal
- published involved UNO types
-rw-r--r-- | offapi/com/sun/star/awt/grid/GridSelectionEvent.idl | 29 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/SelectionEventType.idl | 66 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/UnoControlGrid.idl | 18 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/XGridControl.idl | 4 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/XGridRowSelection.idl (renamed from offapi/com/sun/star/awt/grid/XGridSelection.idl) | 37 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/XGridSelectionListener.idl | 7 | ||||
-rw-r--r-- | offapi/com/sun/star/awt/grid/makefile.mk | 3 |
7 files changed, 45 insertions, 119 deletions
diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl index e9b87c2fe7ed..9ff468f5697e 100644 --- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl @@ -31,37 +31,26 @@ #include <com/sun/star/lang/EventObject.idl> #endif -#ifndef __com_sun_star_awt_grid_SelectionEventType_idl__ -#include <com/sun/star/awt/grid/SelectionEventType.idl> -#endif - //============================================================================= module com { module sun { module star { module awt { module grid { //============================================================================= -/** An event used by a <type>XGridControl</type> to notify changes in the selection. +/** An event used by a <type>XGridControl</type> to notify changes in its row selection. - @see XGridControl + @see XGridRowSelection @see XGridSelectionListener */ -struct GridSelectionEvent: com::sun::star::lang::EventObject +published struct GridSelectionEvent: com::sun::star::lang::EventObject { - //------------------------------------------------------------------------- - - /** the selected row*/ - long Row; - - /** the selected column*/ - long Column; - - /**number of selected rows, if multiple rows selected*/ - long Range; - - /** Contains the action <type>SelectionEventType</types> that was performed **/ - SelectionEventType Action; + /** denotes the indexes of the rows being selected at the time the event was fired. + */ + sequence< long > SelectedRowIndexes; + /** denotes the indexes of the columns being selected at the time the event was fired. + */ + sequence< long > SelectedColumnIndexes; }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/SelectionEventType.idl b/offapi/com/sun/star/awt/grid/SelectionEventType.idl deleted file mode 100644 index c7ee61498cc3..000000000000 --- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __com_sun_star_awt_grid_SelectionEventType_idl__ -#define __com_sun_star_awt_grid_SelectionEventType_idl__ - - -//============================================================================= - -module com { module sun { module star { module awt { module grid { - -//============================================================================= - -/** specifies the type of a selection event, as used by - <type>GridSelectionEvent</type>. - */ -enum SelectionEventType -{ - //------------------------------------------------------------------------- - - /** This value indicates that a selection was added to the grid control - */ - ADD, - - //------------------------------------------------------------------------- - - /** This value indicates that a selection was removed from the grid control - */ - REMOVE, - - //------------------------------------------------------------------------- - - /** This value indicates that a selection was changed - */ - CHANGE - -}; - -//============================================================================= - -}; }; }; }; }; - -#endif diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl index 542c27085dcb..bdd4d175d564 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl @@ -35,6 +35,10 @@ #include <com/sun/star/awt/grid/XGridControl.idl> #endif +#ifndef __com_sun_star_awt_grid_XGridRowSelection_idl__ +#include <com/sun/star/awt/grid/XGridRowSelection.idl> +#endif + //============================================================================= module com { module sun { module star { module awt { module grid { @@ -45,12 +49,12 @@ /** A control that displays a set of tabular data. - <p> <h4>The Column Model</h4> + <p>The horizontal structure of the grid is defined by the <type>XGridColumnModel</type> implemented in <type>DefaultGridColumnModel</type> The <type>XGridColumn</type> implemented in <typeGridColumn</type> describes the properties and behavior of a single column. Use the <member>XGridColumnModel::addColumn()</member> to add a column to the column model. </p> - <p> + <h4>The Data Model</h4> <p> All row data are stored in the <type>XGridDataModel</type>. Use the <type>DefaultGridDataModel</type> to add <member>XGridDataModel::addRow()</member> or remove <member>XGridDataModel::removeRow()</member> rows. @@ -61,18 +65,18 @@ <h4>Selection</h4> <p>If you are interested in knowing when the selection changes implement a <type>XGridSelectionListener</type> and add the instance with the method - <member>XGridSelection::addSelectionListener()</member>. - You than will be notified for any selection change. + <member>XGridRowSelection::addSelectionListener()</member>. + You than will be notified for any selection change.</p> - The <type>XGridSelection</type> interface provides a bunch of methods to set and get selection for the grid control. - </p> @since OOo 3.3.0 */ service UnoControlGrid { service com::sun::star::awt::UnoControl; - interface com::sun::star::awt::grid::XGridControl; + interface ::com::sun::star::awt::grid::XGridControl; + + interface ::com::sun::star::awt::grid::XGridRowSelection; }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 3c2c3d241528..4114ca685187 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -27,8 +27,6 @@ #ifndef __com_sun_star_awt_grid_XGridControl_idl__ #define __com_sun_star_awt_grid_XGridControl_idl__ -#include <com/sun/star/awt/grid/XGridSelection.idl> - //============================================================================= module com { module sun { module star { module awt { module grid { @@ -41,7 +39,7 @@ module com { module sun { module star { module awt { module grid { @since OOo 3.3.0 */ -interface XGridControl : XGridSelection +published interface XGridControl { /** retrieves the column which a given point belongs to diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl index aa7fd5e42b4b..7dd4903ef218 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelection.idl +++ b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl @@ -27,9 +27,8 @@ #ifndef __com_sun_star_awt_grid_XGridSelection_idl__ #define __com_sun_star_awt_grid_XGridSelection_idl__ -#include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/awt/grid/XGridSelectionListener.idl> -#include <com/sun/star/view/SelectionType.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> //============================================================================= @@ -38,8 +37,10 @@ module com { module sun { module star { module awt { module grid { //============================================================================= /** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>. + + @since OpenOffice.org 3.4 */ -interface XGridSelection +published interface XGridRowSelection { /** Selects all rows. */ @@ -49,8 +50,12 @@ interface XGridSelection @param RowIndex denotes the index of the row to select + + @raises ::com::sun::star::lang::IndexOutOfBoundsException + if <code>RowIndex</code> does not denote a valid row index */ - void selectRow( [in] long RowIndex ); + void selectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); /** Deselects all selected rows. */ @@ -61,27 +66,31 @@ interface XGridSelection @param RowIndex denotes the index of the row to deselect */ - void deselectRow( [in] long RowIndex ); + void deselectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); /** Returns the indicies of all selected rows. @returns a sequence of indicies. */ - sequence< long > getSelection(); + sequence< long > getSelectedRows(); /** Returns whether rows are selected. @returns - <true/> if rows are selected otherwise <false/>. + <true/> if and only if at least one row is selected. */ - boolean isSelectionEmpty(); + boolean hasSelectedRows(); /** Returns whether a specific row is selected. - @param - the index of a row. + + @param RowIndex + the index of a row. If the value does not denote a valid row index, i.e. is smaller than <code>0</code> + or greater than the number of rows, this is silently ignored, and <false/> is returned. + @returns - <true/> if row are selected otherwise <false/>. + <true/> if and only if there is a row with the given index, and it is selected currently. */ - boolean isSelectedIndex( [in] long index); + boolean isRowSelected( [in] long RowIndex ); /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes. @param listener @@ -89,15 +98,11 @@ interface XGridSelection */ void addSelectionListener( [in] XGridSelectionListener listener); - //------------------------------------------------------------------------- - /** Removes a listener previously added with <method>addSelectionListener()</method>. @param listener the listener to remove. */ void removeSelectionListener( [in] XGridSelectionListener listener); - - }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl index 61e8d3050b0d..61f36c267dae 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl @@ -41,13 +41,10 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -/** An instance of this interface is used by the <type>XGridSelection</type> to +/** An instance of this interface is used by the <type>XGridRowSelection</type> to get notifications about selection changes. - - <p>Usually you must not implement this interface yourself, but you must notify it correctly if - you implement the <type>XGridSelection</type> yourself</p>. */ -interface XGridSelectionListener: com::sun::star::lang::XEventListener +published interface XGridSelectionListener: com::sun::star::lang::XEventListener { //------------------------------------------------------------------------- /** Invoked after a selection was changed. diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk index 8499dca27d82..67a566edcdce 100644 --- a/offapi/com/sun/star/awt/grid/makefile.mk +++ b/offapi/com/sun/star/awt/grid/makefile.mk @@ -40,10 +40,9 @@ PACKAGE=com$/sun$/star$/awt$/grid IDLFILES=\ GridColumnEvent.idl\ GridDataEvent.idl\ - SelectionEventType.idl\ GridSelectionEvent.idl\ XGridSelectionListener.idl\ - XGridSelection.idl\ + XGridRowSelection.idl\ XGridColumn.idl\ XGridColumnListener.idl\ XGridDataListener.idl\ |