Bump for 3.6-28
[LibreOffice.git] / offapi / com / sun / star / awt / grid / XGridColumnModel.idl
blob5c6ba46925658566c993317b5bd843719cc2b675
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef __com_sun_star_awt_grid_XGridColumnModel_idl__
29 #define __com_sun_star_awt_grid_XGridColumnModel_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #include <com/sun/star/lang/XComponent.idl>
33 #include <com/sun/star/util/XCloneable.idl>
34 #include <com/sun/star/awt/grid/XGridColumn.idl>
35 #include <com/sun/star/container/XContainer.idl>
36 #include <com/sun/star/lang/IndexOutOfBoundsException.idl>
37 #include <com/sun/star/lang/IllegalArgumentException.idl>
39 //=============================================================================
41 module com { module sun { module star { module awt { module grid {
43 //=============================================================================
45 /** An instance of this interface is used by the <type>UnoControlGrid</type> to
46 retrieve the column structure that is displayed in the actual control.
48 If you do not need your own model implementation, you can also use the <type>DefaultGridColumnModel</type>.
50 @since OOo 3.3
52 interface XGridColumnModel
54 /** implements life time control for the component
56 interface ::com::sun::star::lang::XComponent;
58 /** allows to register listeners to be notified when columns are inserted or removed
60 interface ::com::sun::star::container::XContainer;
62 /** allows cloning the complete column model
64 interface ::com::sun::star::util::XCloneable;
66 /** Returns the number of columns.
68 @returns
69 the number of columns.
71 long getColumnCount();
73 /** creates a new column for use with the column model.
75 <p>The newly created column is not yet inserted into the column container, you need to call <member>addColumn</member>
76 after you initialized the column object.</p>
78 XGridColumn
79 createColumn();
81 /** Adds a column to the model.
83 <p>You should use the <member>createColumn</member> member to create a new column. This gives
84 implementations of the <code>XGridColumnModel</code> interface the possibility to provide own column
85 implementations which extend the basic <type>GridColumn</type> type.</p>
87 <p>As soon as the column has been inserted into the model, the model takes ownership of it. This means when the
88 column is removed, or when the column model is disposed, the grid column is disposed as well.</p>
90 @param column
91 the column to add to the model.
92 @returns
93 the index of new created column.
95 @throws ::com::sun::star::lang::IllegalArgumentException
96 if the given column is not a valid element for the column container, or if it is <NULL/>.
98 long addColumn( [in] XGridColumn column )
99 raises ( ::com::sun::star::lang::IllegalArgumentException );
101 /** removes a column from the model
103 <p>The column object will be disposed upon removal.</p>
105 @param ColumnIndex
106 denotes the index of the column to remove
107 @throws ::com::sun::star::lang::IndexOutOfBoundsException
108 if <code>ColumnIndex</code> does not denote a valid column index.
110 void removeColumn( [in] long ColumnIndex )
111 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
113 /** Returns all columns of the model.
114 @returns
115 all columns associated with the model in a sequence of <type>XGridColumn</type>.
117 sequence<XGridColumn> getColumns();
119 /** Returns a specific column.
120 @param index
121 the position of the requested column.
122 @returns
123 the requested column.
125 XGridColumn getColumn( [in] long index)
126 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
128 /** Fills the model with the given number of default columns
130 <p>Existing columns will be removed before adding new columns. Listeners at the column model will
131 be notified one <member scope="com::sun::star::container">XContainerListener::elementRemoved</member> event
132 for each removed column, and one <member scope="com::sun::star::container">XContainerListener::elementInserted</member>
133 event for each insertion.</p>
135 @param elements
136 the number of default columns that should be set.
138 void setDefaultColumns([in] long elements);
141 //=============================================================================
143 }; }; }; }; };
145 #endif
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */