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