1d1766043SAndrew Rist/**************************************************************
2d1766043SAndrew Rist *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_awt_grid_XMutableGridDataModel_idl__
25cdf0e10cSrcweir#define __com_sun_star_awt_grid_XMutableGridDataModel_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#include <com/sun/star/awt/grid/XGridDataModel.idl>
28cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
29cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
30cdf0e10cSrcweir
31cdf0e10cSrcweir//==================================================================================================================
32cdf0e10cSrcweir
33cdf0e10cSrcweirmodule com { module sun { module star { module awt { module grid {
34cdf0e10cSrcweir
35cdf0e10cSrcweir//==================================================================================================================
36cdf0e10cSrcweir
37cdf0e10cSrcweir/** allows to modify the data represented by a <type>XGridDataModel</type>
38cdf0e10cSrcweir */
39cdf0e10cSrcweirpublished interface XMutableGridDataModel : XGridDataModel
40cdf0e10cSrcweir{
41cdf0e10cSrcweir	/** appends a row to the model.
42cdf0e10cSrcweir
43cdf0e10cSrcweir		@param Heading
44cdf0e10cSrcweir            denotes the heading of the row.
45cdf0e10cSrcweir		@param Data
46cdf0e10cSrcweir            specifies the content of the row.
47cdf0e10cSrcweir	*/
48cdf0e10cSrcweir	void addRow( [in] any Heading, [in] sequence< any > Data );
49cdf0e10cSrcweir
50cdf0e10cSrcweir    /** appends multiple rows of data to the model.
51cdf0e10cSrcweir        @param Headings
52cdf0e10cSrcweir            denotes the headings of the to-be-added rows.
53cdf0e10cSrcweir        @param Data
54cdf0e10cSrcweir            specifies the data of the rows to be added.
55cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
56cdf0e10cSrcweir            if <code>Titles</code> and <code>Data</code> are of different length.
57cdf0e10cSrcweir    */
58cdf0e10cSrcweir    void addRows( [in] sequence< any > Headings, [in] sequence< sequence< any > > Data )
59cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IllegalArgumentException );
60cdf0e10cSrcweir
61cdf0e10cSrcweir	/** inserts a row into the set of data rows
62cdf0e10cSrcweir
63cdf0e10cSrcweir        @param Index
64cdf0e10cSrcweir            denotes the position at which the row is to be inserted
65cdf0e10cSrcweir		@param Heading
66cdf0e10cSrcweir            denotes the heading of the row.
67cdf0e10cSrcweir		@param Data
68cdf0e10cSrcweir            specifies the content of the row.
69cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
70cdf0e10cSrcweir            if <code>Index</code> is smaller than <code>0</code> or greater than the number of
71cdf0e10cSrcweir            rows in the model.
72cdf0e10cSrcweir	*/
73cdf0e10cSrcweir	void insertRow( [in] long Index, [in] any Heading, [in] sequence< any > Data )
74cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
75cdf0e10cSrcweir
76cdf0e10cSrcweir    /** inserts multiple rows of data into the model.
77cdf0e10cSrcweir        @param Index
78cdf0e10cSrcweir            denotes the position at which the rows are to be inserted
79cdf0e10cSrcweir        @param Headings
80cdf0e10cSrcweir            denotes the headings of the to-be-added rows.
81cdf0e10cSrcweir        @param Data
82cdf0e10cSrcweir            specifies the data of the rows to be added.
83cdf0e10cSrcweir        @throws ::com::sun::star::lang::IllegalArgumentException
84cdf0e10cSrcweir            if <code>Titles</code> and <code>Data</code> are of different length.
85cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
86cdf0e10cSrcweir            if <code>Index</code> is smaller than <code>0</code> or greater than the number of
87cdf0e10cSrcweir            rows in the model.
88cdf0e10cSrcweir    */
89cdf0e10cSrcweir    void insertRows( [in] long Index, [in] sequence< any > Headings, [in] sequence< sequence< any > > Data )
90cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException
91cdf0e10cSrcweir               , ::com::sun::star::lang::IllegalArgumentException );
92cdf0e10cSrcweir
93cdf0e10cSrcweir	/** removes a row of data from the model
94cdf0e10cSrcweir
95cdf0e10cSrcweir		@param RowIndex
96cdf0e10cSrcweir            the index of the row that should be removed.
97cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
98cdf0e10cSrcweir            if the given index is invalid
99cdf0e10cSrcweir	*/
100cdf0e10cSrcweir	void removeRow( [in] long RowIndex )
101cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
102cdf0e10cSrcweir
103cdf0e10cSrcweir	/** Removes all rows from the model.
104cdf0e10cSrcweir	*/
105cdf0e10cSrcweir	void removeAllRows();
106cdf0e10cSrcweir
107cdf0e10cSrcweir	/** updates the content of the given cell
108cdf0e10cSrcweir		@param ColumnIndex
109cdf0e10cSrcweir			the column index of the to-be-updated cell
110cdf0e10cSrcweir		@param RowIndex
111cdf0e10cSrcweir			the row index of the to-be-updated cell
112cdf0e10cSrcweir		@param Value
113cdf0e10cSrcweir			the new value of the cell.
114cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
115cdf0e10cSrcweir            if the row or column index is invalid
116cdf0e10cSrcweir	*/
117cdf0e10cSrcweir	void updateCellData( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
118cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
119cdf0e10cSrcweir
120cdf0e10cSrcweir	/** updates the content of a given row.
121cdf0e10cSrcweir
122cdf0e10cSrcweir        <p>The change in the data model will be notified to registered listeners via
123cdf0e10cSrcweir        <member">XGridDataListener::dataChanged</member>. The <member>GridDataEvent::FirstColumn</member> and
124cdf0e10cSrcweir        <member>GridDataEvent::LastColumn</member> will denote the smallest respectively largest column
125cdf0e10cSrcweir        index from <argColumnIndexes</arg>.</p>
126cdf0e10cSrcweir
127cdf0e10cSrcweir		@param ColumnIndexes
128cdf0e10cSrcweir			contains the column indexes of the cells, which should be updated
129cdf0e10cSrcweir        @param RowIndex
130cdf0e10cSrcweir			contains the index of the row whose data is to be updated
131cdf0e10cSrcweir		@param Values
132cdf0e10cSrcweir			specifies the new values of the cells.
133cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
134cdf0e10cSrcweir            if one of the row indexes or the column index is invalid
135*ecca6aeeSAriel Constenla-Haile        @throws ::com::sun::star::lang::IllegalArgumentException
136cdf0e10cSrcweir            if the lengths of the <code>ColumnIndexes</code> and <code>Values</code> sequences are not equal.
137cdf0e10cSrcweir	*/
138cdf0e10cSrcweir	void updateRowData( [in] sequence< long > ColumnIndexes, [in] long RowIndex, [in] sequence< any > Values )
139cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IndexOutOfBoundsException
140cdf0e10cSrcweir                   , ::com::sun::star::lang::IllegalArgumentException);
141cdf0e10cSrcweir
142cdf0e10cSrcweir    /** sets a new title for a given row.
143cdf0e10cSrcweir
144cdf0e10cSrcweir        @throws ::com::sun::star::lang::IndexOutOfBoundsException
145cdf0e10cSrcweir            if the given index does not denote a valid row.
146cdf0e10cSrcweir    */
147cdf0e10cSrcweir    void
148cdf0e10cSrcweir        updateRowHeading( [in] long RowIndex, [in] any Heading )
149cdf0e10cSrcweir            raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
150cdf0e10cSrcweir
151cdf0e10cSrcweir    /** updates the tooltip to be displayed for a given cell
152cdf0e10cSrcweir
153cdf0e10cSrcweir        @see XGridDataModel::getCellToolTip
154cdf0e10cSrcweir    */
155cdf0e10cSrcweir    void updateCellToolTip( [in] long ColumnIndex, [in] long RowIndex, [in] any Value )
156cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
157cdf0e10cSrcweir
158cdf0e10cSrcweir    /** updates the tooltip for all cells of a given row
159cdf0e10cSrcweir
160cdf0e10cSrcweir        <p>Effectively this method is a shortcut for calling <member>updateCellToolTip</member> multiple
161cdf0e10cSrcweir        times in a row, for all cells of a given row.</p>
162cdf0e10cSrcweir
163cdf0e10cSrcweir        @see XGridDataModel::getCellToolTip
164cdf0e10cSrcweir        @see updateCellToolTip
165cdf0e10cSrcweir    */
166cdf0e10cSrcweir    void updateRowToolTip( [in] long RowIndex, [in] any Value )
167cdf0e10cSrcweir        raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
168cdf0e10cSrcweir
169cdf0e10cSrcweir	//-------------------------------------------------------------------------
170cdf0e10cSrcweir
171cdf0e10cSrcweir	/** registers listener to be notified of data changes in the model
172cdf0e10cSrcweir        @param Listener
173cdf0e10cSrcweir            specifies the listener to register
174cdf0e10cSrcweir	*/
175cdf0e10cSrcweir	void addGridDataListener( [in] XGridDataListener Listener );
176cdf0e10cSrcweir
177cdf0e10cSrcweir	//-------------------------------------------------------------------------
178cdf0e10cSrcweir
179cdf0e10cSrcweir	/** revokes a listener which was previously registered via <member>addGridDataListener</member>
180cdf0e10cSrcweir		@param Listener
181cdf0e10cSrcweir			specifies the listener to revoke.
182cdf0e10cSrcweir	*/
183cdf0e10cSrcweir    void removeGridDataListener( [in] XGridDataListener Listener );
184cdf0e10cSrcweir};
185cdf0e10cSrcweir
186cdf0e10cSrcweir//==================================================================================================================
187cdf0e10cSrcweir
188cdf0e10cSrcweir}; }; }; }; };
189cdf0e10cSrcweir
190cdf0e10cSrcweir//==================================================================================================================
191cdf0e10cSrcweir
192cdf0e10cSrcweir#endif
193