icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AppKit_NSTextLineFragment")]
    pub struct NSTextLineFragment;

    #[cfg(feature = "AppKit_NSTextLineFragment")]
    unsafe impl ClassType for NSTextLineFragment {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "AppKit_NSTextLineFragment")]
unsafe impl NSCoding for NSTextLineFragment {}

#[cfg(feature = "AppKit_NSTextLineFragment")]
unsafe impl NSObjectProtocol for NSTextLineFragment {}

#[cfg(feature = "AppKit_NSTextLineFragment")]
unsafe impl NSSecureCoding for NSTextLineFragment {}

extern_methods!(
    #[cfg(feature = "AppKit_NSTextLineFragment")]
    unsafe impl NSTextLineFragment {
        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method_id(@__retain_semantics Init initWithAttributedString:range:)]
        pub unsafe fn initWithAttributedString_range(
            this: Allocated<Self>,
            attributed_string: &NSAttributedString,
            range: NSRange,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder)
            -> Option<Id<Self>>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Init initWithString:attributes:range:)]
        pub unsafe fn initWithString_attributes_range(
            this: Allocated<Self>,
            string: &NSString,
            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
            range: NSRange,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method_id(@__retain_semantics Other attributedString)]
        pub unsafe fn attributedString(&self) -> Id<NSAttributedString>;

        #[method(characterRange)]
        pub unsafe fn characterRange(&self) -> NSRange;

        #[method(typographicBounds)]
        pub unsafe fn typographicBounds(&self) -> CGRect;

        #[method(glyphOrigin)]
        pub unsafe fn glyphOrigin(&self) -> CGPoint;

        #[method(locationForCharacterAtIndex:)]
        pub unsafe fn locationForCharacterAtIndex(&self, index: NSInteger) -> CGPoint;

        #[method(characterIndexForPoint:)]
        pub unsafe fn characterIndexForPoint(&self, point: CGPoint) -> NSInteger;

        #[method(fractionOfDistanceThroughGlyphForPoint:)]
        pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: CGPoint) -> CGFloat;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "AppKit_NSTextLineFragment")]
    unsafe impl NSTextLineFragment {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);