libappstream::prelude

Trait ScreenshotExt

source
pub trait ScreenshotExt:
    IsA<Screenshot>
    + Sealed
    + 'static {
Show 18 methods // Provided methods fn add_image(&self, image: &impl IsA<Image>) { ... } fn add_video(&self, video: &impl IsA<Video>) { ... } fn clear_images(&self) { ... } fn caption(&self) -> Option<GString> { ... } fn context(&self) -> Option<Context> { ... } fn environment(&self) -> Option<GString> { ... } fn image(&self, width: u32, height: u32, scale: u32) -> Option<Image> { ... } fn images(&self) -> Vec<Image> { ... } fn images_all(&self) -> Vec<Image> { ... } fn kind(&self) -> ScreenshotKind { ... } fn media_kind(&self) -> ScreenshotMediaKind { ... } fn videos(&self) -> Vec<Video> { ... } fn videos_all(&self) -> Vec<Video> { ... } fn is_valid(&self) -> bool { ... } fn set_caption(&self, caption: &str, locale: &str) { ... } fn set_context(&self, context: &impl IsA<Context>) { ... } fn set_environment(&self, env_id: Option<&str>) { ... } fn set_kind(&self, kind: ScreenshotKind) { ... }
}
Expand description

Trait containing all Screenshot methods.

§Implementors

Screenshot

Provided Methods§

source

fn add_image(&self, image: &impl IsA<Image>)

Adds an image to the screenshot.

§image

a Image instance.

source

fn add_video(&self, video: &impl IsA<Video>)

Adds a video to the screenshot.

§video

a Video instance.

source

fn clear_images(&self)

Remove all images associated with this screenshot.

source

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

Gets the image caption

§Returns

the caption

source

fn context(&self) -> Option<Context>

Returns the Context associated with this screenshot. This function may return None if no context is set.

§Returns

the Context used by this screenshot.

source

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

Get the GUI environment ID of this screenshot, if any is associated with it. E.g. “plasma-mobile” or “gnome:dark”.

§Returns

The GUI environment ID the screenshot was recorded in, or None if none set.

source

fn image(&self, width: u32, height: u32, scale: u32) -> Option<Image>

Gets the AsImage closest to the target size. The Image may not actually be the requested size, and the application may have to pad / rescale the image to make it fit. Only images for the current active locale (or fallback, if images are not localized) are considered.

§width

target width

§height

target height

§scale

the target scaling factor.

§Returns

an Image, or None

source

fn images(&self) -> Vec<Image>

Gets the images for this screenshots. Only images valid for the current language are returned. We return all sizes.

§Returns

an array

source

fn images_all(&self) -> Vec<Image>

Returns an array of all images we have, regardless of their size and language.

§Returns

an array

source

fn kind(&self) -> ScreenshotKind

Gets the screenshot kind.

§Returns

a ScreenshotKind

source

fn media_kind(&self) -> ScreenshotMediaKind

Gets the screenshot media kind.

§Returns

a ScreenshotMediaKind

source

fn videos(&self) -> Vec<Video>

Gets the videos for this screenshots. Only videos valid for the current language selection are returned. We return all sizes.

§Returns

an array

source

fn videos_all(&self) -> Vec<Video>

Returns an array of all screencast videos we have, regardless of their size and locale.

§Returns

an array

source

fn is_valid(&self) -> bool

Performs a quick validation on this screenshot

§Returns

TRUE if the screenshot is a complete Screenshot

source

fn set_caption(&self, caption: &str, locale: &str)

Sets a caption on the screenshot

§caption

the caption text.

source

fn set_context(&self, context: &impl IsA<Context>)

Sets the document context this screenshot is associated with.

§context

the Context.

source

fn set_environment(&self, env_id: Option<&str>)

Sets the GUI environment ID of this screenshot.

§env_id

the GUI environment ID, e.g. “plasma-mobile” or “gnome:dark”

source

fn set_kind(&self, kind: ScreenshotKind)

Sets the screenshot kind.

§kind

the ScreenshotKind.

Object Safety§

This trait is not object safe.

Implementors§