1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_awt_XItemList_idl__
21 #define __com_sun_star_awt_XItemList_idl__
23 #include
<com
/sun
/star
/lang
/IndexOutOfBoundsException.idl
>
24 #include
<com
/sun
/star
/beans
/Pair.idl
>
27 module com
{ module sun
{ module star
{ module awt
{
29 interface XItemListListener
;
32 /** provides convenient access to the list of items in a list box
36 /** is the number of items in the list
38 [attribute
, readonly] long ItemCount
;
40 /** inserts a new item into the list
43 the position at which the item should be inserted. Must be greater or equal to 0, and
44 lesser than or equal to #ItemCount.
47 the text of the item to be inserted.
50 the URL of the image to display for the item
52 @throws ::com::sun::star::lang::IndexOutOfBoundsException
53 if <code>Position</code> is invalid.
58 [in] string ItemImageURL
60 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
62 /** inserts an item which has only a text, but no image
65 the position at which the item should be inserted. Must be greater or equal to 0, and
66 lesser than or equal to #ItemCount.
69 the text of the item to be inserted.
71 @throws ::com::sun::star::lang::IndexOutOfBoundsException
72 if <code>Position</code> is invalid.
78 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
80 /** inserts an item which has only an image, but no text
83 the position at which the item should be inserted. Must be greater or equal to 0, and
84 lesser than or equal to #ItemCount.
87 the URL of the image to display for the item
89 @throws ::com::sun::star::lang::IndexOutOfBoundsException
90 if <code>Position</code> is invalid.
94 [in] string ItemImageURL
96 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
98 /** removes an item from the list
101 the position of the item which should be removed. Must be greater or equal to 0, and
102 lesser than #ItemCount.
104 @throws ::com::sun::star::lang::IndexOutOfBoundsException
105 if <code>Position</code> is invalid.
110 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
112 /** removes all items from the list
114 void removeAllItems
();
116 /** sets a new text for an existing item
119 the position of the item whose text is to be changed. Must be greater or equal to 0, and
120 lesser than #ItemCount.
123 the new text of the item
125 @throws ::com::sun::star::lang::IndexOutOfBoundsException
126 if <code>Position</code> is invalid.
132 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
134 /** sets a new image for an existing item
137 the position of the item whose image is to be changed. Must be greater or equal to 0, and
138 lesser than #ItemCount.
141 the new URL of the image to display for the item
143 @throws ::com::sun::star::lang::IndexOutOfBoundsException
144 if <code>Position</code> is invalid.
148 [in] string ItemImageURL
150 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
152 /** sets both a new position and text for an existing item
155 the position of the item whose text and image is to be changed. Must be greater or equal to 0, and
156 lesser than #ItemCount.
159 the new text of the item
162 the new URL of the image to display for the item
164 @throws ::com::sun::star::lang::IndexOutOfBoundsException
165 if <code>Position</code> is invalid.
167 void setItemTextAndImage
(
169 [in] string ItemText
,
170 [in] string ItemImageURL
172 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
174 /** associates an implementation dependent value with the given list item.
176 <p>You can use this to store data for an item which does not interfere with the displayed
177 text and image, but can be used by the client of the list box for an arbitrary purpose.</p>
180 the position of the item whose data value should be set. Must be greater or equal to 0, and
181 lesser than #ItemCount.
184 the data to associate with the list item
186 @throws ::com::sun::star::lang::IndexOutOfBoundsException
187 if <code>Position</code> is invalid.
195 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
197 /** retrieves the text of an existing item
200 the position of the item whose text should be retrieved. Must be greater or equal to 0, and
201 lesser than #ItemCount.
203 @throws ::com::sun::star::lang::IndexOutOfBoundsException
204 if <code>Position</code> is invalid.
209 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
211 /** retrieves the URL of the image of an existing item
214 the position of the item whose image should be retrieved. Must be greater or equal to 0, and
215 lesser than #ItemCount.
217 @throws ::com::sun::star::lang::IndexOutOfBoundsException
218 if <code>Position</code> is invalid.
223 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
225 /** retrieves both the text and the image URL of an existing item
228 the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and
229 lesser than #ItemCount.
231 @throws ::com::sun::star::lang::IndexOutOfBoundsException
232 if <code>Position</code> is invalid.
234 ::com
::sun
::star
::beans
::Pair
< string, string >
238 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
240 /** retrieves the implementation dependent value associated with the given list item.
242 the position of the item whose data value should be retrieved. Must be greater or equal to 0, and
243 lesser than #ItemCount.
245 @throws ::com::sun::star::lang::IndexOutOfBoundsException
246 if <code>Position</code> is invalid.
253 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
255 /** retrieves the texts and images of all items in the list
257 sequence
< ::com
::sun
::star
::beans
::Pair
< string, string > >
260 /** registers a listener which is notified about changes in the item list.
262 void addItemListListener
( [in] XItemListListener Listener
);
264 /** revokes a listener which is notified about changes in the item list.
266 void removeItemListListener
( [in] XItemListListener Listener
);
275 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */