Skip to main content

NSTokenFieldCellDelegate

Trait NSTokenFieldCellDelegate 

Source
pub unsafe trait NSTokenFieldCellDelegate: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem(
        &self,
        token_field_cell: &NSTokenFieldCell,
        substring: &NSString,
        token_index: NSInteger,
        selected_index: NonNull<NSInteger>,
    ) -> Retained<NSArray>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_shouldAddObjects_atIndex(
        &self,
        token_field_cell: &NSTokenFieldCell,
        tokens: &NSArray,
        index: NSUInteger,
    ) -> Retained<NSArray>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_displayStringForRepresentedObject(
        &self,
        token_field_cell: &NSTokenFieldCell,
        represented_object: &AnyObject,
    ) -> Option<Retained<NSString>>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_editingStringForRepresentedObject(
        &self,
        token_field_cell: &NSTokenFieldCell,
        represented_object: &AnyObject,
    ) -> Option<Retained<NSString>>
       where Self: Sized + Message { ... }
    fn tokenFieldCell_representedObjectForEditingString(
        &self,
        token_field_cell: &NSTokenFieldCell,
        editing_string: &NSString,
    ) -> Option<Retained<AnyObject>>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_writeRepresentedObjects_toPasteboard(
        &self,
        token_field_cell: &NSTokenFieldCell,
        objects: &NSArray,
        pboard: &NSPasteboard,
    ) -> bool
       where Self: Sized + Message { ... }
    fn tokenFieldCell_readFromPasteboard(
        &self,
        token_field_cell: &NSTokenFieldCell,
        pboard: &NSPasteboard,
    ) -> Option<Retained<NSArray>>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_menuForRepresentedObject(
        &self,
        token_field_cell: &NSTokenFieldCell,
        represented_object: &AnyObject,
    ) -> Option<Retained<NSMenu>>
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_hasMenuForRepresentedObject(
        &self,
        token_field_cell: &NSTokenFieldCell,
        represented_object: &AnyObject,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn tokenFieldCell_styleForRepresentedObject(
        &self,
        token_field_cell: &NSTokenFieldCell,
        represented_object: &AnyObject,
    ) -> NSTokenStyle
       where Self: Sized + Message { ... }
}
Available on crate feature NSTokenFieldCell only.
Expand description

Provided Methods§

Source

unsafe fn tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem( &self, token_field_cell: &NSTokenFieldCell, substring: &NSString, token_index: NSInteger, selected_index: NonNull<NSInteger>, ) -> Retained<NSArray>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.

Allows the delegate to provide an array of appropriate completions for the contents of the receiver

Parameter tokenFieldCell: The token field cell where editing is occurring

Parameter substring: The partial string that is being completed

Parameter tokenIndex: The index of the token being completed

Parameter selectedIndex: Optionally, you can return by reference an index into the returned array that specifies which of the completions should be initially selected. If none are to be selected, return by reference -1.

Returns: An array of strings (NSString) that are possible completions

If the delegate does not implement this method, no completions are provided

§Safety

selected_index must be a valid pointer.

Source

unsafe fn tokenFieldCell_shouldAddObjects_atIndex( &self, token_field_cell: &NSTokenFieldCell, tokens: &NSArray, index: NSUInteger, ) -> Retained<NSArray>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
§Safety

tokens generic should be of the correct type.

Source

unsafe fn tokenFieldCell_displayStringForRepresentedObject( &self, token_field_cell: &NSTokenFieldCell, represented_object: &AnyObject, ) -> Option<Retained<NSString>>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
§Safety

represented_object should be of the correct type.

Source

unsafe fn tokenFieldCell_editingStringForRepresentedObject( &self, token_field_cell: &NSTokenFieldCell, represented_object: &AnyObject, ) -> Option<Retained<NSString>>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
§Safety

represented_object should be of the correct type.

Source

fn tokenFieldCell_representedObjectForEditingString( &self, token_field_cell: &NSTokenFieldCell, editing_string: &NSString, ) -> Option<Retained<AnyObject>>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
Source

unsafe fn tokenFieldCell_writeRepresentedObjects_toPasteboard( &self, token_field_cell: &NSTokenFieldCell, objects: &NSArray, pboard: &NSPasteboard, ) -> bool
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSPasteboard and NSTextFieldCell only.
§Safety

objects generic should be of the correct type.

Source

fn tokenFieldCell_readFromPasteboard( &self, token_field_cell: &NSTokenFieldCell, pboard: &NSPasteboard, ) -> Option<Retained<NSArray>>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSPasteboard and NSTextFieldCell only.
Source

unsafe fn tokenFieldCell_menuForRepresentedObject( &self, token_field_cell: &NSTokenFieldCell, represented_object: &AnyObject, ) -> Option<Retained<NSMenu>>
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSMenu and NSTextFieldCell only.
§Safety

represented_object should be of the correct type.

Source

unsafe fn tokenFieldCell_hasMenuForRepresentedObject( &self, token_field_cell: &NSTokenFieldCell, represented_object: &AnyObject, ) -> bool
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
§Safety

represented_object should be of the correct type.

Source

unsafe fn tokenFieldCell_styleForRepresentedObject( &self, token_field_cell: &NSTokenFieldCell, represented_object: &AnyObject, ) -> NSTokenStyle
where Self: Sized + Message,

Available on crate features NSActionCell and NSCell and NSTextFieldCell only.
§Safety

represented_object should be of the correct type.

Trait Implementations§

Source§

impl<T> ImplementedBy<T> for dyn NSTokenFieldCellDelegate

Source§

impl ProtocolType for dyn NSTokenFieldCellDelegate

Source§

const NAME: &'static str = "NSTokenFieldCellDelegate"

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> NSTokenFieldCellDelegate for ProtocolObject<T>

Implementors§