1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_awt_grid_XGridColumn_idl__
24#define __com_sun_star_awt_grid_XGridColumn_idl__
25
26#include <com/sun/star/lang/XComponent.idl>
27#include <com/sun/star/style/HorizontalAlignment.idl>
28#include <com/sun/star/lang/IllegalArgumentException.idl>
29#include <com/sun/star/awt/grid/XGridColumnListener.idl>
30#include <com/sun/star/util/XCloneable.idl>
31
32//=============================================================================
33
34module com {  module sun {  module star {  module awt {  module grid {
35
36//=============================================================================
37
38/** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control
39    @since OpenOffice 3.3
40 */
41published interface XGridColumn
42{
43    /** implements life time control for the component
44    */
45    interface ::com::sun::star::lang::XComponent;
46
47    /** allows cloning the complete grid column
48    */
49    interface ::com::sun::star::util::XCloneable;
50
51    /** specifies an identifier of the column
52
53        <p>This identifier will not be evaluated by the grid control, or its model. It is merely for clients
54        to identify particular columns.</p>
55    */
56    [attribute] any Identifier;
57
58    /** specifies the current width of the column.
59    */
60    [attribute] long ColumnWidth;
61
62    /** specifies the minimal width the column can have.
63    */
64    [attribute] long MinWidth;
65
66    /** specifies the maximal width the column can have.
67    */
68    [attribute] long MaxWidth;
69
70    /** controls whether or not the column's width is fixed or not.
71
72        <p>If this is <TRUE/>, the user can interactively change the column's width. Also, the column is subject to
73        auto-resizing, if its <member>Flexibility</member> attribute is greater <code>0</code>.</p>
74    */
75    [attribute] boolean Resizeable;
76
77    /** specifies the flexibility of the column when it is automatically resized due to the grid control as a whole
78        being resized.
79
80        <p>Specify <code>0</code> here if you do not want the column to be resized automatically.</p>
81
82        <p>If a column has a flexibility greater than 0, it is set in relationship to the flexibility of all
83        other such columns, and the respective widths of the columns are changed in the same relationship.</p>
84
85        <p>Note that a column's flexibility is ignored if its <member>Resizeable</member> attribute is
86        <FALSE/>.</p>
87
88        <p>A column's flexibility cannot be negative, attempts to set a negative value will raise an exception.</p>
89    */
90    [attribute] long Flexibility
91    {
92        set raises ( ::com::sun::star::lang::IllegalArgumentException );
93    };
94
95    /** Specifies the horizontal alignment of the content in the control.
96     */
97    [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign;
98
99    /** A title is displayed in the colum header row if <method>UnoControlGridModel::ShowColumnHeader</method> is set to <true/>**/
100    [attribute] string Title;
101
102    /** is the help text associated with the column.
103
104        <p>A grid control will usually display a column's help text as tooltip.</p>
105    */
106    [attribute] string HelpText;
107
108    /** denotes the index of the column within the grid column model it belongs to
109
110        <p>If the column is not yet part of a column model, <code>Index</code> is -1.</p>
111    */
112    [attribute, readonly] long Index;
113
114    /** denotes the index of the data column which should be used to fetch this grid column's data
115
116        <p>A grid control has a column model and a data model, both containing a possibly different number of columns.
117        The <code>DataColumnIndex</code> attribute defines the index of the column within the data model, which should
118        be used to retrieve actual data.</p>
119
120        <p>Using this, you can do runtime changes to the column model, i.e. insertion and removal of columns, without
121        necessarily needing to adjust the data model, too.</p>
122
123        <p>If <code>DataColumnIndex</code> is negative, the it will be ignored, then the column's index within its
124        column model, as determined by the <member>Index</member> attribute, will be used.</p>
125    */
126    [attribute] long DataColumnIndex;
127
128    /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes.
129        @param Listener
130            the listener to add.
131    */
132    void addGridColumnListener( [in] XGridColumnListener  listener);
133
134    //-------------------------------------------------------------------------
135
136    /** Removes a listener previously added with <method>addColumnListener()</method>.
137        @param Listener
138            the listener to remove.
139    */
140    void removeGridColumnListener( [in] XGridColumnListener listener);
141};
142
143//=============================================================================
144
145}; }; }; }; };
146
147#endif
148