pub unsafe trait NSTokenFieldDelegate: NSTextFieldDelegate + MainThreadOnly {
// Provided methods
unsafe fn tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem(
&self,
token_field: &NSTokenField,
substring: &NSString,
token_index: NSInteger,
selected_index: *mut NSInteger,
) -> Option<Retained<NSArray>>
where Self: Sized + Message { ... }
unsafe fn tokenField_shouldAddObjects_atIndex(
&self,
token_field: &NSTokenField,
tokens: &NSArray,
index: NSUInteger,
) -> Retained<NSArray>
where Self: Sized + Message { ... }
unsafe fn tokenField_displayStringForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn tokenField_editingStringForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
fn tokenField_representedObjectForEditingString(
&self,
token_field: &NSTokenField,
editing_string: &NSString,
) -> Option<Retained<AnyObject>>
where Self: Sized + Message { ... }
unsafe fn tokenField_writeRepresentedObjects_toPasteboard(
&self,
token_field: &NSTokenField,
objects: &NSArray,
pboard: &NSPasteboard,
) -> bool
where Self: Sized + Message { ... }
fn tokenField_readFromPasteboard(
&self,
token_field: &NSTokenField,
pboard: &NSPasteboard,
) -> Option<Retained<NSArray>>
where Self: Sized + Message { ... }
unsafe fn tokenField_menuForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> Option<Retained<NSMenu>>
where Self: Sized + Message { ... }
unsafe fn tokenField_hasMenuForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> bool
where Self: Sized + Message { ... }
unsafe fn tokenField_styleForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> NSTokenStyle
where Self: Sized + Message { ... }
}NSControl and NSTextField and NSTokenField only.Expand description
Provided Methods§
Sourceunsafe fn tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem(
&self,
token_field: &NSTokenField,
substring: &NSString,
token_index: NSInteger,
selected_index: *mut NSInteger,
) -> Option<Retained<NSArray>>
Available on crate features NSResponder and NSView only.
unsafe fn tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem( &self, token_field: &NSTokenField, substring: &NSString, token_index: NSInteger, selected_index: *mut NSInteger, ) -> Option<Retained<NSArray>>
NSResponder and NSView only.Allows the delegate to provide an array of appropriate completions for the contents of the receiver
Parameter tokenField: The token field 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, or nil to provide no completions
If the delegate does not implement this method, no completions are provided
§Safety
selected_index must be a valid pointer or null.
Sourceunsafe fn tokenField_shouldAddObjects_atIndex(
&self,
token_field: &NSTokenField,
tokens: &NSArray,
index: NSUInteger,
) -> Retained<NSArray>
Available on crate features NSResponder and NSView only.
unsafe fn tokenField_shouldAddObjects_atIndex( &self, token_field: &NSTokenField, tokens: &NSArray, index: NSUInteger, ) -> Retained<NSArray>
NSResponder and NSView only.§Safety
tokens generic should be of the correct type.
Sourceunsafe fn tokenField_displayStringForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> Option<Retained<NSString>>
Available on crate features NSResponder and NSView only.
unsafe fn tokenField_displayStringForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> Option<Retained<NSString>>
NSResponder and NSView only.§Safety
represented_object should be of the correct type.
Sourceunsafe fn tokenField_editingStringForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> Option<Retained<NSString>>
Available on crate features NSResponder and NSView only.
unsafe fn tokenField_editingStringForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> Option<Retained<NSString>>
NSResponder and NSView only.§Safety
represented_object should be of the correct type.
fn tokenField_representedObjectForEditingString( &self, token_field: &NSTokenField, editing_string: &NSString, ) -> Option<Retained<AnyObject>>
NSResponder and NSView only.Sourceunsafe fn tokenField_writeRepresentedObjects_toPasteboard(
&self,
token_field: &NSTokenField,
objects: &NSArray,
pboard: &NSPasteboard,
) -> bool
Available on crate features NSPasteboard and NSResponder and NSView only.
unsafe fn tokenField_writeRepresentedObjects_toPasteboard( &self, token_field: &NSTokenField, objects: &NSArray, pboard: &NSPasteboard, ) -> bool
NSPasteboard and NSResponder and NSView only.§Safety
objects generic should be of the correct type.
fn tokenField_readFromPasteboard( &self, token_field: &NSTokenField, pboard: &NSPasteboard, ) -> Option<Retained<NSArray>>
NSPasteboard and NSResponder and NSView only.Available on crate features NSMenu and NSResponder and NSView only.
NSMenu and NSResponder and NSView only.§Safety
represented_object should be of the correct type.
Sourceunsafe fn tokenField_hasMenuForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> bool
Available on crate features NSResponder and NSView only.
unsafe fn tokenField_hasMenuForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> bool
NSResponder and NSView only.§Safety
represented_object should be of the correct type.
Sourceunsafe fn tokenField_styleForRepresentedObject(
&self,
token_field: &NSTokenField,
represented_object: &AnyObject,
) -> NSTokenStyle
Available on crate features NSResponder and NSTokenFieldCell and NSView only.
unsafe fn tokenField_styleForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> NSTokenStyle
NSResponder and NSTokenFieldCell and NSView only.§Safety
represented_object should be of the correct type.
Trait Implementations§
impl<T> ImplementedBy<T> for dyn NSTokenFieldDelegate
Source§impl ProtocolType for dyn NSTokenFieldDelegate
impl ProtocolType for dyn NSTokenFieldDelegate
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".