#[repr(C)]pub struct CTRubyAnnotation { /* private fields */ }CTRubyAnnotation only.Expand description
Implementations§
Source§impl CTRubyAnnotation
impl CTRubyAnnotation
Sourcepub unsafe fn with_attributes(
alignment: CTRubyAlignment,
overhang: CTRubyOverhang,
position: CTRubyPosition,
string: &CFString,
attributes: &CFDictionary,
) -> CFRetained<CTRubyAnnotation>
pub unsafe fn with_attributes( alignment: CTRubyAlignment, overhang: CTRubyOverhang, position: CTRubyPosition, string: &CFString, attributes: &CFDictionary, ) -> CFRetained<CTRubyAnnotation>
Creates an immutable ruby annotation object.
Using this function to create a ruby annotation object with more precise control of the annotation text.
Parameter alignment: Specifies how the ruby text and the base text should be aligned relative to each other.
Parameter overhang: Specifies how the ruby text can overhang adjacent characters.
Parameter position: The position of the annotation text.
Parameter string: A string without any formatting, its format will be derived from the attrs specified below.
Parameter attributes: A attribute dictionary to combine with the string specified above. If you don’t specify
kCTFontAttributeName, the font used by the Ruby annotation will be deduced from the base
text, with a size factor specified by a CFNumberRef value keyed by
kCTRubyAnnotationSizeFactorAttributeName.
Returns: This function will return a reference to a CTRubyAnnotation object.
Sourcepub unsafe fn copy(self: &CTRubyAnnotation) -> CFRetained<CTRubyAnnotation>
pub unsafe fn copy(self: &CTRubyAnnotation) -> CFRetained<CTRubyAnnotation>
Creates an immutable copy of a ruby annotation object.
Parameter rubyAnnotation: The ruby annotation that you wish to copy.
Returns: If the “rubyAnnotation” reference is valid, then this function will return valid reference to an immutable CTRubyAnnotation object that is a copy of the one passed into “rubyAnnotation”.
Sourcepub unsafe fn alignment(self: &CTRubyAnnotation) -> CTRubyAlignment
pub unsafe fn alignment(self: &CTRubyAnnotation) -> CTRubyAlignment
Get the alignment value of a ruby annotation object.
Parameter rubyAnnotation: The ruby annotation object.
Returns: If the “rubyAnnotation” reference is valid, then this function will return its alignment. Otherwise it will return kCTRubyAlignmentInvalid.
Sourcepub unsafe fn overhang(self: &CTRubyAnnotation) -> CTRubyOverhang
pub unsafe fn overhang(self: &CTRubyAnnotation) -> CTRubyOverhang
Get the overhang value of a ruby annotation object.
Parameter rubyAnnotation: The ruby annotation object.
Returns: If the “rubyAnnotation” reference is valid, then this function will return its overhang value. Otherwise it will return kCTRubyOverhangInvalid.
Sourcepub unsafe fn size_factor(self: &CTRubyAnnotation) -> CGFloat
pub unsafe fn size_factor(self: &CTRubyAnnotation) -> CGFloat
Get the size factor of a ruby annotation object.
Parameter rubyAnnotation: The ruby annotation object.
Returns: If the “rubyAnnotation” reference is valid, then this function will return its sizeFactor. Otherwise it will return 0.
Sourcepub unsafe fn text_for_position(
self: &CTRubyAnnotation,
position: CTRubyPosition,
) -> Option<CFRetained<CFString>>
pub unsafe fn text_for_position( self: &CTRubyAnnotation, position: CTRubyPosition, ) -> Option<CFRetained<CFString>>
Get the ruby text for a particular position in a ruby annotation.
Parameter rubyAnnotation: The ruby annotation object.
Parameter position: The position for which you want to get the ruby text.
Returns: If the “rubyAnnotation” reference and the position are valid, then this function will return a CFStringRef for the text. Otherwise it will return NULL.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Attempt to downcast the type to that of type T.
This is the reference-variant. Use CFRetained::downcast if you
want to convert a retained type. See also ConcreteType for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CTRubyAnnotation
impl AsRef<AnyObject> for CTRubyAnnotation
Source§impl AsRef<CFType> for CTRubyAnnotation
impl AsRef<CFType> for CTRubyAnnotation
Source§impl AsRef<CTRubyAnnotation> for CTRubyAnnotation
impl AsRef<CTRubyAnnotation> for CTRubyAnnotation
Source§impl Borrow<AnyObject> for CTRubyAnnotation
impl Borrow<AnyObject> for CTRubyAnnotation
Source§impl Borrow<CFType> for CTRubyAnnotation
impl Borrow<CFType> for CTRubyAnnotation
Source§impl ConcreteType for CTRubyAnnotation
impl ConcreteType for CTRubyAnnotation
Source§impl Debug for CTRubyAnnotation
impl Debug for CTRubyAnnotation
Source§impl Deref for CTRubyAnnotation
impl Deref for CTRubyAnnotation
Source§impl Hash for CTRubyAnnotation
impl Hash for CTRubyAnnotation
Source§impl Message for CTRubyAnnotation
impl Message for CTRubyAnnotation
Source§impl PartialEq for CTRubyAnnotation
impl PartialEq for CTRubyAnnotation
Source§impl RefEncode for CTRubyAnnotation
impl RefEncode for CTRubyAnnotation
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for CTRubyAnnotation
impl Type for CTRubyAnnotation
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation crate. Read more