1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XListBox.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_awt_XListBox_idl__
31 #define __com_sun_star_awt_XListBox_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_awt_XItemListener_idl__
38 #include
<com
/sun
/star
/awt
/XItemListener.idl
>
41 #ifndef __com_sun_star_awt_XActionListener_idl__
42 #include
<com
/sun
/star
/awt
/XActionListener.idl
>
46 //=============================================================================
48 module com
{ module sun
{ module star
{ module awt
{
50 //=============================================================================
52 /** gives access to the items of a list box and makes it possible to
53 register item and action event listeners.
55 published
interface XListBox
: com
::sun
::star
::uno
::XInterface
57 //-------------------------------------------------------------------------
59 /** registers a listener for item events.
61 [oneway
] void addItemListener
( [in] com
::sun
::star
::awt
::XItemListener l
);
63 //-------------------------------------------------------------------------
65 /** unregisters a listener for item events.
67 [oneway
] void removeItemListener
( [in] com
::sun
::star
::awt
::XItemListener l
);
69 //-------------------------------------------------------------------------
71 /** registers a listener for action events.
73 [oneway
] void addActionListener
( [in] com
::sun
::star
::awt
::XActionListener l
);
75 //-------------------------------------------------------------------------
77 /** unregisters a listener for action events.
79 [oneway
] void removeActionListener
( [in] com
::sun
::star
::awt
::XActionListener l
);
81 //-------------------------------------------------------------------------
83 /** adds an item at the specified position.
85 [oneway
] void addItem
( [in] string aItem
,
88 //-------------------------------------------------------------------------
90 /** adds multiple items at the specified position.
92 [oneway
] void addItems
( [in] sequence
<string> aItems
,
95 //-------------------------------------------------------------------------
97 /** removes a number of items at the specified position.
99 [oneway
] void removeItems
( [in] short nPos
,
102 //-------------------------------------------------------------------------
104 /** returns the number of items in the listbox.
106 short getItemCount
();
108 //-------------------------------------------------------------------------
110 /** returns the item at the specified position.
112 string getItem
( [in] short nPos
);
114 //-------------------------------------------------------------------------
116 /** returns all items of the list box.
118 sequence
<string> getItems
();
120 //-------------------------------------------------------------------------
122 /** returns the position of the currently selected item.
124 short getSelectedItemPos
();
126 //-------------------------------------------------------------------------
128 /** returns the positions of all currently selected items.
130 sequence
<short> getSelectedItemsPos
();
132 //-------------------------------------------------------------------------
134 /** returns the currently selected item.
136 string getSelectedItem
();
138 //-------------------------------------------------------------------------
140 /** returns all currently selected items.
142 sequence
<string> getSelectedItems
();
144 //-------------------------------------------------------------------------
146 /** selects/deselects the item at the specified position.
148 [oneway
] void selectItemPos
( [in] short nPos
,
149 [in] boolean bSelect
);
151 //-------------------------------------------------------------------------
153 /** selects/deselects multiple items at the specified positions.
155 [oneway
] void selectItemsPos
( [in] sequence
<short> aPositions
,
156 [in] boolean bSelect
);
158 //-------------------------------------------------------------------------
160 /** selects/deselects the specified item.
162 [oneway
] void selectItem
( [in] string aItem
,
163 [in] boolean bSelect
);
165 //-------------------------------------------------------------------------
167 /** returns <true/> if multiple items can be selected,
168 <false/> if only one item can be selected.
170 boolean isMutipleMode
();
172 //-------------------------------------------------------------------------
174 /** determines if only a single item or multiple items can be selected.
176 [oneway
] void setMultipleMode
( [in] boolean bMulti
);
178 //-------------------------------------------------------------------------
180 /** returns the number of visible lines in drop down mode.
182 short getDropDownLineCount
();
184 //-------------------------------------------------------------------------
186 /** sets the number of visible lines for drop down mode.
188 [oneway
] void setDropDownLineCount
( [in] short nLines
);
190 //-------------------------------------------------------------------------
192 /** makes the item at the specified position visible by scrolling.
194 [oneway
] void makeVisible
( [in] short nEntry
);
198 //=============================================================================