xref: /AOO41X/main/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3*cdf0e10cSrcweir *
4*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
5*cdf0e10cSrcweir *
6*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
7*cdf0e10cSrcweir *
8*cdf0e10cSrcweir * This file is part of OpenOffice.org.
9*cdf0e10cSrcweir *
10*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
11*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
12*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
13*cdf0e10cSrcweir *
14*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
15*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
16*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
18*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
19*cdf0e10cSrcweir *
20*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
21*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
22*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
23*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
24*cdf0e10cSrcweir *
25*cdf0e10cSrcweir ************************************************************************/
26*cdf0e10cSrcweir
27*cdf0e10cSrcweir#ifndef __com_sun_star_awt_grid_XMutableGridDataModel_idl__
28*cdf0e10cSrcweir#define __com_sun_star_awt_grid_XMutableGridDataModel_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#include <com/sun/star/awt/grid/XGridDataModel.idl>
31*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
32*cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir//==================================================================================================================
35*cdf0e10cSrcweir
36*cdf0e10cSrcweirmodule com { module sun { module star { module awt { module grid {
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir//==================================================================================================================
39*cdf0e10cSrcweir
40*cdf0e10cSrcweir/** allows to modify the data represented by a <type>XGridDataModel</type>
41*cdf0e10cSrcweir */
42*cdf0e10cSrcweirpublished interface XMutableGridDataModel : XGridDataModel
43*cdf0e10cSrcweir{
44*cdf0e10cSrcweir	/** appends a row to the model.
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir		@param Heading
47*cdf0e10cSrcweir            denotes the heading of the row.
48*cdf0e10cSrcweir		@param Data
49*cdf0e10cSrcweir            specifies the content of the row.
50*cdf0e10cSrcweir	*/
51*cdf0e10cSrcweir	void addRow( [in] any Heading, [in] sequence< any > Data );
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir    /** appends multiple rows of data to the model.
54*cdf0e10cSrcweir        @param Headings
55*cdf0e10cSrcweir            denotes the headings of the to-be-added rows.
56*cdf0e10cSrcweir        @param Data
57*cdf0e10cSrcweir            specifies the data of the rows to be added.
58*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
59*cdf0e10cSrcweir            if <code>Titles</code> and <code>Data</code> are of different length.
60*cdf0e10cSrcweir    */
61*cdf0e10cSrcweir    void addRows( [in] sequence< any > Headings, [in] sequence< sequence< any > > Data )
62*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IllegalArgumentException );
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir	/** inserts a row into the set of data rows
65*cdf0e10cSrcweir
66*cdf0e10cSrcweir        @param Index
67*cdf0e10cSrcweir            denotes the position at which the row is to be inserted
68*cdf0e10cSrcweir		@param Heading
69*cdf0e10cSrcweir            denotes the heading of the row.
70*cdf0e10cSrcweir		@param Data
71*cdf0e10cSrcweir            specifies the content of the row.
72*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
73*cdf0e10cSrcweir            if <code>Index</code> is smaller than <code>0</code> or greater than the number of
74*cdf0e10cSrcweir            rows in the model.
75*cdf0e10cSrcweir	*/
76*cdf0e10cSrcweir	void insertRow( [in] long Index, [in] any Heading, [in] sequence< any > Data )
77*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
78*cdf0e10cSrcweir
79*cdf0e10cSrcweir    /** inserts multiple rows of data into the model.
80*cdf0e10cSrcweir        @param Index
81*cdf0e10cSrcweir            denotes the position at which the rows are to be inserted
82*cdf0e10cSrcweir        @param Headings
83*cdf0e10cSrcweir            denotes the headings of the to-be-added rows.
84*cdf0e10cSrcweir        @param Data
85*cdf0e10cSrcweir            specifies the data of the rows to be added.
86*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
87*cdf0e10cSrcweir            if <code>Titles</code> and <code>Data</code> are of different length.
88*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
89*cdf0e10cSrcweir            if <code>Index</code> is smaller than <code>0</code> or greater than the number of
90*cdf0e10cSrcweir            rows in the model.
91*cdf0e10cSrcweir    */
92*cdf0e10cSrcweir    void insertRows( [in] long Index, [in] sequence< any > Headings, [in] sequence< sequence< any > > Data )
93*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException
94*cdf0e10cSrcweir               , ::com::sun::star::lang::IllegalArgumentException );
95*cdf0e10cSrcweir
96*cdf0e10cSrcweir	/** removes a row of data from the model
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir		@param RowIndex
99*cdf0e10cSrcweir            the index of the row that should be removed.
100*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
101*cdf0e10cSrcweir            if the given index is invalid
102*cdf0e10cSrcweir	*/
103*cdf0e10cSrcweir	void removeRow( [in] long RowIndex )
104*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir	/** Removes all rows from the model.
107*cdf0e10cSrcweir	*/
108*cdf0e10cSrcweir	void removeAllRows();
109*cdf0e10cSrcweir
110*cdf0e10cSrcweir	/** updates the content of the given cell
111*cdf0e10cSrcweir		@param ColumnIndex
112*cdf0e10cSrcweir			the column index of the to-be-updated cell
113*cdf0e10cSrcweir		@param RowIndex
114*cdf0e10cSrcweir			the row index of the to-be-updated cell
115*cdf0e10cSrcweir		@param Value
116*cdf0e10cSrcweir			the new value of the cell.
117*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
118*cdf0e10cSrcweir            if the row or column index is invalid
119*cdf0e10cSrcweir	*/
120*cdf0e10cSrcweir	void updateCellData( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
121*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir	/** updates the content of a given row.
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir        <p>The change in the data model will be notified to registered listeners via
126*cdf0e10cSrcweir        <member">XGridDataListener::dataChanged</member>. The <member>GridDataEvent::FirstColumn</member> and
127*cdf0e10cSrcweir        <member>GridDataEvent::LastColumn</member> will denote the smallest respectively largest column
128*cdf0e10cSrcweir        index from <argColumnIndexes</arg>.</p>
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir		@param ColumnIndexes
131*cdf0e10cSrcweir			contains the column indexes of the cells, which should be updated
132*cdf0e10cSrcweir        @param RowIndex
133*cdf0e10cSrcweir			contains the index of the row whose data is to be updated
134*cdf0e10cSrcweir		@param Values
135*cdf0e10cSrcweir			specifies the new values of the cells.
136*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
137*cdf0e10cSrcweir            if one of the row indexes or the column index is invalid
138*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
139*cdf0e10cSrcweir            if the lengths of the <code>ColumnIndexes</code> and <code>Values</code> sequences are not equal.
140*cdf0e10cSrcweir	*/
141*cdf0e10cSrcweir	void updateRowData( [in] sequence< long > ColumnIndexes, [in] long RowIndex, [in] sequence< any > Values )
142*cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IndexOutOfBoundsException
143*cdf0e10cSrcweir                   , ::com::sun::star::lang::IllegalArgumentException);
144*cdf0e10cSrcweir
145*cdf0e10cSrcweir    /** sets a new title for a given row.
146*cdf0e10cSrcweir
147*cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
148*cdf0e10cSrcweir            if the given index does not denote a valid row.
149*cdf0e10cSrcweir    */
150*cdf0e10cSrcweir    void
151*cdf0e10cSrcweir        updateRowHeading( [in] long RowIndex, [in] any Heading )
152*cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
153*cdf0e10cSrcweir
154*cdf0e10cSrcweir    /** updates the tooltip to be displayed for a given cell
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir        @see XGridDataModel::getCellToolTip
157*cdf0e10cSrcweir    */
158*cdf0e10cSrcweir    void updateCellToolTip( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
159*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
160*cdf0e10cSrcweir
161*cdf0e10cSrcweir    /** updates the tooltip for all cells of a given row
162*cdf0e10cSrcweir
163*cdf0e10cSrcweir        <p>Effectively this method is a shortcut for calling <member>updateCellToolTip</member> multiple
164*cdf0e10cSrcweir        times in a row, for all cells of a given row.</p>
165*cdf0e10cSrcweir
166*cdf0e10cSrcweir        @see XGridDataModel::getCellToolTip
167*cdf0e10cSrcweir        @see updateCellToolTip
168*cdf0e10cSrcweir    */
169*cdf0e10cSrcweir    void updateRowToolTip( [in] long RowIndex, [in] any Value )
170*cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
171*cdf0e10cSrcweir
172*cdf0e10cSrcweir	//-------------------------------------------------------------------------
173*cdf0e10cSrcweir
174*cdf0e10cSrcweir	/** registers listener to be notified of data changes in the model
175*cdf0e10cSrcweir        @param Listener
176*cdf0e10cSrcweir            specifies the listener to register
177*cdf0e10cSrcweir	*/
178*cdf0e10cSrcweir	void addGridDataListener( [in] XGridDataListener Listener );
179*cdf0e10cSrcweir
180*cdf0e10cSrcweir	//-------------------------------------------------------------------------
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir	/** revokes a listener which was previously registered via <member>addGridDataListener</member>
183*cdf0e10cSrcweir		@param Listener
184*cdf0e10cSrcweir			specifies the listener to revoke.
185*cdf0e10cSrcweir	*/
186*cdf0e10cSrcweir    void removeGridDataListener( [in] XGridDataListener Listener );
187*cdf0e10cSrcweir};
188*cdf0e10cSrcweir
189*cdf0e10cSrcweir//==================================================================================================================
190*cdf0e10cSrcweir
191*cdf0e10cSrcweir}; }; }; }; };
192*cdf0e10cSrcweir
193*cdf0e10cSrcweir//==================================================================================================================
194*cdf0e10cSrcweir
195*cdf0e10cSrcweir#endif
196