Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / awt / XItemList.idl
blob7f4cf3831a1965bc63325a22190f484d9f17c2e7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
34 interface XItemList
36 /** is the number of items in the list
38 [attribute, readonly] long ItemCount;
40 /** inserts a new item into the list
42 @param Position
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.
46 @param ItemText
47 the text of the item to be inserted.
49 @param ItemImageURL
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.
55 void insertItem(
56 [in] long Position,
57 [in] string ItemText,
58 [in] string ItemImageURL
60 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
62 /** inserts an item which has only a text, but no image
64 @param Position
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.
68 @param ItemText
69 the text of the item to be inserted.
71 @throws ::com::sun::star::lang::IndexOutOfBoundsException
72 if <code>Position</code> is invalid.
74 void insertItemText(
75 [in] long Position,
76 [in] string ItemText
78 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
80 /** inserts an item which has only an image, but no text
82 @param Position
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.
86 @param ItemImageURL
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.
92 void insertItemImage(
93 [in] long Position,
94 [in] string ItemImageURL
96 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
98 /** removes an item from the list
100 @param Position
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.
107 void removeItem(
108 [in] long Position
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
118 @param Position
119 the position of the item whose text is to be changed. Must be greater or equal to 0, and
120 lesser than #ItemCount.
122 @param ItemText
123 the new text of the item
125 @throws ::com::sun::star::lang::IndexOutOfBoundsException
126 if <code>Position</code> is invalid.
128 void setItemText(
129 [in] long Position,
130 [in] string ItemText
132 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
134 /** sets a new image for an existing item
136 @param Position
137 the position of the item whose image is to be changed. Must be greater or equal to 0, and
138 lesser than #ItemCount.
140 @param ItemImageURL
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.
146 void setItemImage(
147 [in] long Position,
148 [in] string ItemImageURL
150 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
152 /** sets both a new position and text for an existing item
154 @param Position
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.
158 @param ItemText
159 the new text of the item
161 @param ItemImageURL
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(
168 [in] long Position,
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>
179 @param Position
180 the position of the item whose data value should be set. Must be greater or equal to 0, and
181 lesser than #ItemCount.
183 @param ItemData
184 the data to associate with the list item
186 @throws ::com::sun::star::lang::IndexOutOfBoundsException
187 if <code>Position</code> is invalid.
189 @see getItemData
191 void setItemData(
192 [in] long Position,
193 [in] any ItemData
195 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
197 /** retrieves the text of an existing item
199 @param Position
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.
206 string getItemText(
207 [in] long Position
209 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
211 /** retrieves the URL of the image of an existing item
213 @param Position
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.
220 string getItemImage(
221 [in] long Position
223 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
225 /** retrieves both the text and the image URL of an existing item
227 @param Position
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 >
235 getItemTextAndImage(
236 [in] long Position
238 raises ( ::com::sun::star::lang::IndexOutOfBoundsException );
240 /** retrieves the implementation dependent value associated with the given list item.
241 @param Position
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.
248 @see setItemData
250 any getItemData(
251 [in] long Position
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 > >
258 getAllItems();
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 );
270 }; }; }; };
273 #endif
275 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */