Struct icrate::AppKit::NSTextLayoutManager
source · #[repr(C)]pub struct NSTextLayoutManager { /* private fields */ }AppKit only.Implementations§
source§impl NSTextLayoutManager
impl NSTextLayoutManager
pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder
) -> Option<Id<Self, Shared>>
pub unsafe fn delegate(&self) -> Option<Id<NSTextLayoutManagerDelegate, Shared>>
pub unsafe fn setDelegate(&self, delegate: Option<&NSTextLayoutManagerDelegate>)
pub unsafe fn usesFontLeading(&self) -> bool
pub unsafe fn setUsesFontLeading(&self, usesFontLeading: bool)
pub unsafe fn limitsLayoutForSuspiciousContents(&self) -> bool
pub unsafe fn setLimitsLayoutForSuspiciousContents(
&self,
limitsLayoutForSuspiciousContents: bool
)
pub unsafe fn usesHyphenation(&self) -> bool
pub unsafe fn setUsesHyphenation(&self, usesHyphenation: bool)
pub unsafe fn textContentManager(
&self
) -> Option<Id<NSTextContentManager, Shared>>
pub unsafe fn replaceTextContentManager(
&self,
textContentManager: &NSTextContentManager
)
pub unsafe fn textContainer(&self) -> Option<Id<NSTextContainer, Shared>>
pub unsafe fn setTextContainer(&self, textContainer: Option<&NSTextContainer>)
pub unsafe fn usageBoundsForTextContainer(&self) -> CGRect
pub unsafe fn textViewportLayoutController(
&self
) -> Id<NSTextViewportLayoutController, Shared>
pub unsafe fn layoutQueue(&self) -> Option<Id<NSOperationQueue, Shared>>
pub unsafe fn setLayoutQueue(&self, layoutQueue: Option<&NSOperationQueue>)
pub unsafe fn ensureLayoutForRange(&self, range: &NSTextRange)
pub unsafe fn ensureLayoutForBounds(&self, bounds: CGRect)
pub unsafe fn invalidateLayoutForRange(&self, range: &NSTextRange)
pub unsafe fn textLayoutFragmentForPosition(
&self,
position: CGPoint
) -> Option<Id<NSTextLayoutFragment, Shared>>
pub unsafe fn textLayoutFragmentForLocation(
&self,
location: &NSTextLocation
) -> Option<Id<NSTextLayoutFragment, Shared>>
pub unsafe fn enumerateTextLayoutFragmentsFromLocation_options_usingBlock(
&self,
location: Option<&NSTextLocation>,
options: NSTextLayoutFragmentEnumerationOptions,
block: &Block<(NonNull<NSTextLayoutFragment>,), Bool>
) -> Option<Id<NSTextLocation, Shared>>
pub unsafe fn textSelections(&self) -> Id<NSArray<NSTextSelection>, Shared>
pub unsafe fn setTextSelections(&self, textSelections: &NSArray<NSTextSelection>)
pub unsafe fn enumerateRenderingAttributesFromLocation_reverse_usingBlock(
&self,
location: &NSTextLocation,
reverse: bool,
block: &Block<(NonNull<NSTextLayoutManager>, NonNull<NSDictionary<NSAttributedStringKey, Object>>, NonNull<NSTextRange>), Bool>
)
pub unsafe fn setRenderingAttributes_forTextRange(
&self,
renderingAttributes: &NSDictionary<NSAttributedStringKey, Object>,
textRange: &NSTextRange
)
pub unsafe fn addRenderingAttribute_value_forTextRange(
&self,
renderingAttribute: &NSAttributedStringKey,
value: Option<&Object>,
textRange: &NSTextRange
)
pub unsafe fn removeRenderingAttribute_forTextRange(
&self,
renderingAttribute: &NSAttributedStringKey,
textRange: &NSTextRange
)
pub unsafe fn invalidateRenderingAttributesForTextRange(
&self,
textRange: &NSTextRange
)
pub unsafe fn renderingAttributesValidator(
&self
) -> *mut Block<(NonNull<NSTextLayoutManager>, NonNull<NSTextLayoutFragment>), ()>
pub unsafe fn setRenderingAttributesValidator(
&self,
renderingAttributesValidator: Option<&Block<(NonNull<NSTextLayoutManager>, NonNull<NSTextLayoutFragment>), ()>>
)
pub unsafe fn linkRenderingAttributes(
) -> Id<NSDictionary<NSAttributedStringKey, Object>, Shared>
pub unsafe fn renderingAttributesForLink_atLocation(
&self,
link: &Object,
location: &NSTextLocation
) -> Id<NSDictionary<NSAttributedStringKey, Object>, Shared>
pub unsafe fn enumerateTextSegmentsInRange_type_options_usingBlock(
&self,
textRange: &NSTextRange,
type_: NSTextLayoutManagerSegmentType,
options: NSTextLayoutManagerSegmentOptions,
block: &Block<(*mut NSTextRange, CGRect, CGFloat, NonNull<NSTextContainer>), Bool>
)
pub unsafe fn replaceContentsInRange_withTextElements(
&self,
range: &NSTextRange,
textElements: &NSArray<NSTextElement>
)
pub unsafe fn replaceContentsInRange_withAttributedString(
&self,
range: &NSTextRange,
attributedString: &NSAttributedString
)
Methods from Deref<Target = NSObject>§
sourcepub fn is_kind_of<T>(&self) -> boolwhere
T: ClassType,
Available on crate feature Foundation only.
pub fn is_kind_of<T>(&self) -> boolwhere
T: ClassType,
Foundation only.Check if the object is an instance of the class, or one of it’s subclasses.
See Apple’s documentation for more details on what you may (and what you may not) do with this information.
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.
Trait Implementations§
source§impl AsMut<NSObject> for NSTextLayoutManager
impl AsMut<NSObject> for NSTextLayoutManager
source§impl AsMut<Object> for NSTextLayoutManager
impl AsMut<Object> for NSTextLayoutManager
source§impl AsRef<NSObject> for NSTextLayoutManager
impl AsRef<NSObject> for NSTextLayoutManager
source§impl AsRef<Object> for NSTextLayoutManager
impl AsRef<Object> for NSTextLayoutManager
source§impl Borrow<NSObject> for NSTextLayoutManager
impl Borrow<NSObject> for NSTextLayoutManager
source§impl Borrow<Object> for NSTextLayoutManager
impl Borrow<Object> for NSTextLayoutManager
source§impl BorrowMut<NSObject> for NSTextLayoutManager
impl BorrowMut<NSObject> for NSTextLayoutManager
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
source§impl BorrowMut<Object> for NSTextLayoutManager
impl BorrowMut<Object> for NSTextLayoutManager
source§fn borrow_mut(&mut self) -> &mut Object
fn borrow_mut(&mut self) -> &mut Object
source§impl ClassType for NSTextLayoutManager
impl ClassType for NSTextLayoutManager
source§impl Debug for NSTextLayoutManager
impl Debug for NSTextLayoutManager
source§impl Deref for NSTextLayoutManager
impl Deref for NSTextLayoutManager
source§impl DerefMut for NSTextLayoutManager
impl DerefMut for NSTextLayoutManager
source§impl Hash for NSTextLayoutManager
impl Hash for NSTextLayoutManager
source§impl PartialEq<NSTextLayoutManager> for NSTextLayoutManager
impl PartialEq<NSTextLayoutManager> for NSTextLayoutManager
source§fn eq(&self, other: &NSTextLayoutManager) -> bool
fn eq(&self, other: &NSTextLayoutManager) -> bool
self and other values to be equal, and is used
by ==.