LibreOffice
LibreOffice 24.2 SDK API Reference
|
An instance of this interface is used by the UnoControlGrid to retrieve the column structure that is displayed in the actual control. More...
import"XGridColumnModel.idl";
Exported Interfaces | |
interface | ::com::sun::star::lang::XComponent |
implements life time control for the component More... | |
interface | ::com::sun::star::container::XContainer |
allows to register listeners to be notified when columns are inserted or removed More... | |
interface | ::com::sun::star::util::XCloneable |
allows cloning the complete column model More... | |
Public Member Functions | |
long | getColumnCount () |
Returns the number of columns. More... | |
XGridColumn | createColumn () |
creates a new column for use with the column model. More... | |
long | addColumn ([in] XGridColumn column) raises ( ::com::sun::star::lang::IllegalArgumentException ) |
Adds a column to the model. More... | |
void | removeColumn ([in] long ColumnIndex) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ) |
removes a column from the model More... | |
sequence< XGridColumn > | getColumns () |
Returns all columns of the model. More... | |
XGridColumn | getColumn ([in] long index) raises ( ::com::sun::star::lang::IndexOutOfBoundsException ) |
Returns a specific column. More... | |
void | setDefaultColumns ([in] long elements) |
Fills the model with the given number of default columns. More... | |
Public Member Functions inherited from XComponent | |
void | dispose () |
The owner of an object calls this method to explicitly free all resources kept by this object and thus break cyclic references. More... | |
void | addEventListener ([in] XEventListener xListener) |
adds an event listener to the object. More... | |
void | removeEventListener ([in] XEventListener aListener) |
removes an event listener from the listener list. More... | |
Public Member Functions inherited from XInterface | |
any | queryInterface ([in] type aType) |
queries for a new interface to an existing UNO object. More... | |
void | acquire () |
increases the reference counter by one. More... | |
void | release () |
decreases the reference counter by one. More... | |
Public Member Functions inherited from XContainer | |
void | addContainerListener ([in] com::sun::star::container::XContainerListener xListener) |
adds the specified listener to receive events when elements are inserted or removed. More... | |
void | removeContainerListener ([in] com::sun::star::container::XContainerListener xListener) |
removes the specified listener so it does not receive any events from this container. More... | |
Public Member Functions inherited from XCloneable | |
com::sun::star::util::XCloneable | createClone () |
creates a copy of the object. More... | |
An instance of this interface is used by the UnoControlGrid to retrieve the column structure that is displayed in the actual control.
If you do not need your own model implementation, you can also use the DefaultGridColumnModel.
interface ::com::sun::star::container::XContainer |
allows to register listeners to be notified when columns are inserted or removed
interface ::com::sun::star::lang::XComponent |
implements life time control for the component
interface ::com::sun::star::util::XCloneable |
allows cloning the complete column model
long addColumn | ( | [in] XGridColumn | column | ) | |
raises | ( | ::com::sun::star::lang::IllegalArgumentException | |||
) |
Adds a column to the model.
You should use the createColumn() member to create a new column. This gives implementations of the XGridColumnModel
interface the possibility to provide own column implementations which extend the basic GridColumn type.
As soon as the column has been inserted into the model, the model takes ownership of it. This means when the column is removed, or when the column model is disposed, the grid column is disposed as well.
column | the column to add to the model. |
com::sun::star::lang::IllegalArgumentException | if the given column is not a valid element for the column container, or if it is NULL . |
XGridColumn createColumn | ( | ) |
creates a new column for use with the column model.
The newly created column is not yet inserted into the column container, you need to call addColumn() after you initialized the column object.
XGridColumn getColumn | ( | [in] long | index | ) | |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException | |||
) |
Returns a specific column.
index | the position of the requested column. |
long getColumnCount | ( | ) |
Returns the number of columns.
sequence<XGridColumn> getColumns | ( | ) |
Returns all columns of the model.
void removeColumn | ( | [in] long | ColumnIndex | ) | |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException | |||
) |
removes a column from the model
The column object will be disposed upon removal.
ColumnIndex | denotes the index of the column to remove |
com::sun::star::lang::IndexOutOfBoundsException | if ColumnIndex does not denote a valid column index. |
void setDefaultColumns | ( | [in] long | elements | ) |
Fills the model with the given number of default columns.
Existing columns will be removed before adding new columns. Listeners at the column model will be notified one com::sun::star::container::XContainerListener::elementRemoved() event for each removed column, and one com::sun::star::container::XContainerListener::elementInserted() event for each insertion.
elements | the number of default columns that should be set. |