Trait UIMenuBuilder

Source
pub unsafe trait UIMenuBuilder: MainThreadOnly {
    // Provided methods
    unsafe fn system(&self) -> Retained<UIMenuSystem>
       where Self: Sized + Message { ... }
    unsafe fn menuForIdentifier(
        &self,
        identifier: &UIMenuIdentifier,
    ) -> Option<Retained<UIMenu>>
       where Self: Sized + Message { ... }
    unsafe fn actionForIdentifier(
        &self,
        identifier: &UIActionIdentifier,
    ) -> Option<Retained<UIAction>>
       where Self: Sized + Message { ... }
    unsafe fn commandForAction_propertyList(
        &self,
        action: Sel,
        property_list: Option<&AnyObject>,
    ) -> Option<Retained<UICommand>>
       where Self: Sized + Message { ... }
    unsafe fn replaceMenuForIdentifier_withMenu(
        &self,
        replaced_identifier: &UIMenuIdentifier,
        replacement_menu: &UIMenu,
    )
       where Self: Sized + Message { ... }
    unsafe fn replaceChildrenOfMenuForIdentifier_fromChildrenBlock(
        &self,
        parent_identifier: &UIMenuIdentifier,
        children_block: &Block<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> NonNull<NSArray<UIMenuElement>> + '_>,
    )
       where Self: Sized + Message { ... }
    unsafe fn insertSiblingMenu_beforeMenuForIdentifier(
        &self,
        sibling_menu: &UIMenu,
        sibling_identifier: &UIMenuIdentifier,
    )
       where Self: Sized + Message { ... }
    unsafe fn insertSiblingMenu_afterMenuForIdentifier(
        &self,
        sibling_menu: &UIMenu,
        sibling_identifier: &UIMenuIdentifier,
    )
       where Self: Sized + Message { ... }
    unsafe fn insertChildMenu_atStartOfMenuForIdentifier(
        &self,
        child_menu: &UIMenu,
        parent_identifier: &UIMenuIdentifier,
    )
       where Self: Sized + Message { ... }
    unsafe fn insertChildMenu_atEndOfMenuForIdentifier(
        &self,
        child_menu: &UIMenu,
        parent_identifier: &UIMenuIdentifier,
    )
       where Self: Sized + Message { ... }
    unsafe fn removeMenuForIdentifier(
        &self,
        removed_identifier: &UIMenuIdentifier,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature UIMenuBuilder only.
Expand description

Encapsulates access and mutation for a menu hierarchy.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn system(&self) -> Retained<UIMenuSystem>
where Self: Sized + Message,

Available on crate feature UIMenuSystem only.

Which system we are building for.

Source

unsafe fn menuForIdentifier( &self, identifier: &UIMenuIdentifier, ) -> Option<Retained<UIMenu>>
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Fetch the identified menu.

Parameter identifier: The identifier of the menu to fetch.

Returns: The menu with the given identifier, or nil if no such menu.

Source

unsafe fn actionForIdentifier( &self, identifier: &UIActionIdentifier, ) -> Option<Retained<UIAction>>
where Self: Sized + Message,

Available on crate features UIAction and UIMenuElement only.

Fetch the identified action.

Parameter identifier: The identifier of the action to fetch.

Returns: The action with the given identifier, or nil if no such action.

Source

unsafe fn commandForAction_propertyList( &self, action: Sel, property_list: Option<&AnyObject>, ) -> Option<Retained<UICommand>>
where Self: Sized + Message,

Available on crate features UICommand and UIMenuElement only.

Fetch the identified command.

Parameter action: The action of the command to fetch.

Parameter propertyList: Property list object to distinguish commands, if needed.

Returns: The command with the given action and property list, or nil if no such command.

Source

unsafe fn replaceMenuForIdentifier_withMenu( &self, replaced_identifier: &UIMenuIdentifier, replacement_menu: &UIMenu, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Replace an identified menu with a menu.

Parameter replacedIdentifier: The identifier of the menu to be replaced.

Parameter replacementGroup: The replacement menu.

Source

unsafe fn replaceChildrenOfMenuForIdentifier_fromChildrenBlock( &self, parent_identifier: &UIMenuIdentifier, children_block: &Block<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> NonNull<NSArray<UIMenuElement>> + '_>, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement and block2 only.

Replace the children of an identified parent menu.

Parameter parentIdentifier: The identifier of the parent menu.

Parameter childrenBlock: A block that returns the new children, given the old children.

Source

unsafe fn insertSiblingMenu_beforeMenuForIdentifier( &self, sibling_menu: &UIMenu, sibling_identifier: &UIMenuIdentifier, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Insert a sibling menu before an identified sibling menu.

Parameter siblingGroup: The sibling menu to insert.

Parameter siblingIdentifier: The identifier of the sibling menu to insert before.

Source

unsafe fn insertSiblingMenu_afterMenuForIdentifier( &self, sibling_menu: &UIMenu, sibling_identifier: &UIMenuIdentifier, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Insert a sibling menu after an identified sibling menu.

Parameter siblingGroup: The sibling menu to insert.

Parameter siblingIdentifier: The identifier of the sibling menu to insert after.

Source

unsafe fn insertChildMenu_atStartOfMenuForIdentifier( &self, child_menu: &UIMenu, parent_identifier: &UIMenuIdentifier, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Insert a child menu at the start of an identified parent menu.

Parameter childGroup: The child menu to insert.

Parameter parentIdentifier: The identifier of the parent menu to insert at the start of.

Source

unsafe fn insertChildMenu_atEndOfMenuForIdentifier( &self, child_menu: &UIMenu, parent_identifier: &UIMenuIdentifier, )
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Insert a child menu at the end of an identified parent menu.

Parameter childGroup: The child menu to insert.

Parameter parentIdentifier: The identifier of the parent menu to insert at the end of.

Source

unsafe fn removeMenuForIdentifier(&self, removed_identifier: &UIMenuIdentifier)
where Self: Sized + Message,

Available on crate feature UIMenu only.

Remove an identified menu.

Parameter removedIdentifier: The menu to remove.

Trait Implementations§

Source§

impl ProtocolType for dyn UIMenuBuilder

Source§

const NAME: &'static str = "UIMenuBuilder"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UIMenuBuilder
where T: ?Sized + Message + UIMenuBuilder,

Implementations on Foreign Types§

Source§

impl<T> UIMenuBuilder for ProtocolObject<T>
where T: ?Sized + UIMenuBuilder,

Implementors§