Bump for 3.6-28
[LibreOffice.git] / offapi / com / sun / star / awt / XItemList.idl
blob1fb09f3b1ec037d0389901158b22a2b23f31c060
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
44 interface XItemList
46 /** is the number of items in the list
48 [attribute, readonly] long ItemCount;
50 /** inserts a new item into the list
52 @param Position
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>.
56 @param ItemText
57 the text of the item to be inserted.
59 @param ItemImageURL
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.
65 void insertItem(
66 [in] long Position,
67 [in] string ItemText,
68 [in] string ItemImageURL
70 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
72 /** inserts an item which has only a text, but no image
74 @param Position
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>.
78 @param ItemText
79 the text of the item to be inserted.
81 @throws ::com::sun::star::lang::IndexOutOfBoundsException
82 if <code>Position</code> is invalid.
84 void insertItemText(
85 [in] long Position,
86 [in] string ItemText
88 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
90 /** inserts an item which has only an image, but no text
92 @param Position
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>.
96 @param ItemImageURL
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(
103 [in] long Position,
104 [in] string ItemImageURL
106 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
108 /** removes an item from the list
110 @param Position
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.
117 void removeItem(
118 [in] long Position
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
128 @param Position
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>.
132 @param ItemText
133 the new text of the item
135 @throws ::com::sun::star::lang::IndexOutOfBoundsException
136 if <code>Position</code> is invalid.
138 void setItemText(
139 [in] long Position,
140 [in] string ItemText
142 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
144 /** sets a new image for an existing item
146 @param Position
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>.
150 @param ItemImageURL
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.
156 void setItemImage(
157 [in] long Position,
158 [in] string ItemImageURL
160 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
162 /** sets both a new position and text for an existing item
164 @param Position
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>.
168 @param ItemText
169 the new text of the item
171 @param ItemImageURL
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(
178 [in] long Position,
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>
189 @param Position
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>.
193 @param ItemData
194 the data to associate with the list item
196 @throws ::com::sun::star::lang::IndexOutOfBoundsException
197 if <code>Position</code> is invalid.
199 @see getItemData
201 void setItemData(
202 [in] long Position,
203 [in] any ItemData
205 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
207 /** retrieves the text of an existing item
209 @param Position
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.
216 string getItemText(
217 [in] long Position
219 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
221 /** retrieves the URL of the image of an existing item
223 @param Position
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.
230 string getItemImage(
231 [in] long Position
233 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
235 /** retrieves both the text and the image URL of an existing item
237 @param Position
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 >
245 getItemTextAndImage(
246 [in] long Position
248 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
250 /** retrieves the implementation dependent value associated with the given list item.
251 @see setItemData
253 @param Position
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.
260 @see setItemData
262 any getItemData(
263 [in] long Position
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 > >
270 getAllItems();
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 //==================================================================================================================
283 }; }; }; };
285 //==================================================================================================================
287 #endif
289 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */