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 .
21 module com
{ module sun
{ module star
{ module awt
{
23 interface XItemListListener
;
26 /** provides convenient access to the list of items in a list box
30 /** is the number of items in the list
32 [attribute
, readonly] long ItemCount
;
34 /** inserts a new item into the list
37 the position at which the item should be inserted. Must be greater or equal to 0, and
38 lesser than or equal to #ItemCount.
41 the text of the item to be inserted.
44 the URL of the image to display for the item
46 @throws ::com::sun::star::lang::IndexOutOfBoundsException
47 if <code>Position</code> is invalid.
52 [in] string ItemImageURL
54 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
56 /** inserts an item which has only a text, but no image
59 the position at which the item should be inserted. Must be greater or equal to 0, and
60 lesser than or equal to #ItemCount.
63 the text of the item to be inserted.
65 @throws ::com::sun::star::lang::IndexOutOfBoundsException
66 if <code>Position</code> is invalid.
72 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
74 /** inserts an item which has only an image, but no text
77 the position at which the item should be inserted. Must be greater or equal to 0, and
78 lesser than or equal to #ItemCount.
81 the URL of the image to display for the item
83 @throws ::com::sun::star::lang::IndexOutOfBoundsException
84 if <code>Position</code> is invalid.
88 [in] string ItemImageURL
90 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
92 /** removes an item from the list
95 the position of the item which should be removed. Must be greater or equal to 0, and
96 lesser than #ItemCount.
98 @throws ::com::sun::star::lang::IndexOutOfBoundsException
99 if <code>Position</code> is invalid.
104 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
106 /** removes all items from the list
108 void removeAllItems
();
110 /** sets a new text for an existing item
113 the position of the item whose text is to be changed. Must be greater or equal to 0, and
114 lesser than #ItemCount.
117 the new text of the item
119 @throws ::com::sun::star::lang::IndexOutOfBoundsException
120 if <code>Position</code> is invalid.
126 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
128 /** sets a new image for an existing item
131 the position of the item whose image is to be changed. Must be greater or equal to 0, and
132 lesser than #ItemCount.
135 the new URL of the image to display for the item
137 @throws ::com::sun::star::lang::IndexOutOfBoundsException
138 if <code>Position</code> is invalid.
142 [in] string ItemImageURL
144 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
146 /** sets both a new position and text for an existing item
149 the position of the item whose text and image is to be changed. Must be greater or equal to 0, and
150 lesser than #ItemCount.
153 the new text of the item
156 the new URL of the image to display for the item
158 @throws ::com::sun::star::lang::IndexOutOfBoundsException
159 if <code>Position</code> is invalid.
161 void setItemTextAndImage
(
163 [in] string ItemText
,
164 [in] string ItemImageURL
166 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
168 /** associates an implementation dependent value with the given list item.
170 <p>You can use this to store data for an item which does not interfere with the displayed
171 text and image, but can be used by the client of the list box for an arbitrary purpose.</p>
174 the position of the item whose data value should be set. Must be greater or equal to 0, and
175 lesser than #ItemCount.
178 the data to associate with the list item
180 @throws ::com::sun::star::lang::IndexOutOfBoundsException
181 if <code>Position</code> is invalid.
189 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
191 /** retrieves the text of an existing item
194 the position of the item whose text should be retrieved. Must be greater or equal to 0, and
195 lesser than #ItemCount.
197 @throws ::com::sun::star::lang::IndexOutOfBoundsException
198 if <code>Position</code> is invalid.
203 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
205 /** retrieves the URL of the image of an existing item
208 the position of the item whose image should be retrieved. Must be greater or equal to 0, and
209 lesser than #ItemCount.
211 @throws ::com::sun::star::lang::IndexOutOfBoundsException
212 if <code>Position</code> is invalid.
217 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
219 /** retrieves both the text and the image URL of an existing item
222 the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and
223 lesser than #ItemCount.
225 @throws ::com::sun::star::lang::IndexOutOfBoundsException
226 if <code>Position</code> is invalid.
228 ::com
::sun
::star
::beans
::Pair
< string, string >
232 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
234 /** retrieves the implementation dependent value associated with the given list item.
236 the position of the item whose data value should be retrieved. Must be greater or equal to 0, and
237 lesser than #ItemCount.
239 @throws ::com::sun::star::lang::IndexOutOfBoundsException
240 if <code>Position</code> is invalid.
247 raises
( ::com
::sun
::star
::lang
::IndexOutOfBoundsException
);
249 /** retrieves the texts and images of all items in the list
251 sequence
< ::com
::sun
::star
::beans
::Pair
< string, string > >
254 /** registers a listener which is notified about changes in the item list.
256 void addItemListListener
( [in] XItemListListener Listener
);
258 /** revokes a listener which is notified about changes in the item list.
260 void removeItemListListener
( [in] XItemListListener Listener
);
267 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */