# WoopsiUI::ListDataItem Class Reference

`#include <listdataitem.h>`

Inheritance diagram for WoopsiUI::ListDataItem:

List of all members.

## Public Member Functions
| ListDataItem (const WoopsiString &text, const u32 value)
virtual | ~ListDataItem ()
const WoopsiString & | getText () const
const u32 | getValue () const
const bool | isSelected () const
void | setSelected (bool selected)
virtual s8 | compareTo (const ListDataItem *item) const

## Detailed Description

Class representing a data item within a list. Intended for use within the ListData class.

## Constructor & Destructor Documentation

WoopsiUI::ListDataItem::ListDataItem | ( | const WoopsiString & | text,
|  | const u32 | value |
| ) |  |  |

Constructor.

Parameters:

  | text | The text to display in the item.
  | value | The value of the item.

virtual WoopsiUI::ListDataItem::~ListDataItem | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual s8 WoopsiUI::ListDataItem::compareTo | ( | const ListDataItem * | item | ) | const`[virtual]`

Compare the item with another. Comparison is based on the text of the item. Returns 0 if the text in the two items is the same, a value less than 0 if this item is less than the argument, and a value greater than 0 if this item is greater than the argument.

Parameters:

  | item | An item to compare this object with.

Returns:
  0 if the text in the two items is the same, a value less than 0 if this item is less than the argument, and a value greater than 0 if this item is greater than the argument.

Reimplemented in WoopsiUI::FileListBoxDataItem.

const WoopsiString& WoopsiUI::ListDataItem::getText | ( |  | ) | const`[inline]`

Get the item's text.

Returns:
  The item's text.

const u32 WoopsiUI::ListDataItem::getValue | ( |  | ) | const`[inline]`

Get the item's value.

Returns:
  The item's value.

const bool WoopsiUI::ListDataItem::isSelected | ( |  | ) | const`[inline]`

Get the item's selection state.

Returns:
  True if the item is selected; false if not.

void WoopsiUI::ListDataItem::setSelected | ( | bool | selected | ) | `[inline]`

Set the item's selection state.

Parameters:

  | selected | True to select the item; false to deselect it.

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

- listdataitem.h