Struct alfred::ItemBuilder
[−]
[src]
pub struct ItemBuilder<'a> { /* 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>
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 arg_mod<S: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
arg: S
) -> ItemBuilder<'a>
self,
modifier: Modifier,
arg: S
) -> ItemBuilder<'a>
Sets the arg
to the given value with the given modifier.
This sets the arg to use when the given modifier is pressed.
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 valid_mod(self, modifier: Modifier, valid: bool) -> ItemBuilder<'a>
Sets valid
to the given value with the given modifier
This sets the validity to use when the given modifier is pressed.
fn modifier<S: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>>(
self,
modifier: Modifier,
subtitle: Option<S>,
arg: Option<S2>,
valid: bool
) -> ItemBuilder<'a>
self,
modifier: Modifier,
subtitle: Option<S>,
arg: Option<S2>,
valid: bool
) -> ItemBuilder<'a>
Sets the subtitle, arg, and validity to use with the given modifier
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
fn quicklook_url<S: Into<Cow<'a, str>>>(self, url: S) -> ItemBuilder<'a>
Sets quicklook_url
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
)
&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_arg_mod<S: Into<Cow<'a, str>>>(&mut self, modifier: Modifier, arg: S)
Sets the arg
to the given value for the given modifier
fn unset_arg_mod(&mut self, modifier: Modifier)
Unsets the arg
for the given modifier
This unsets the arg that's used when the given modifier is pressed.
fn clear_arg(&mut self)
Clears the arg
for all modifiers
This unsets both the default arg and the per-modifier args.
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_valid_mod(&mut self, modifier: Modifier, valid: bool)
Sets valid
to the given value for the given modifier
fn unset_valid_mod(&mut self, modifier: Modifier)
Unsets valid
for the given modifier
This unsets the validity that's used when the given modifier is pressed.
fn clear_valid(&mut self)
Unsets valid
for all modifiers
This resets valid
back to the default and clears all per-modifier validity.
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_modifier<S: Into<Cow<'a, str>>, S2: Into<Cow<'a, str>>>(
&mut self,
modifier: Modifier,
subtitle: Option<S>,
arg: Option<S2>,
valid: bool
)
&mut self,
modifier: Modifier,
subtitle: Option<S>,
arg: Option<S2>,
valid: bool
)
Sets subtitle, arg, and validity for the given modifier
fn unset_modifier(&mut self, modifier: Modifier)
Unsets subtitle, arg, and validity for the given modifier
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
fn set_quicklook_url<S: Into<Cow<'a, str>>>(&mut self, url: S)
Sets quicklook_url
to the given value
fn unset_quicklook_url(&mut self)
Unsets quicklook_url
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