1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef __offapi_com_sun_star_awt_XItemList_idl__
29 #define __offapi_com_sun_star_awt_XItemList_idl__
31 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
32 #include
<com
/sun
/star
/beans
/Pair.idl
>
34 //==================================================================================================================
36 module com
{ module sun
{ module star
{ module awt
{
38 interface XItemListListener
;
40 //==================================================================================================================
42 /** provides convenient access to the list of items in a list box
46 /** is the number of items in the list
48 [attribute
, readonly] long ItemCount
;
50 /** inserts a new item into the list
53 the position at which the item should be inserted. Must be greater or equal to 0, and
54 lesser than or equal to <member>ItemCount</member>.
57 the text of the item to be inserted.
60 the URL of the image to display for the item
62 @throws ::com::sun::star::lang::IndexOutOfBoundsException
63 if <code>Position</code> is invalid.
68 [in] string ItemImageURL
70 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
72 /** inserts an item which has only a text, but no image
75 the position at which the item should be inserted. Must be greater or equal to 0, and
76 lesser than or equal to <member>ItemCount</member>.
79 the text of the item to be inserted.
81 @throws ::com::sun::star::lang::IndexOutOfBoundsException
82 if <code>Position</code> is invalid.
88 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
90 /** inserts an item which has only an image, but no text
93 the position at which the item should be inserted. Must be greater or equal to 0, and
94 lesser than or equal to <member>ItemCount</member>.
97 the URL of the image to display for the item
99 @throws ::com::sun::star::lang::IndexOutOfBoundsException
100 if <code>Position</code> is invalid.
102 void insertItemImage
(
104 [in] string ItemImageURL
106 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
108 /** removes an item from the list
111 the position of the item which should be removed. Must be greater or equal to 0, and
112 lesser than <member>ItemCount</member>.
114 @throws ::com::sun::star::lang::IndexOutOfBoundsException
115 if <code>Position</code> is invalid.
120 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
122 /** removes all items from the list
124 void removeAllItems
();
126 /** sets a new text for an existing item
129 the position of the item whose text is to be changed. Must be greater or equal to 0, and
130 lesser than <member>ItemCount</member>.
133 the new text of the item
135 @throws ::com::sun::star::lang::IndexOutOfBoundsException
136 if <code>Position</code> is invalid.
142 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
144 /** sets a new image for an existing item
147 the position of the item whose image is to be changed. Must be greater or equal to 0, and
148 lesser than <member>ItemCount</member>.
151 the new URL of the image to display for the item
153 @throws ::com::sun::star::lang::IndexOutOfBoundsException
154 if <code>Position</code> is invalid.
158 [in] string ItemImageURL
160 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
162 /** sets both a new position and text for an existing item
165 the position of the item whose text and image is to be changed. Must be greater or equal to 0, and
166 lesser than <member>ItemCount</member>.
169 the new text of the item
172 the new URL of the image to display for the item
174 @throws ::com::sun::star::lang::IndexOutOfBoundsException
175 if <code>Position</code> is invalid.
177 void setItemTextAndImage
(
179 [in] string ItemText
,
180 [in] string ItemImageURL
182 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
184 /** associates an implementation dependent value with the given list item.
186 <p>You can use this to store data for an item which does not interfere with the displayed
187 text and image, but can be used by the client of the list box for an arbitrary purpose.</p>
190 the position of the item whose data value should be set. Must be greater or equal to 0, and
191 lesser than <member>ItemCount</member>.
194 the data to associate with the list item
196 @throws ::com::sun::star::lang::IndexOutOfBoundsException
197 if <code>Position</code> is invalid.
205 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
207 /** retrieves the text of an existing item
210 the position of the item whose text should be retrieved. Must be greater or equal to 0, and
211 lesser than <member>ItemCount</member>.
213 @throws ::com::sun::star::lang::IndexOutOfBoundsException
214 if <code>Position</code> is invalid.
219 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
221 /** retrieves the URL of the image of an existing item
224 the position of the item whose image should be retrieved. Must be greater or equal to 0, and
225 lesser than <member>ItemCount</member>.
227 @throws ::com::sun::star::lang::IndexOutOfBoundsException
228 if <code>Position</code> is invalid.
233 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
235 /** retrieves both the text and the image URL of an existing item
238 the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and
239 lesser than <member>ItemCount</member>.
241 @throws ::com::sun::star::lang::IndexOutOfBoundsException
242 if <code>Position</code> is invalid.
244 ::com
::sun
::star
::beans
::Pair
< string, string >
248 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
250 /** retrieves the implementation dependent value associated with the given list item.
254 the position of the item whose data value should be retrieved. Must be greater or equal to 0, and
255 lesser than <member>ItemCount</member>.
257 @throws ::com::sun::star::lang::IndexOutOfBoundsException
258 if <code>Position</code> is invalid.
265 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
267 /** retrieves the texts and images of all items in the list
269 sequence
< ::com
::sun
::star
::beans
::Pair
< string, string > >
272 /** registers a listener which is notified about changes in the item list.
274 void addItemListListener
( [in] XItemListListener Listener
);
276 /** revokes a listener which is notified about changes in the item list.
278 void removeItemListListener
( [in] XItemListListener Listener
);
281 //==================================================================================================================
285 //==================================================================================================================
289 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */