diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-13 14:08:36 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-13 14:08:36 +0100 |
commit | c8030037c49842a8cbda8345a4f0f24a50822a3f (patch) | |
tree | 9f7abb7a613907e2bc93e48c8ddd3d9b957b72d7 | |
parent | gridsort: removed the XGridDataModel.removeRows flavour which took an arbitra... (diff) | |
download | core-c8030037c49842a8cbda8345a4f0f24a50822a3f.tar.gz core-c8030037c49842a8cbda8345a4f0f24a50822a3f.zip |
gridsort: reworked the notification system for inserted/removed rows
In this course, more code which was in SVTXGridControl was moved to the places it belongs to, effectively
meaning that the TableControl has better chances than before to be used outside an SVTXGridControl (though
we're not there, yet).
Also, the selection-related methods in TableControl/_Impl got some refactoring love, so the implementation
details are hidden in the Impl class now, instead of being exposed to an exploited by the TableControl.
And while we were there ... The XGridSelection does not provide a |selectColumn| anymore (there was no
preparation whatsoever for column selection, anywhere, thus it was a complete dummy.)
Also, its de/selectRows methods have been removed: They have questionable use, and make implementation
rather difficult, compared with multiple calls to de/selectRow.
4 files changed, 38 insertions, 33 deletions
diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl index 9afadfd3df7e..3ac05f0ec1ae 100644 --- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl @@ -37,29 +37,37 @@ module com { module sun { module star { module awt { module grid { /** used to notify changes in the data represented by an <type>XMutableGridDataModel</type>. + <p>Effectively, a <code>GridDataEvent</code> denotes a continuous two-dimensional cell range + within a grid's data model, which is affected by a certain change.</p> + @see XMutableGridDataModel - @see XGridControl @see XGridDataListener @since OOo 3.3.0 */ struct GridDataEvent: com::sun::star::lang::EventObject { - /** denotes the columns affected by the data change + /** denotes the first column affected by a change. - <p>The array contains the indexes of the affected columns, in ascending order.</p> + <p>If <code>FirstColumn</code> is -1, the listener should assume that all rows of a grid's data model + are affected.</p> + */ + long FirstColumn; - <p>If this sequence is empty, the callee should all assume all columns to be affected.</p> + /** denotes the last column affected by a change */ - sequence< long > Columns; + long LastColumn; - /** denotes the rows affected by the data change + /** denotes the first row affected by a change. - <p>The array contains the indexes of the affected rows, in ascending order.</p> + <p>If <code>FirstRow</code> is -1, the listener should assume that all rows of a grid's data model + are affected.</p> + */ + long FirstRow; - <p>If this sequence is empty, the callee should all assume all rows to be affected.</p> + /** denotes the last row affected by a change */ - sequence< long > Rows; + long LastRow; }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl index 1e5573cef2b7..ef21ea96ec9f 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl @@ -52,9 +52,9 @@ module com { module sun { module star { module awt { module grid { interface XGridDataListener: com::sun::star::lang::XEventListener { - /** is called when one or more rows of data have been added to a grid control's data model. + /** is called when one or more rows of data have been inserted into a grid control's data model. */ - void rowsAdded( [in] GridDataEvent Event ); + void rowsInserted( [in] GridDataEvent Event ); /** is called when one or more rows of data have been removed from a grid control's data model. */ diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl index 5049426018b0..e07acb39a057 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelection.idl +++ b/offapi/com/sun/star/awt/grid/XGridSelection.idl @@ -55,23 +55,25 @@ interface XGridSelection /** Selects all rows. */ - [oneway] void selectAllRows(); + void selectAllRows(); - /** Selects multiple rows. Previous selections will be removed. - @param rangeOfRows - array of rows indexes, which will be selected. + /** selects a given row + + @param RowIndex + denotes the index of the row to select */ - [oneway] void selectRows( [in] sequence< long > rangeOfRows); + void selectRow( [in] long RowIndex ); /** Deselects all selected rows. */ - [oneway] void deselectAllRows(); + void deselectAllRows(); + + /** removes the selection for a given row - /** Deselects selected rows. Selected rows, which aren't in the range remain selected. - @param rangeOfRows - array of rows indexes, which will be deselected. + @param RowIndex + denotes the index of the row to deselect */ - [oneway] void deselectRows( [in] sequence< long > rangeOfRows); + void deselectRow( [in] long RowIndex ); /** Returns the indicies of all selected rows. @returns @@ -93,21 +95,11 @@ interface XGridSelection */ boolean isSelectedIndex( [in] long index); - /** Marks a row as selected. - @param index - the index of a row. - */ - [oneway] void selectRow( [in] long index); - - /* - [oneway] void selectColumn( [in] long x); - */ - /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes. @param listener the listener to add. */ - [oneway] void addSelectionListener( [in] XGridSelectionListener listener); + void addSelectionListener( [in] XGridSelectionListener listener); //------------------------------------------------------------------------- @@ -115,7 +107,7 @@ interface XGridSelection @param listener the listener to remove. */ - [oneway] void removeSelectionListener( [in] XGridSelectionListener listener); + void removeSelectionListener( [in] XGridSelectionListener listener); }; diff --git a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl index 6edb91895e88..58023cadc7b7 100755 --- a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl @@ -90,6 +90,11 @@ interface XMutableGridDataModel : XGridDataModel /** updates the content of a given row. + <p>The change in the data model will be notified to registered listeners via + <member">XGridDataListener::dataChanged</member>. The <member>GridDataEvent::FirstColumn</member> and + <member>GridDataEvent::LastColumn</member> will denote the smallest respectively largest column + index from <argColumnIndexes</arg>.</p> + @param ColumnIndexes contains the column indexes of the cells, which should be updated @param RowIndex |