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.
This commit is contained in:
parent
1b1ba41c8b
commit
c8030037c4
4 changed files with 41 additions and 36 deletions
|
@ -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 this sequence is empty, the callee should all assume all columns to be affected.</p>
|
||||
<p>If <code>FirstColumn</code> is -1, the listener should assume that all rows of a grid's data model
|
||||
are affected.</p>
|
||||
*/
|
||||
sequence< long > Columns;
|
||||
long FirstColumn;
|
||||
|
||||
/** denotes the rows affected by the data change
|
||||
|
||||
<p>The array contains the indexes of the affected rows, in ascending order.</p>
|
||||
|
||||
<p>If this sequence is empty, the callee should all assume all rows to be affected.</p>
|
||||
/** denotes the last column affected by a change
|
||||
*/
|
||||
sequence< long > Rows;
|
||||
long LastColumn;
|
||||
|
||||
/** denotes the first row affected by a change.
|
||||
|
||||
<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;
|
||||
|
||||
/** denotes the last row affected by a change
|
||||
*/
|
||||
long LastRow;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
||||
/** Deselects selected rows. Selected rows, which aren't in the range remain selected.
|
||||
@param rangeOfRows
|
||||
array of rows indexes, which will be deselected.
|
||||
/** removes the selection for a given row
|
||||
|
||||
@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);
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue