libappstream::prelude

Trait IconExt

source
pub trait IconExt:
    IsA<Icon>
    + Sealed
    + 'static {
Show 14 methods // Provided methods fn filename(&self) -> Option<GString> { ... } fn height(&self) -> u32 { ... } fn kind(&self) -> IconKind { ... } fn name(&self) -> Option<GString> { ... } fn scale(&self) -> u32 { ... } fn url(&self) -> Option<GString> { ... } fn width(&self) -> u32 { ... } fn set_filename(&self, filename: &str) { ... } fn set_height(&self, height: u32) { ... } fn set_kind(&self, kind: IconKind) { ... } fn set_name(&self, name: &str) { ... } fn set_scale(&self, scale: u32) { ... } fn set_url(&self, url: &str) { ... } fn set_width(&self, width: u32) { ... }
}
Expand description

Trait containing all Icon methods.

§Implementors

Icon

Provided Methods§

source

fn filename(&self) -> Option<GString>

§Returns

The absolute path for the icon on disk. This is only set for icons of kind IconKind::Local or IconKind::Cached.

source

fn height(&self) -> u32

§Returns

The icon height in pixels, or 0 if unknown.

source

fn kind(&self) -> IconKind

Gets the icon kind.

§Returns

the IconKind

source

fn name(&self) -> Option<GString>

§Returns

the stock name of the icon. In case the icon is not of kind “stock”, the basename of the icon filename or URL is returned.

source

fn scale(&self) -> u32

§Returns

The icon scaling factor.

source

fn url(&self) -> Option<GString>

Gets the icon URL, pointing at a remote location. HTTPS and FTP urls are allowed. This property is only set for icons of type IconKind::Remote

§Returns

the URL

source

fn width(&self) -> u32

§Returns

The icon width in pixels, or 0 if unknown.

source

fn set_filename(&self, filename: &str)

Sets the icon absolute filename.

§filename

the new icon URL.

source

fn set_height(&self, height: u32)

Sets the icon height.

§height

the height in pixels.

source

fn set_kind(&self, kind: IconKind)

Sets the icon kind.

§kind

the IconKind, e.g. IconKind::Cached.

source

fn set_name(&self, name: &str)

Sets the stock name or basename to use for the icon.

§name

the icon stock name, e.g. “gwenview”

source

fn set_scale(&self, scale: u32)

Sets the icon scaling factor used for HiDPI displays.

§scale

the icon scaling factor.

source

fn set_url(&self, url: &str)

Sets the icon URL.

§url

the new icon URL.

source

fn set_width(&self, width: u32)

Sets the icon width.

§width

the width in pixels.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Icon>> IconExt for O