Struct alfred::ItemBuilder [] [src]

pub struct ItemBuilder<'a> {
    // some fields omitted
}

Helper for building Item values

Methods

impl<'a> ItemBuilder<'a>
[src]

fn new<S: Into<Cow<'a, str>>>(title: S) -> ItemBuilder<'a>

Returns a new ItemBuilder with the given title

fn into_item(self) -> Item<'a>

Returns the built Item

impl<'a> ItemBuilder<'a>
[src]

fn title<S: Into<Cow<'a, str>>>(self, title: S) -> ItemBuilder<'a>

Sets the title to the given value

fn subtitle<S: Into<Cow<'a, str>>>(self, subtitle: S) -> ItemBuilder<'a>

Sets the default subtitle to the given value

This sets the default subtitle, used when no modifier is pressed, or when no subtitle is provided for the pressed modifier.

fn subtitle_mod<S: Into<Cow<'a, str>>>(self, modifier: Modifier, subtitle: S) -> ItemBuilder<'a>

Sets the subtitle to the given value with the given modifier

This sets the subtitle to use when the given modifier is pressed.

fn icon_path<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>

Sets the icon to an image file on disk

The path is interpreted relative to the workflow directory.

fn icon_file<S: Into<Cow<'a, str>>>(self, path: S) -> ItemBuilder<'a>

Sets the icon to the icon for a given file on disk

The path is interpreted relative to the workflow directory.

fn icon_filetype<S: Into<Cow<'a, str>>>(self, filetype: S) -> ItemBuilder<'a>

Sets the icon to the icon for a given file type

The type is a UTI, such as "public.jpeg".

fn uid<S: Into<Cow<'a, str>>>(self, uid: S) -> ItemBuilder<'a>

Sets the uid to the given value

fn arg<S: Into<Cow<'a, str>>>(self, arg: S) -> ItemBuilder<'a>

Sets the arg to the given value

fn type_(self, type_: ItemType) -> ItemBuilder<'a>

Sets the type to the given value

fn valid(self, valid: bool) -> ItemBuilder<'a>

Sets valid to the given value

fn autocomplete<S: Into<Cow<'a, str>>>(self, autocomplete: S) -> ItemBuilder<'a>

Sets autocomplete to the given value

fn text_copy<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>

Sets text_copy to the given value

fn text_large_type<S: Into<Cow<'a, str>>>(self, text: S) -> ItemBuilder<'a>

Sets text_large_type to the given value

impl<'a> ItemBuilder<'a>
[src]

fn set_title<S: Into<Cow<'a, str>>>(&mut self, title: S)

Sets the title to the given value

fn set_subtitle<S: Into<Cow<'a, str>>>(&mut self, subtitle: S)

Sets the default subtitle to the given value

fn unset_subtitle(&mut self)

Unsets the default subtitle

fn set_subtitle_mod<S: Into<Cow<'a, str>>>(&mut self, modifier: Modifier, subtitle: S)

Sets the subtitle to the given value for the given modifier

fn unset_subtitle_mod(&mut self, modifier: Modifier)

Unsets the subtitle for the given modifier

This unsets the subtitle that's used when the given modifier is pressed.

fn clear_subtitle(&mut self)

Clears the subtitle for all modifiers

This unsets both the default subtitle and the per-modifier subtitles.

fn set_icon_path<S: Into<Cow<'a, str>>>(&mut self, path: S)

Sets the icon to an image file on disk

The path is interpreted relative to the workflow directory.

fn set_icon_file<S: Into<Cow<'a, str>>>(&mut self, path: S)

Sets the icon to the icon for a given file on disk

The path is interpreted relative to the workflow directory.

fn set_icon_filetype<S: Into<Cow<'a, str>>>(&mut self, filetype: S)

Sets the icon to the icon for a given file type

The type is a UTI, such as "public.jpeg".

fn unset_icon(&mut self)

Unsets the icon

fn set_uid<S: Into<Cow<'a, str>>>(&mut self, uid: S)

Sets the uid to the given value

fn unset_uid(&mut self)

Unsets the uid

fn set_arg<S: Into<Cow<'a, str>>>(&mut self, arg: S)

Sets the arg to the given value

fn unset_arg(&mut self)

Unsets the arg

fn set_type(&mut self, type_: ItemType)

Sets the type to the given value

fn set_valid(&mut self, valid: bool)

Sets valid to the given value

fn set_autocomplete<S: Into<Cow<'a, str>>>(&mut self, autocomplete: S)

Sets autocomplete to the given value

fn unset_autocomplete(&mut self)

Unsets autocomplete

fn set_text_copy<S: Into<Cow<'a, str>>>(&mut self, text: S)

Sets text_copy to the given value

fn unset_text_copy(&mut self)

Unsets text_copy

fn set_text_large_type<S: Into<Cow<'a, str>>>(&mut self, text: S)

Sets text_large_type to the given value

fn unset_text_large_type(&mut self)

Unsets text_large_type

Trait Implementations

impl<'a> Clone for ItemBuilder<'a>
[src]

fn clone(&self) -> ItemBuilder<'a>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more