Struct icrate::AppKit::NSTextViewDelegate
source · #[repr(C)]pub struct NSTextViewDelegate { /* private fields */ }AppKit only.Implementations§
source§impl NSTextViewDelegate
impl NSTextViewDelegate
pub unsafe fn textView_clickedOnLink_atIndex(
&self,
textView: &NSTextView,
link: &Object,
charIndex: NSUInteger
) -> bool
pub unsafe fn textView_clickedOnCell_inRect_atIndex(
&self,
textView: &NSTextView,
cell: &NSTextAttachmentCell,
cellFrame: NSRect,
charIndex: NSUInteger
)
pub unsafe fn textView_doubleClickedOnCell_inRect_atIndex(
&self,
textView: &NSTextView,
cell: &NSTextAttachmentCell,
cellFrame: NSRect,
charIndex: NSUInteger
)
pub unsafe fn textView_draggedCell_inRect_event_atIndex(
&self,
view: &NSTextView,
cell: &NSTextAttachmentCell,
rect: NSRect,
event: &NSEvent,
charIndex: NSUInteger
)
pub unsafe fn textView_writablePasteboardTypesForCell_atIndex(
&self,
view: &NSTextView,
cell: &NSTextAttachmentCell,
charIndex: NSUInteger
) -> Id<NSArray<NSPasteboardType>, Shared>
pub unsafe fn textView_writeCell_atIndex_toPasteboard_type(
&self,
view: &NSTextView,
cell: &NSTextAttachmentCell,
charIndex: NSUInteger,
pboard: &NSPasteboard,
type_: &NSPasteboardType
) -> bool
pub unsafe fn textView_willChangeSelectionFromCharacterRange_toCharacterRange(
&self,
textView: &NSTextView,
oldSelectedCharRange: NSRange,
newSelectedCharRange: NSRange
) -> NSRange
pub unsafe fn textView_willChangeSelectionFromCharacterRanges_toCharacterRanges(
&self,
textView: &NSTextView,
oldSelectedCharRanges: &NSArray<NSValue>,
newSelectedCharRanges: &NSArray<NSValue>
) -> Id<NSArray<NSValue>, Shared>
pub unsafe fn textView_shouldChangeTextInRanges_replacementStrings(
&self,
textView: &NSTextView,
affectedRanges: &NSArray<NSValue>,
replacementStrings: Option<&NSArray<NSString>>
) -> bool
pub unsafe fn textView_shouldChangeTypingAttributes_toAttributes(
&self,
textView: &NSTextView,
oldTypingAttributes: &NSDictionary<NSString, Object>,
newTypingAttributes: &NSDictionary<NSAttributedStringKey, Object>
) -> Id<NSDictionary<NSAttributedStringKey, Object>, Shared>
pub unsafe fn textViewDidChangeSelection(&self, notification: &NSNotification)
pub unsafe fn textViewDidChangeTypingAttributes(
&self,
notification: &NSNotification
)
pub unsafe fn textView_willDisplayToolTip_forCharacterAtIndex(
&self,
textView: &NSTextView,
tooltip: &NSString,
characterIndex: NSUInteger
) -> Option<Id<NSString, Shared>>
pub unsafe fn textView_completions_forPartialWordRange_indexOfSelectedItem(
&self,
textView: &NSTextView,
words: &NSArray<NSString>,
charRange: NSRange,
index: *mut NSInteger
) -> Id<NSArray<NSString>, Shared>
pub unsafe fn textView_shouldChangeTextInRange_replacementString(
&self,
textView: &NSTextView,
affectedCharRange: NSRange,
replacementString: Option<&NSString>
) -> bool
pub unsafe fn textView_doCommandBySelector(
&self,
textView: &NSTextView,
commandSelector: Sel
) -> bool
pub unsafe fn textView_shouldSetSpellingState_range(
&self,
textView: &NSTextView,
value: NSInteger,
affectedCharRange: NSRange
) -> NSInteger
pub unsafe fn textView_willCheckTextInRange_options_types(
&self,
view: &NSTextView,
range: NSRange,
options: &NSDictionary<NSTextCheckingOptionKey, Object>,
checkingTypes: NonNull<NSTextCheckingTypes>
) -> Id<NSDictionary<NSTextCheckingOptionKey, Object>, Shared>
pub unsafe fn textView_didCheckTextInRange_types_options_results_orthography_wordCount(
&self,
view: &NSTextView,
range: NSRange,
checkingTypes: NSTextCheckingTypes,
options: &NSDictionary<NSTextCheckingOptionKey, Object>,
results: &NSArray<NSTextCheckingResult>,
orthography: &NSOrthography,
wordCount: NSInteger
) -> Id<NSArray<NSTextCheckingResult>, Shared>
pub unsafe fn textView_URLForContentsOfTextAttachment_atIndex(
&self,
textView: &NSTextView,
textAttachment: &NSTextAttachment,
charIndex: NSUInteger
) -> Option<Id<NSURL, Shared>>
pub unsafe fn textView_willShowSharingServicePicker_forItems(
&self,
textView: &NSTextView,
servicePicker: &NSSharingServicePicker,
items: &NSArray
) -> Option<Id<NSSharingServicePicker, Shared>>
pub unsafe fn undoManagerForTextView(
&self,
view: &NSTextView
) -> Option<Id<NSUndoManager, Shared>>
pub unsafe fn textView_shouldUpdateTouchBarItemIdentifiers(
&self,
textView: &NSTextView,
identifiers: &NSArray<NSTouchBarItemIdentifier>
) -> Id<NSArray<NSTouchBarItemIdentifier>, Shared>
pub unsafe fn textView_candidatesForSelectedRange(
&self,
textView: &NSTextView,
selectedRange: NSRange
) -> Option<Id<NSArray, Shared>>
pub unsafe fn textView_candidates_forSelectedRange(
&self,
textView: &NSTextView,
candidates: &NSArray<NSTextCheckingResult>,
selectedRange: NSRange
) -> Id<NSArray<NSTextCheckingResult>, Shared>
pub unsafe fn textView_shouldSelectCandidateAtIndex(
&self,
textView: &NSTextView,
index: NSUInteger
) -> bool
pub unsafe fn textView_clickedOnLink(
&self,
textView: &NSTextView,
link: Option<&Object>
) -> bool
pub unsafe fn textView_clickedOnCell_inRect(
&self,
textView: &NSTextView,
cell: Option<&NSTextAttachmentCell>,
cellFrame: NSRect
)
pub unsafe fn textView_doubleClickedOnCell_inRect(
&self,
textView: &NSTextView,
cell: Option<&NSTextAttachmentCell>,
cellFrame: NSRect
)
pub unsafe fn textView_draggedCell_inRect_event(
&self,
view: &NSTextView,
cell: Option<&NSTextAttachmentCell>,
rect: NSRect,
event: Option<&NSEvent>
)
Methods from Deref<Target = Object>§
sourcepub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere
T: Encode,
pub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere
T: Encode,
Returns a pointer to the instance variable / ivar with the given name.
This is similar to [UnsafeCell::get], see that for more information
on what is and isn’t safe to do.
Usually you will have defined the instance variable yourself with
ClassBuilder::add_ivar, the type of the ivar T must match the
type used in that.
Attempting to access or modify private implementation details of a class that you do no control using this is not supported, and may invoke undefined behaviour.
Library implementors are strongly encouraged to expose a safe interface to the ivar.
Panics
May panic if the object has no ivar with the given name. May also
panic if the type encoding of the ivar differs from the type encoding
of T.
This should purely seen as help while debugging and is not guaranteed
(e.g. it may be disabled when debug_assertions are off).
Safety
The object must have an instance variable with the given name, and it
must be of type T. Any invariants that the object have assumed about
the value of the instance variable must not be violated.
No thread syncronization is done on accesses to the variable, so you must ensure that any access to the returned pointer do not cause data races, and that Rust’s mutability rules are not otherwise violated.
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the instance variable with the given name.
See Object::ivar_ptr for more information, including on when this
panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
No thread syncronization is done, so you must ensure that no other
thread is concurrently mutating the variable. This requirement can be
considered upheld if all mutation happens through Object::ivar_mut
(since that takes &mut self).
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: Use Object::ivar instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Object::ivar instead.sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar with the given name.
See Object::ivar_ptr for more information, including on when this
panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
This access happens through &mut self, which means we know it to be
the only reference, hence you do not need to do any work to ensure
that data races do not happen.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: Use Object::ivar_mut instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Object::ivar_mut instead.sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where
T: Encode,
Sets the value of the ivar with the given name.
This is just a helpful shorthand for Object::ivar_mut, see that
for more information.
Safety
Same as Object::ivar_mut.