1*d1766043SAndrew Rist/************************************************************** 2*d1766043SAndrew Rist * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __offapi_com_sun_star_awt_XItemList_idl__ 25cdf0e10cSrcweir#define __offapi_com_sun_star_awt_XItemList_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl> 28cdf0e10cSrcweir#include <com/sun/star/beans/Pair.idl> 29cdf0e10cSrcweir 30cdf0e10cSrcweir//================================================================================================================== 31cdf0e10cSrcweir 32cdf0e10cSrcweirmodule com { module sun { module star { module awt { 33cdf0e10cSrcweir 34cdf0e10cSrcweirpublished interface XItemListListener; 35cdf0e10cSrcweir 36cdf0e10cSrcweir//================================================================================================================== 37cdf0e10cSrcweir 38cdf0e10cSrcweir/** provides convenient access to the list of items in a list box 39cdf0e10cSrcweir */ 40cdf0e10cSrcweirpublished interface XItemList 41cdf0e10cSrcweir{ 42cdf0e10cSrcweir /** is the number of items in the list 43cdf0e10cSrcweir */ 44cdf0e10cSrcweir [attribute, readonly] long ItemCount; 45cdf0e10cSrcweir 46cdf0e10cSrcweir /** inserts a new item into the list 47cdf0e10cSrcweir 48cdf0e10cSrcweir @param Position 49cdf0e10cSrcweir the position at which the item should be inserted. Must be greater or equal to 0, and 50cdf0e10cSrcweir lesser than or equal to <member>ItemCount</member>. 51cdf0e10cSrcweir 52cdf0e10cSrcweir @param ItemText 53cdf0e10cSrcweir the text of the item to be inserted. 54cdf0e10cSrcweir 55cdf0e10cSrcweir @param ItemImageURL 56cdf0e10cSrcweir the URL of the image to display for the item 57cdf0e10cSrcweir 58cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 59cdf0e10cSrcweir if <code>Position</code> is invalid. 60cdf0e10cSrcweir */ 61cdf0e10cSrcweir void insertItem( 62cdf0e10cSrcweir [in] long Position, 63cdf0e10cSrcweir [in] string ItemText, 64cdf0e10cSrcweir [in] string ItemImageURL 65cdf0e10cSrcweir ) 66cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 67cdf0e10cSrcweir 68cdf0e10cSrcweir /** inserts an item which has only a text, but no image 69cdf0e10cSrcweir 70cdf0e10cSrcweir @param Position 71cdf0e10cSrcweir the position at which the item should be inserted. Must be greater or equal to 0, and 72cdf0e10cSrcweir lesser than or equal to <member>ItemCount</member>. 73cdf0e10cSrcweir 74cdf0e10cSrcweir @param ItemText 75cdf0e10cSrcweir the text of the item to be inserted. 76cdf0e10cSrcweir 77cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 78cdf0e10cSrcweir if <code>Position</code> is invalid. 79cdf0e10cSrcweir */ 80cdf0e10cSrcweir void insertItemText( 81cdf0e10cSrcweir [in] long Position, 82cdf0e10cSrcweir [in] string ItemText 83cdf0e10cSrcweir ) 84cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 85cdf0e10cSrcweir 86cdf0e10cSrcweir /** inserts an item which has only an image, but no text 87cdf0e10cSrcweir 88cdf0e10cSrcweir @param Position 89cdf0e10cSrcweir the position at which the item should be inserted. Must be greater or equal to 0, and 90cdf0e10cSrcweir lesser than or equal to <member>ItemCount</member>. 91cdf0e10cSrcweir 92cdf0e10cSrcweir @param ItemImageURL 93cdf0e10cSrcweir the URL of the image to display for the item 94cdf0e10cSrcweir 95cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 96cdf0e10cSrcweir if <code>Position</code> is invalid. 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir void insertItemImage( 99cdf0e10cSrcweir [in] long Position, 100cdf0e10cSrcweir [in] string ItemImageURL 101cdf0e10cSrcweir ) 102cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir /** removes an item from the list 105cdf0e10cSrcweir 106cdf0e10cSrcweir @param Position 107cdf0e10cSrcweir the position of the item which should be removed. Must be greater or equal to 0, and 108cdf0e10cSrcweir lesser than <member>ItemCount</member>. 109cdf0e10cSrcweir 110cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 111cdf0e10cSrcweir if <code>Position</code> is invalid. 112cdf0e10cSrcweir */ 113cdf0e10cSrcweir void removeItem( 114cdf0e10cSrcweir [in] long Position 115cdf0e10cSrcweir ) 116cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 117cdf0e10cSrcweir 118cdf0e10cSrcweir /** removes all items from the list 119cdf0e10cSrcweir */ 120cdf0e10cSrcweir void removeAllItems(); 121cdf0e10cSrcweir 122cdf0e10cSrcweir /** sets a new text for an existing item 123cdf0e10cSrcweir 124cdf0e10cSrcweir @param Position 125cdf0e10cSrcweir the position of the item whose text is to be changed. Must be greater or equal to 0, and 126cdf0e10cSrcweir lesser than <member>ItemCount</member>. 127cdf0e10cSrcweir 128cdf0e10cSrcweir @param ItemText 129cdf0e10cSrcweir the new text of the item 130cdf0e10cSrcweir 131cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 132cdf0e10cSrcweir if <code>Position</code> is invalid. 133cdf0e10cSrcweir */ 134cdf0e10cSrcweir void setItemText( 135cdf0e10cSrcweir [in] long Position, 136cdf0e10cSrcweir [in] string ItemText 137cdf0e10cSrcweir ) 138cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 139cdf0e10cSrcweir 140cdf0e10cSrcweir /** sets a new image for an existing item 141cdf0e10cSrcweir 142cdf0e10cSrcweir @param Position 143cdf0e10cSrcweir the position of the item whose image is to be changed. Must be greater or equal to 0, and 144cdf0e10cSrcweir lesser than <member>ItemCount</member>. 145cdf0e10cSrcweir 146cdf0e10cSrcweir @param ItemImageURL 147cdf0e10cSrcweir the new URL of the image to display for the item 148cdf0e10cSrcweir 149cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 150cdf0e10cSrcweir if <code>Position</code> is invalid. 151cdf0e10cSrcweir */ 152cdf0e10cSrcweir void setItemImage( 153cdf0e10cSrcweir [in] long Position, 154cdf0e10cSrcweir [in] string ItemImageURL 155cdf0e10cSrcweir ) 156cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 157cdf0e10cSrcweir 158cdf0e10cSrcweir /** sets both a new position and text for an existing item 159cdf0e10cSrcweir 160cdf0e10cSrcweir @param Position 161cdf0e10cSrcweir the position of the item whose text and image is to be changed. Must be greater or equal to 0, and 162cdf0e10cSrcweir lesser than <member>ItemCount</member>. 163cdf0e10cSrcweir 164cdf0e10cSrcweir @param ItemText 165cdf0e10cSrcweir the new text of the item 166cdf0e10cSrcweir 167cdf0e10cSrcweir @param ItemImageURL 168cdf0e10cSrcweir the new URL of the image to display for the item 169cdf0e10cSrcweir 170cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 171cdf0e10cSrcweir if <code>Position</code> is invalid. 172cdf0e10cSrcweir */ 173cdf0e10cSrcweir void setItemTextAndImage( 174cdf0e10cSrcweir [in] long Position, 175cdf0e10cSrcweir [in] string ItemText, 176cdf0e10cSrcweir [in] string ItemImageURL 177cdf0e10cSrcweir ) 178cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir /** associates an implementation dependend value with the given list item. 181cdf0e10cSrcweir 182cdf0e10cSrcweir <p>You can use this to store data for an item which does not interfere with the displayed 183cdf0e10cSrcweir text and image, but can be used by the client of the list box for an arbitrary purpose.</p> 184cdf0e10cSrcweir 185cdf0e10cSrcweir @param Position 186cdf0e10cSrcweir the position of the item whose data value should be set. Must be greater or equal to 0, and 187cdf0e10cSrcweir lesser than <member>ItemCount</member>. 188cdf0e10cSrcweir 189cdf0e10cSrcweir @param ItemData 190cdf0e10cSrcweir the data to associate with the list item 191cdf0e10cSrcweir 192cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 193cdf0e10cSrcweir if <code>Position</code> is invalid. 194cdf0e10cSrcweir 195cdf0e10cSrcweir @see getItemData 196cdf0e10cSrcweir */ 197cdf0e10cSrcweir void setItemData( 198cdf0e10cSrcweir [in] long Position, 199cdf0e10cSrcweir [in] any ItemData 200cdf0e10cSrcweir ) 201cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 202cdf0e10cSrcweir 203cdf0e10cSrcweir /** retrieves the text of an existing item 204cdf0e10cSrcweir 205cdf0e10cSrcweir @param Position 206cdf0e10cSrcweir the position of the item whose text should be retrieved. Must be greater or equal to 0, and 207cdf0e10cSrcweir lesser than <member>ItemCount</member>. 208cdf0e10cSrcweir 209cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 210cdf0e10cSrcweir if <code>Position</code> is invalid. 211cdf0e10cSrcweir */ 212cdf0e10cSrcweir string getItemText( 213cdf0e10cSrcweir [in] long Position 214cdf0e10cSrcweir ) 215cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 216cdf0e10cSrcweir 217cdf0e10cSrcweir /** retrieves the URL of the image of an existing item 218cdf0e10cSrcweir 219cdf0e10cSrcweir @param Position 220cdf0e10cSrcweir the position of the item whose image should be retrieved. Must be greater or equal to 0, and 221cdf0e10cSrcweir lesser than <member>ItemCount</member>. 222cdf0e10cSrcweir 223cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 224cdf0e10cSrcweir if <code>Position</code> is invalid. 225cdf0e10cSrcweir */ 226cdf0e10cSrcweir string getItemImage( 227cdf0e10cSrcweir [in] long Position 228cdf0e10cSrcweir ) 229cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 230cdf0e10cSrcweir 231cdf0e10cSrcweir /** retrieves both the text and the image URL of an existing item 232cdf0e10cSrcweir 233cdf0e10cSrcweir @param Position 234cdf0e10cSrcweir the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and 235cdf0e10cSrcweir lesser than <member>ItemCount</member>. 236cdf0e10cSrcweir 237cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 238cdf0e10cSrcweir if <code>Position</code> is invalid. 239cdf0e10cSrcweir */ 240cdf0e10cSrcweir ::com::sun::star::beans::Pair< string, string > 241cdf0e10cSrcweir getItemTextAndImage( 242cdf0e10cSrcweir [in] long Position 243cdf0e10cSrcweir ) 244cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 245cdf0e10cSrcweir 246cdf0e10cSrcweir /** retrieves the implementation dependend value associated with the given list item. 247cdf0e10cSrcweir @see setItemData 248cdf0e10cSrcweir 249cdf0e10cSrcweir @param Position 250cdf0e10cSrcweir the position of the item whose data value should be retrieved. Must be greater or equal to 0, and 251cdf0e10cSrcweir lesser than <member>ItemCount</member>. 252cdf0e10cSrcweir 253cdf0e10cSrcweir @throws ::com::sun::star::lang::IndexOutOfBoundsException 254cdf0e10cSrcweir if <code>Position</code> is invalid. 255cdf0e10cSrcweir 256cdf0e10cSrcweir @see setItemData 257cdf0e10cSrcweir */ 258cdf0e10cSrcweir any getItemData( 259cdf0e10cSrcweir [in] long Position 260cdf0e10cSrcweir ) 261cdf0e10cSrcweir raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); 262cdf0e10cSrcweir 263cdf0e10cSrcweir /** retrieves the texts and images of all items in the list 264cdf0e10cSrcweir */ 265cdf0e10cSrcweir sequence< ::com::sun::star::beans::Pair< string, string > > 266cdf0e10cSrcweir getAllItems(); 267cdf0e10cSrcweir 268cdf0e10cSrcweir /** registers a listener which is notified about changes in the item list. 269cdf0e10cSrcweir */ 270cdf0e10cSrcweir void addItemListListener( [in] XItemListListener Listener ); 271cdf0e10cSrcweir 272cdf0e10cSrcweir /** revokes a listener which is notified about changes in the item list. 273cdf0e10cSrcweir */ 274cdf0e10cSrcweir void removeItemListListener( [in] XItemListListener Listener ); 275cdf0e10cSrcweir}; 276cdf0e10cSrcweir 277cdf0e10cSrcweir//================================================================================================================== 278cdf0e10cSrcweir 279cdf0e10cSrcweir}; }; }; }; 280cdf0e10cSrcweir 281cdf0e10cSrcweir//================================================================================================================== 282cdf0e10cSrcweir 283cdf0e10cSrcweir#endif 284