1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 module com
{ module sun
{ module star
{ module awt
{ module grid
{
24 /** allows to modify the data represented by a XGridDataModel
26 published
interface XMutableGridDataModel
: XGridDataModel
28 /** appends a row to the model.
31 denotes the heading of the row.
33 specifies the content of the row.
35 void addRow
( [in] any Heading
, [in] sequence
< any
> Data
);
37 /** appends multiple rows of data to the model.
39 denotes the headings of the to-be-added rows.
41 specifies the data of the rows to be added.
42 @throws ::com::sun::star::lang::IllegalArgumentException
43 if <code>Titles</code> and <code>Data</code> are of different length.
45 void addRows
( [in] sequence
< any
> Headings
, [in] sequence
< sequence
< any
> > Data
)
46 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
);
48 /** inserts a row into the set of data rows
51 denotes the position at which the row is to be inserted
53 denotes the heading of the row.
55 specifies the content of the row.
56 @throws ::com::sun::star::lang::IndexOutOfBoundsException
57 if <code>Index</code> is smaller than <code>0</code> or greater than the number of
60 void insertRow
( [in] long Index
, [in] any Heading
, [in] sequence
< any
> Data
)
61 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
63 /** inserts multiple rows of data into the model.
65 denotes the position at which the rows are to be inserted
67 denotes the headings of the to-be-added rows.
69 specifies the data of the rows to be added.
70 @throws ::com::sun::star::lang::IllegalArgumentException
71 if <code>Titles</code> and <code>Data</code> are of different length.
72 @throws ::com::sun::star::lang::IndexOutOfBoundsException
73 if <code>Index</code> is smaller than <code>0</code> or greater than the number of
76 void insertRows
( [in] long Index
, [in] sequence
< any
> Headings
, [in] sequence
< sequence
< any
> > Data
)
77 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
78 , ::com
::sun
::star
::lang
::IllegalArgumentException
);
80 /** removes a row of data from the model
83 the index of the row that should be removed.
84 @throws ::com::sun::star::lang::IndexOutOfBoundsException
85 if the given index is invalid
87 void removeRow
( [in] long RowIndex
)
88 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
90 /** Removes all rows from the model.
94 /** updates the content of the given cell
96 the column index of the to-be-updated cell
98 the row index of the to-be-updated cell
100 the new value of the cell.
101 @throws ::com::sun::star::lang::IndexOutOfBoundsException
102 if the row or column index is invalid
104 void updateCellData
( [in] long ColumnIndex
, [in] long RowIndex
, [in] any Value
)
105 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
107 /** updates the content of a given row.
109 <p>The change in the data model will be notified to registered listeners via
110 XGridDataListener::dataChanged(). The GridDataEvent::FirstColumn and
111 GridDataEvent::LastColumn will denote the smallest respectively largest column
112 index from ColumnIndexes.</p>
115 contains the column indexes of the cells, which should be updated
117 contains the index of the row whose data is to be updated
119 specifies the new values of the cells.
120 @throws ::com::sun::star::lang::IndexOutOfBoundsException
121 if one of the row indexes or the column index is invalid
122 @throws ::com::sun::star::lang::IllegalArgumentException
123 if the lengths of the <code>ColumnIndexes</code> and <code>Values</code> sequences are not equal.
125 void updateRowData
( [in] sequence
< long > ColumnIndexes
, [in] long RowIndex
, [in] sequence
< any
> Values
)
126 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
127 , ::com
::sun
::star
::lang
::IllegalArgumentException
);
129 /** sets a new title for a given row.
131 @throws ::com::sun::star::lang::IndexOutOfBoundsException
132 if the given index does not denote a valid row.
135 updateRowHeading
( [in] long RowIndex
, [in] any Heading
)
136 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
138 /** updates the tooltip to be displayed for a given cell
140 @see XGridDataModel::getCellToolTip
142 void updateCellToolTip
( [in] long ColumnIndex
, [in] long RowIndex
, [in] any Value
)
143 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
145 /** updates the tooltip for all cells of a given row
147 <p>Effectively this method is a shortcut for calling updateCellToolTip() multiple
148 times in a row, for all cells of a given row.</p>
150 @see XGridDataModel::getCellToolTip
151 @see updateCellToolTip
153 void updateRowToolTip
( [in] long RowIndex
, [in] any Value
)
154 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
157 /** registers listener to be notified of data changes in the model
159 specifies the listener to register
161 void addGridDataListener
( [in] XGridDataListener Listener
);
164 /** revokes a listener which was previously registered via addGridDataListener()
166 specifies the listener to revoke.
168 void removeGridDataListener
( [in] XGridDataListener Listener
);
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */