LibreOffice: XItemList Interface Reference

LibreOffice LibreOffice 26.8 SDK API Reference

Loading...
Searching...
No Matches
XItemList Interface Reference

provides convenient access to the list of items in a list box More...

`import "XItemList.idl";`

Inheritance diagram for XItemList:

## Public Member Functions
void | insertItem ([in] long Position, [in] string ItemText, [in] string ItemImageURL) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| inserts a new item into the list
void | insertItemText ([in] long Position, [in] string ItemText) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| inserts an item which has only a text, but no image
void | insertItemImage ([in] long Position, [in] string ItemImageURL) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| inserts an item which has only an image, but no text
void | removeItem ([in] long Position) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| removes an item from the list
void | removeAllItems ()
| removes all items from the list
void | setItemText ([in] long Position, [in] string ItemText) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| sets a new text for an existing item
void | setItemImage ([in] long Position, [in] string ItemImageURL) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| sets a new image for an existing item
void | setItemTextAndImage ([in] long Position, [in] string ItemText, [in] string ItemImageURL) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| sets both a new position and text for an existing item
void | setItemData ([in] long Position, [in] any ItemData) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| associates an implementation dependent value with the given list item.
string | getItemText ([in] long Position) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| retrieves the text of an existing item
string | getItemImage ([in] long Position) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| retrieves the URL of the image of an existing item
::com::sun::star::beans::Pair< string, string > | getItemTextAndImage ([in] long Position) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| retrieves both the text and the image URL of an existing item
any | getItemData ([in] long Position) raises ( ::com::sun::star::lang::IndexOutOfBoundsException )
| retrieves the implementation dependent value associated with the given list item.
sequence< ::com::sun::star::beans::Pair< string, string > > | getAllItems ()
| retrieves the texts and images of all items in the list
void | addItemListListener ([in] XItemListListener Listener)
| registers a listener which is notified about changes in the item list.
void | removeItemListListener ([in] XItemListListener Listener)
| revokes a listener which is notified about changes in the item list.

## Public Attributes
long | ItemCount
| is the number of items in the list

## Detailed Description

provides convenient access to the list of items in a list box

## Member Function Documentation

## ◆ addItemListListener()

void addItemListListener | ( | [in] XItemListListener | Listener | ) |

registers a listener which is notified about changes in the item list.

## ◆ getAllItems()

sequence< ::com::sun::star::beans::Pair< string, string > > getAllItems | ( |  | ) |

retrieves the texts and images of all items in the list

## ◆ getItemData()

any getItemData | ( | [in] long | Position | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

retrieves the implementation dependent value associated with the given list item.

Parameters

  Position | the position of the item whose data value should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

See also
  setItemData

## ◆ getItemImage()

string getItemImage | ( | [in] long | Position | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

retrieves the URL of the image of an existing item

Parameters

  Position | the position of the item whose image should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ getItemText()

string getItemText | ( | [in] long | Position | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

retrieves the text of an existing item

Parameters

  Position | the position of the item whose text should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ getItemTextAndImage()

::com::sun::star::beans::Pair< string, string > getItemTextAndImage | ( | [in] long | Position | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

retrieves both the text and the image URL of an existing item

Parameters

  Position | the position of the item whose text and image should be retrieved. Must be greater or equal to 0, and lesser than ItemCount.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ insertItem()

void insertItem | ( | [in] long | Position,
|  | [in] string | ItemText,
|  | [in] string | ItemImageURL )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

inserts a new item into the list

Parameters

  Position | the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
  ItemText | the text of the item to be inserted.
  ItemImageURL | the URL of the image to display for the item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ insertItemImage()

void insertItemImage | ( | [in] long | Position,
|  | [in] string | ItemImageURL )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

inserts an item which has only an image, but no text

Parameters

  Position | the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
  ItemImageURL | the URL of the image to display for the item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ insertItemText()

void insertItemText | ( | [in] long | Position,
|  | [in] string | ItemText )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

inserts an item which has only a text, but no image

Parameters

  Position | the position at which the item should be inserted. Must be greater or equal to 0, and lesser than or equal to ItemCount.
  ItemText | the text of the item to be inserted.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ removeAllItems()

void removeAllItems | ( |  | ) |

removes all items from the list

## ◆ removeItem()

void removeItem | ( | [in] long | Position | ) |
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

removes an item from the list

Parameters

  Position | the position of the item which should be removed. Must be greater or equal to 0, and lesser than ItemCount.

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ removeItemListListener()

void removeItemListListener | ( | [in] XItemListListener | Listener | ) |

revokes a listener which is notified about changes in the item list.

## ◆ setItemData()

void setItemData | ( | [in] long | Position,
|  | [in] any | ItemData )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

associates an implementation dependent value with the given list item.

You can use this to store data for an item which does not interfere with the displayed text and image, but can be used by the client of the list box for an arbitrary purpose.

Parameters

  Position | the position of the item whose data value should be set. Must be greater or equal to 0, and lesser than ItemCount.
  ItemData | the data to associate with the list item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

See also
  getItemData

## ◆ setItemImage()

void setItemImage | ( | [in] long | Position,
|  | [in] string | ItemImageURL )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

sets a new image for an existing item

Parameters

  Position | the position of the item whose image is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
  ItemImageURL | the new URL of the image to display for the item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ setItemText()

void setItemText | ( | [in] long | Position,
|  | [in] string | ItemText )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

sets a new text for an existing item

Parameters

  Position | the position of the item whose text is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
  ItemText | the new text of the item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## ◆ setItemTextAndImage()

void setItemTextAndImage | ( | [in] long | Position,
|  | [in] string | ItemText,
|  | [in] string | ItemImageURL )
raises | ( | ::com::sun::star::lang::IndexOutOfBoundsException ) |  |  |

sets both a new position and text for an existing item

Parameters

  Position | the position of the item whose text and image is to be changed. Must be greater or equal to 0, and lesser than ItemCount.
  ItemText | the new text of the item
  ItemImageURL | the new URL of the image to display for the item

Exceptions

  com::sun::star::lang::IndexOutOfBoundsException | if `Position` is invalid.

## Member Data Documentation

## ◆ ItemCount

long ItemCount
| attributereadonly

is the number of items in the list

The documentation for this interface was generated from the following file:

- com/sun/star/awt/XItemList.idl