summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-08-31 03:09:18 -0500
committerMiklos Vajna <vmiklos@suse.cz>2012-09-14 07:19:55 +0000
commita5d4e7806c6519e139962d88ec969f9baeb4a404 (patch)
tree0bd3a8fa829b457e742ac2bd6dfd891531511fdd /offapi
parent2095b2e1d44a158418d17836019352ed92f95d21 (diff)
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 Change-Id: Ie97de42a9ea70a0191657f898ca9d59706e23290 Reviewed-on: https://gerrit.libreoffice.org/542 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/UnoApi_offapi.mk5
-rw-r--r--offapi/com/sun/star/awt/grid/GridSelectionEvent.idl26
-rw-r--r--offapi/com/sun/star/awt/grid/SelectionEventType.idl63
-rw-r--r--offapi/com/sun/star/awt/grid/UnoControlGrid.idl18
-rw-r--r--offapi/com/sun/star/awt/grid/XGridControl.idl5
-rw-r--r--offapi/com/sun/star/awt/grid/XGridRowSelection.idl (renamed from offapi/com/sun/star/awt/grid/XGridSelection.idl)36
-rw-r--r--offapi/com/sun/star/awt/grid/XGridSelectionListener.idl7
7 files changed, 47 insertions, 113 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 2179afc1f9e7..740bf33cd0b9 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1840,14 +1840,13 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt/grid,\
GridInvalidDataException \
GridInvalidModelException \
GridSelectionEvent \
- SelectionEventType \
XGridColumn \
XGridColumnListener \
XGridColumnModel \
XGridControl \
XGridDataListener \
XGridDataModel \
- XGridSelection \
+ XGridRowSelection \
XGridSelectionListener \
XMutableGridDataModel \
XMutableGridDataModel \
@@ -2872,7 +2871,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/presentation,\
XTransitionFactory \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/qa,\
- XDumper \
+ XDumper \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/rdf,\
FileFormat \
diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
index eb89a18b5ae0..24c48c912840 100644
--- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
+++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl
@@ -30,32 +30,24 @@
#include <com/sun/star/lang/EventObject.idl>
-#include <com/sun/star/awt/grid/SelectionEventType.idl>
-
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
{
+ /** denotes the indexes of the rows being selected at the time the event was fired.
+ */
+ sequence< long > SelectedRowIndexes;
- /** 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 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 2d2d7605b667..000000000000
--- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
index bd3e6de8a01e..b49cb2ace2db 100644
--- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
+++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl
@@ -32,6 +32,10 @@
#include <com/sun/star/awt/grid/XGridControl.idl>
+#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 {
@@ -39,12 +43,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 <type>GridColumn</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.
@@ -55,18 +59,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
*/
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 dc99401e3ccb..b1e20053f25e 100644
--- a/offapi/com/sun/star/awt/grid/XGridControl.idl
+++ b/offapi/com/sun/star/awt/grid/XGridControl.idl
@@ -28,8 +28,7 @@
#ifndef __com_sun_star_awt_grid_XGridControl_idl__
#define __com_sun_star_awt_grid_XGridControl_idl__
-#include <com/sun/star/awt/grid/XGridSelection.idl>
-
+#include <com/sun/star/uno/XInterface.idl>
module com { module sun { module star { module awt { module grid {
@@ -40,7 +39,7 @@ module com { module sun { module star { module awt { module grid {
@since OOo 3.3
*/
-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 94c08ec08d84..0e8c2fefd704 100644
--- a/offapi/com/sun/star/awt/grid/XGridSelection.idl
+++ b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl
@@ -28,17 +28,18 @@
#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>
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.
*/
@@ -48,8 +49,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.
*/
@@ -60,27 +65,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 indices of all selected rows.
@returns
a sequence of indices.
*/
- 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
@@ -88,14 +97,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 b7731519da4f..b56985e9ff41 100644
--- a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl
+++ b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl
@@ -36,13 +36,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.
*/