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#ifndef __com_sun_star_awt_grid_XGridColumn_idl__
24cdf0e10cSrcweir#define __com_sun_star_awt_grid_XGridColumn_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
27cdf0e10cSrcweir#include <com/sun/star/style/HorizontalAlignment.idl>
28cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
29cdf0e10cSrcweir#include <com/sun/star/awt/grid/XGridColumnListener.idl>
30cdf0e10cSrcweir#include <com/sun/star/util/XCloneable.idl>
31cdf0e10cSrcweir
32cdf0e10cSrcweir//=============================================================================
33cdf0e10cSrcweir
34cdf0e10cSrcweirmodule com {  module sun {  module star {  module awt {  module grid {
35cdf0e10cSrcweir
36cdf0e10cSrcweir//=============================================================================
37cdf0e10cSrcweir
38cdf0e10cSrcweir/** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control
39d1e7efc3SJürgen Schmidt    @since OpenOffice 3.3
40cdf0e10cSrcweir */
41cdf0e10cSrcweirpublished interface XGridColumn
42cdf0e10cSrcweir{
43cdf0e10cSrcweir    /** implements life time control for the component
44cdf0e10cSrcweir    */
45cdf0e10cSrcweir    interface ::com::sun::star::lang::XComponent;
46cdf0e10cSrcweir
47cdf0e10cSrcweir    /** allows cloning the complete grid column
48cdf0e10cSrcweir    */
49cdf0e10cSrcweir    interface ::com::sun::star::util::XCloneable;
50cdf0e10cSrcweir
51cdf0e10cSrcweir    /** specifies an identifier of the column
52cdf0e10cSrcweir
53cdf0e10cSrcweir        <p>This identifier will not be evaluated by the grid control, or its model. It is merely for clients
54cdf0e10cSrcweir        to identify particular columns.</p>
55cdf0e10cSrcweir    */
56cdf0e10cSrcweir    [attribute] any Identifier;
57cdf0e10cSrcweir
58cdf0e10cSrcweir    /** specifies the current width of the column.
59cdf0e10cSrcweir    */
60cdf0e10cSrcweir    [attribute] long ColumnWidth;
61cdf0e10cSrcweir
62cdf0e10cSrcweir    /** specifies the minimal width the column can have.
63cdf0e10cSrcweir    */
64cdf0e10cSrcweir    [attribute] long MinWidth;
65cdf0e10cSrcweir
66cdf0e10cSrcweir    /** specifies the maximal width the column can have.
67cdf0e10cSrcweir    */
68cdf0e10cSrcweir    [attribute] long MaxWidth;
69cdf0e10cSrcweir
70cdf0e10cSrcweir    /** controls whether or not the column's width is fixed or not.
71cdf0e10cSrcweir
72cdf0e10cSrcweir        <p>If this is <TRUE/>, the user can interactively change the column's width. Also, the column is subject to
73cdf0e10cSrcweir        auto-resizing, if its <member>Flexibility</member> attribute is greater <code>0</code>.</p>
74cdf0e10cSrcweir    */
75cdf0e10cSrcweir    [attribute] boolean Resizeable;
76cdf0e10cSrcweir
77cdf0e10cSrcweir    /** specifies the flexibility of the column when it is automatically resized due to the grid control as a whole
78cdf0e10cSrcweir        being resized.
79cdf0e10cSrcweir
80cdf0e10cSrcweir        <p>Specify <code>0</code> here if you do not want the column to be resized automatically.</p>
81cdf0e10cSrcweir
82cdf0e10cSrcweir        <p>If a column has a flexibility greater than 0, it is set in relationship to the flexibility of all
83cdf0e10cSrcweir        other such columns, and the respective widths of the columns are changed in the same relationship.</p>
84cdf0e10cSrcweir
85cdf0e10cSrcweir        <p>Note that a column's flexibility is ignored if its <member>Resizeable</member> attribute is
86cdf0e10cSrcweir        <FALSE/>.</p>
87cdf0e10cSrcweir
88cdf0e10cSrcweir        <p>A column's flexibility cannot be negative, attempts to set a negative value will raise an exception.</p>
89cdf0e10cSrcweir    */
90cdf0e10cSrcweir    [attribute] long Flexibility
91cdf0e10cSrcweir    {
92cdf0e10cSrcweir        set raises ( ::com::sun::star::lang::IllegalArgumentException );
93cdf0e10cSrcweir    };
94cdf0e10cSrcweir
95cdf0e10cSrcweir    /** Specifies the horizontal alignment of the content in the control.
96cdf0e10cSrcweir     */
97cdf0e10cSrcweir    [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign;
98cdf0e10cSrcweir
99*a893be29SPedro Giffuni    /** A title is displayed in the column header row if <method>UnoControlGridModel::ShowColumnHeader</method> is set to <true/>**/
100cdf0e10cSrcweir    [attribute] string Title;
101cdf0e10cSrcweir
102cdf0e10cSrcweir    /** is the help text associated with the column.
103cdf0e10cSrcweir
104cdf0e10cSrcweir        <p>A grid control will usually display a column's help text as tooltip.</p>
105cdf0e10cSrcweir    */
106cdf0e10cSrcweir    [attribute] string HelpText;
107cdf0e10cSrcweir
108cdf0e10cSrcweir    /** denotes the index of the column within the grid column model it belongs to
109cdf0e10cSrcweir
110cdf0e10cSrcweir        <p>If the column is not yet part of a column model, <code>Index</code> is -1.</p>
111cdf0e10cSrcweir    */
112cdf0e10cSrcweir    [attribute, readonly] long Index;
113cdf0e10cSrcweir
114cdf0e10cSrcweir    /** denotes the index of the data column which should be used to fetch this grid column's data
115cdf0e10cSrcweir
116cdf0e10cSrcweir        <p>A grid control has a column model and a data model, both containing a possibly different number of columns.
117cdf0e10cSrcweir        The <code>DataColumnIndex</code> attribute defines the index of the column within the data model, which should
118cdf0e10cSrcweir        be used to retrieve actual data.</p>
119cdf0e10cSrcweir
120cdf0e10cSrcweir        <p>Using this, you can do runtime changes to the column model, i.e. insertion and removal of columns, without
121cdf0e10cSrcweir        necessarily needing to adjust the data model, too.</p>
122cdf0e10cSrcweir
123cdf0e10cSrcweir        <p>If <code>DataColumnIndex</code> is negative, the it will be ignored, then the column's index within its
124cdf0e10cSrcweir        column model, as determined by the <member>Index</member> attribute, will be used.</p>
125cdf0e10cSrcweir    */
126cdf0e10cSrcweir    [attribute] long DataColumnIndex;
127cdf0e10cSrcweir
128cdf0e10cSrcweir    /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes.
129cdf0e10cSrcweir        @param Listener
130cdf0e10cSrcweir            the listener to add.
131cdf0e10cSrcweir    */
132cdf0e10cSrcweir    void addGridColumnListener( [in] XGridColumnListener  listener);
133cdf0e10cSrcweir
134cdf0e10cSrcweir    //-------------------------------------------------------------------------
135cdf0e10cSrcweir
136cdf0e10cSrcweir    /** Removes a listener previously added with <method>addColumnListener()</method>.
137cdf0e10cSrcweir        @param Listener
138cdf0e10cSrcweir            the listener to remove.
139cdf0e10cSrcweir    */
140cdf0e10cSrcweir    void removeGridColumnListener( [in] XGridColumnListener listener);
141cdf0e10cSrcweir};
142cdf0e10cSrcweir
143cdf0e10cSrcweir//=============================================================================
144cdf0e10cSrcweir
145cdf0e10cSrcweir}; }; }; }; };
146cdf0e10cSrcweir
147cdf0e10cSrcweir#endif
148