use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextElement;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSTextElement {}
);
impl NSTextElement {
extern_methods!(
#[cfg(feature = "NSTextContentManager")]
#[unsafe(method(initWithTextContentManager:))]
#[unsafe(method_family = init)]
pub fn initWithTextContentManager(
this: Allocated<Self>,
text_content_manager: Option<&NSTextContentManager>,
) -> Retained<Self>;
#[cfg(feature = "NSTextContentManager")]
#[unsafe(method(textContentManager))]
#[unsafe(method_family = none)]
pub fn textContentManager(&self) -> Option<Retained<NSTextContentManager>>;
#[cfg(feature = "NSTextContentManager")]
#[unsafe(method(setTextContentManager:))]
#[unsafe(method_family = none)]
pub fn setTextContentManager(&self, text_content_manager: Option<&NSTextContentManager>);
#[cfg(feature = "NSTextRange")]
#[unsafe(method(elementRange))]
#[unsafe(method_family = none)]
pub fn elementRange(&self) -> Option<Retained<NSTextRange>>;
#[cfg(feature = "NSTextRange")]
#[unsafe(method(setElementRange:))]
#[unsafe(method_family = none)]
pub fn setElementRange(&self, element_range: Option<&NSTextRange>);
#[unsafe(method(childElements))]
#[unsafe(method_family = none)]
pub fn childElements(&self) -> Retained<NSArray<NSTextElement>>;
#[unsafe(method(parentElement))]
#[unsafe(method_family = none)]
pub fn parentElement(&self) -> Option<Retained<NSTextElement>>;
#[unsafe(method(isRepresentedElement))]
#[unsafe(method_family = none)]
pub fn isRepresentedElement(&self) -> bool;
);
}
impl NSTextElement {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSTextElement {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSTextElement, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextParagraph;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSTextParagraph {}
);
impl NSTextParagraph {
extern_methods!(
#[unsafe(method(initWithAttributedString:))]
#[unsafe(method_family = init)]
pub fn initWithAttributedString(
this: Allocated<Self>,
attributed_string: Option<&NSAttributedString>,
) -> Retained<Self>;
#[unsafe(method(attributedString))]
#[unsafe(method_family = none)]
pub fn attributedString(&self) -> Retained<NSAttributedString>;
#[cfg(feature = "NSTextRange")]
#[unsafe(method(paragraphContentRange))]
#[unsafe(method_family = none)]
pub fn paragraphContentRange(&self) -> Option<Retained<NSTextRange>>;
#[cfg(feature = "NSTextRange")]
#[unsafe(method(paragraphSeparatorRange))]
#[unsafe(method_family = none)]
pub fn paragraphSeparatorRange(&self) -> Option<Retained<NSTextRange>>;
);
}
impl NSTextParagraph {
extern_methods!(
#[cfg(feature = "NSTextContentManager")]
#[unsafe(method(initWithTextContentManager:))]
#[unsafe(method_family = init)]
pub fn initWithTextContentManager(
this: Allocated<Self>,
text_content_manager: Option<&NSTextContentManager>,
) -> Retained<Self>;
);
}
impl NSTextParagraph {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSTextParagraph {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}