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 { ... }
unsafe 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 { ... }
unsafe 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 { ... }
}
Available on crate features
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
unsafe 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_displayStringForRepresentedObject( &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>>
Available on crate features
NSResponder
and NSView
only.unsafe fn tokenField_representedObjectForEditingString( &self, token_field: &NSTokenField, editing_string: &NSString, ) -> Option<Retained<AnyObject>>
Available on crate features
NSResponder
and NSView
only.unsafe 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_readFromPasteboard( &self, token_field: &NSTokenField, pboard: &NSPasteboard, ) -> Option<Retained<NSArray>>
Available on crate features
NSPasteboard
and NSResponder
and NSView
only.Available on crate features
NSMenu
and NSResponder
and NSView
only.unsafe fn tokenField_hasMenuForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> bool
Available on crate features
NSResponder
and NSView
only.unsafe fn tokenField_styleForRepresentedObject( &self, token_field: &NSTokenField, represented_object: &AnyObject, ) -> NSTokenStyle
Available on crate features
NSResponder
and NSTokenFieldCell
and NSView
only.