1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_awt_grid_XGridColumn_idl__
28#define __com_sun_star_awt_grid_XGridColumn_idl__
29
30#include <com/sun/star/lang/XComponent.idl>
31#include <com/sun/star/style/HorizontalAlignment.idl>
32#include <com/sun/star/lang/IllegalArgumentException.idl>
33#include <com/sun/star/awt/grid/XGridColumnListener.idl>
34#include <com/sun/star/util/XCloneable.idl>
35
36//=============================================================================
37
38module com {  module sun {  module star {  module awt {  module grid {
39
40//=============================================================================
41
42/** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control
43    @since OOo 3.3
44 */
45published interface XGridColumn
46{
47    /** implements life time control for the component
48    */
49    interface ::com::sun::star::lang::XComponent;
50
51    /** allows cloning the complete grid column
52    */
53    interface ::com::sun::star::util::XCloneable;
54
55    /** specifies an identifier of the column
56
57        <p>This identifier will not be evaluated by the grid control, or its model. It is merely for clients
58        to identify particular columns.</p>
59    */
60    [attribute] any Identifier;
61
62    /** specifies the current width of the column.
63    */
64    [attribute] long ColumnWidth;
65
66    /** specifies the minimal width the column can have.
67    */
68    [attribute] long MinWidth;
69
70    /** specifies the maximal width the column can have.
71    */
72    [attribute] long MaxWidth;
73
74    /** controls whether or not the column's width is fixed or not.
75
76        <p>If this is <TRUE/>, the user can interactively change the column's width. Also, the column is subject to
77        auto-resizing, if its <member>Flexibility</member> attribute is greater <code>0</code>.</p>
78    */
79    [attribute] boolean Resizeable;
80
81    /** specifies the flexibility of the column when it is automatically resized due to the grid control as a whole
82        being resized.
83
84        <p>Specify <code>0</code> here if you do not want the column to be resized automatically.</p>
85
86        <p>If a column has a flexibility greater than 0, it is set in relationship to the flexibility of all
87        other such columns, and the respective widths of the columns are changed in the same relationship.</p>
88
89        <p>Note that a column's flexibility is ignored if its <member>Resizeable</member> attribute is
90        <FALSE/>.</p>
91
92        <p>A column's flexibility cannot be negative, attempts to set a negative value will raise an exception.</p>
93    */
94    [attribute] long Flexibility
95    {
96        set raises ( ::com::sun::star::lang::IllegalArgumentException );
97    };
98
99    /** Specifies the horizontal alignment of the content in the control.
100     */
101    [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign;
102
103    /** A title is displayed in the colum header row if <method>UnoControlGridModel::ShowRowHeader</method> is set to <true/>**/
104    [attribute] string Title;
105
106    /** is the help text associated with the column.
107
108        <p>A grid control will usually display a column's help text as tooltip.</p>
109    */
110    [attribute] string HelpText;
111
112    /** denotes the index of the column within the grid column model it belongs to
113
114        <p>If the column is not yet part of a column model, <code>Index</code> is -1.</p>
115    */
116    [attribute, readonly] long Index;
117
118    /** denotes the index of the data column which should be used to fetch this grid column's data
119
120        <p>A grid control has a column model and a data model, both containing a possibly different number of columns.
121        The <code>DataColumnIndex</code> attribute defines the index of the column within the data model, which should
122        be used to retrieve actual data.</p>
123
124        <p>Using this, you can do runtime changes to the column model, i.e. insertion and removal of columns, without
125        necessarily needing to adjust the data model, too.</p>
126
127        <p>If <code>DataColumnIndex</code> is negative, the it will be ignored, then the column's index within its
128        column model, as determined by the <member>Index</member> attribute, will be used.</p>
129    */
130    [attribute] long DataColumnIndex;
131
132    /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes.
133        @param Listener
134            the listener to add.
135    */
136    void addGridColumnListener( [in] XGridColumnListener  listener);
137
138    //-------------------------------------------------------------------------
139
140    /** Removes a listener previously added with <method>addColumnListener()</method>.
141        @param Listener
142            the listener to remove.
143    */
144    void removeGridColumnListener( [in] XGridColumnListener listener);
145};
146
147//=============================================================================
148
149}; }; }; }; };
150
151#endif
152