use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextContainer;
);
extern_conformance!(
unsafe impl NSCoding for NSTextContainer {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSTextContainer {}
);
extern_conformance!(
unsafe impl NSSecureCoding for NSTextContainer {}
);
impl NSTextContainer {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithSize:))]
#[unsafe(method_family = init)]
pub fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "NSTextLayoutManager")]
#[unsafe(method(textLayoutManager))]
#[unsafe(method_family = none)]
pub fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub fn size(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setSize:))]
#[unsafe(method_family = none)]
pub fn setSize(&self, size: CGSize);
#[cfg(feature = "NSParagraphStyle")]
#[unsafe(method(lineBreakMode))]
#[unsafe(method_family = none)]
pub fn lineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSParagraphStyle")]
#[unsafe(method(setLineBreakMode:))]
#[unsafe(method_family = none)]
pub fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(lineFragmentPadding))]
#[unsafe(method_family = none)]
pub fn lineFragmentPadding(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setLineFragmentPadding:))]
#[unsafe(method_family = none)]
pub fn setLineFragmentPadding(&self, line_fragment_padding: CGFloat);
#[unsafe(method(maximumNumberOfLines))]
#[unsafe(method_family = none)]
pub fn maximumNumberOfLines(&self) -> NSUInteger;
#[unsafe(method(setMaximumNumberOfLines:))]
#[unsafe(method_family = none)]
pub fn setMaximumNumberOfLines(&self, maximum_number_of_lines: NSUInteger);
#[cfg(all(feature = "NSText", feature = "objc2-core-foundation"))]
#[unsafe(method(lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:))]
#[unsafe(method_family = none)]
pub unsafe fn lineFragmentRectForProposedRect_atIndex_writingDirection_remainingRect(
&self,
proposed_rect: CGRect,
character_index: NSUInteger,
base_writing_direction: NSWritingDirection,
remaining_rect: *mut CGRect,
) -> CGRect;
#[unsafe(method(isSimpleRectangularTextContainer))]
#[unsafe(method_family = none)]
pub fn isSimpleRectangularTextContainer(&self) -> bool;
#[unsafe(method(widthTracksTextView))]
#[unsafe(method_family = none)]
pub fn widthTracksTextView(&self) -> bool;
#[unsafe(method(setWidthTracksTextView:))]
#[unsafe(method_family = none)]
pub fn setWidthTracksTextView(&self, width_tracks_text_view: bool);
#[unsafe(method(heightTracksTextView))]
#[unsafe(method_family = none)]
pub fn heightTracksTextView(&self) -> bool;
#[unsafe(method(setHeightTracksTextView:))]
#[unsafe(method_family = none)]
pub fn setHeightTracksTextView(&self, height_tracks_text_view: bool);
);
}
impl NSTextContainer {
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 NSTextContainer {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
impl NSTextContainer {
extern_methods!(
#[cfg(feature = "NSLayoutManager")]
#[unsafe(method(layoutManager))]
#[unsafe(method_family = none)]
pub unsafe fn layoutManager(&self) -> Option<Retained<NSLayoutManager>>;
#[cfg(feature = "NSLayoutManager")]
#[unsafe(method(setLayoutManager:))]
#[unsafe(method_family = none)]
pub unsafe fn setLayoutManager(&self, layout_manager: Option<&NSLayoutManager>);
#[cfg(feature = "NSLayoutManager")]
#[unsafe(method(replaceLayoutManager:))]
#[unsafe(method_family = none)]
pub fn replaceLayoutManager(&self, new_layout_manager: &NSLayoutManager);
#[cfg(feature = "UIBezierPath")]
#[unsafe(method(exclusionPaths))]
#[unsafe(method_family = none)]
pub fn exclusionPaths(&self) -> Retained<NSArray<UIBezierPath>>;
#[cfg(feature = "UIBezierPath")]
#[unsafe(method(setExclusionPaths:))]
#[unsafe(method_family = none)]
pub fn setExclusionPaths(&self, exclusion_paths: &NSArray<UIBezierPath>);
);
}
#[cfg(feature = "NSLayoutManager")]
extern_conformance!(
unsafe impl NSTextLayoutOrientationProvider for NSTextContainer {}
);