Struct winsafe::gui::spec::ListViewItem

source ·
pub struct ListViewItem<'a, T: 'static = ()> { /* private fields */ }
Available on crate feature gui only.
Expand description

A single item of a ListView control.

Note: Each object keeps the zero-based index of an item. If new items are added/removed from the list view control, the object may then point to a different item.

You cannot directly instantiate this object, it is created internally by the control.

Implementations§

source§

impl<'a, T> ListViewItem<'a, T>

source

pub fn data(&self) -> Option<Rc<RefCell<T>>>

Returns a Rc/RefCell with the stored data by sending an lvm::GetItem message.

Returns None if the ListView holds a (), or if the item holds an invalid index.

source

pub fn delete(&self)

Deletes the item by sending an lvm::DeleteItem message.

source

pub fn ensure_visible(&self)

Scrolls the list by sending an lvm::EnsureVisible message so that the item is visible in the list.

source

pub fn focus(&self)

Sets the item as the focused one sending an lvm:SetItemState message.

source

pub fn icon_index(&self) -> Option<u32>

Retrieves the icon index of the item by sending an lvm::GetItem message.

source

pub const fn index(&self) -> u32

Returns the zero-based index of the item.

source

pub fn is_focused(&self) -> bool

Tells if the item is the focused one by sending an lvm::GetItemState message.

source

pub fn is_selected(&self) -> bool

Tells if the item is selected by sending an lvm::GetItemState message.

source

pub fn is_visible(&self) -> bool

Tells if the item is currently visible by sending an lvm::IsItemVisible message.

source

pub fn map_index_to_id(&self) -> u32

Retrieves the unique ID for the item index by sending an lvm::MapIndexToId message.

If the item index has became invalid, returns None.

source

pub fn rect(&self, portion: LVIR) -> RECT

Retrieves the bound rectangle of item by sending an lvm::GetItemRect message.

source

pub fn select(&self, set: bool)

Sets or removes the selection from the item by sending an lvm::SetItemState message.

source

pub fn set_icon_index(&self, icon_index: Option<u32>)

Sets the icon index of the item by sending an lvm::SetItem message.

source

pub fn set_text(&self, column_index: u32, text: &str)

Sets the text of the item under a column by sending an lvm::SetItemText message.

source

pub fn text(&self, column_index: u32) -> String

Retrieves the text of an item under a column by sending an lvm::GetItemText message.

Trait Implementations§

source§

impl<'a, T> Clone for ListViewItem<'a, T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T> Copy for ListViewItem<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for ListViewItem<'a, T>

§

impl<'a, T = ()> !RefUnwindSafe for ListViewItem<'a, T>

§

impl<'a, T = ()> !Send for ListViewItem<'a, T>

§

impl<'a, T = ()> !Sync for ListViewItem<'a, T>

§

impl<'a, T> Unpin for ListViewItem<'a, T>

§

impl<'a, T = ()> !UnwindSafe for ListViewItem<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.