use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
#[doc(alias = "NSTextAttachmentCell")]
#[name = "NSTextAttachmentCell"]
pub unsafe trait NSTextAttachmentCellProtocol: NSObjectProtocol {
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(drawWithFrame:inView:))]
#[unsafe(method_family = none)]
fn drawWithFrame_inView(
&self,
cell_frame: NSRect,
control_view: Option<&NSView>,
mtm: MainThreadMarker,
);
#[unsafe(method(wantsToTrackMouse))]
#[unsafe(method_family = none)]
fn wantsToTrackMouse(&self, mtm: MainThreadMarker) -> bool;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(highlight:withFrame:inView:))]
#[unsafe(method_family = none)]
fn highlight_withFrame_inView(
&self,
flag: bool,
cell_frame: NSRect,
control_view: Option<&NSView>,
mtm: MainThreadMarker,
);
#[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(trackMouse:inRect:ofView:untilMouseUp:))]
#[unsafe(method_family = none)]
fn trackMouse_inRect_ofView_untilMouseUp(
&self,
the_event: &NSEvent,
cell_frame: NSRect,
control_view: Option<&NSView>,
flag: bool,
mtm: MainThreadMarker,
) -> bool;
#[unsafe(method(cellSize))]
#[unsafe(method_family = none)]
fn cellSize(&self) -> NSSize;
#[unsafe(method(cellBaselineOffset))]
#[unsafe(method_family = none)]
fn cellBaselineOffset(&self) -> NSPoint;
#[cfg(feature = "NSTextAttachment")]
#[unsafe(method(attachment))]
#[unsafe(method_family = none)]
unsafe fn attachment(&self) -> Option<Retained<NSTextAttachment>>;
#[cfg(feature = "NSTextAttachment")]
#[unsafe(method(setAttachment:))]
#[unsafe(method_family = none)]
unsafe fn setAttachment(&self, attachment: Option<&NSTextAttachment>);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(drawWithFrame:inView:characterIndex:))]
#[unsafe(method_family = none)]
fn drawWithFrame_inView_characterIndex(
&self,
cell_frame: NSRect,
control_view: Option<&NSView>,
char_index: NSUInteger,
mtm: MainThreadMarker,
);
#[cfg(all(
feature = "NSLayoutManager",
feature = "NSResponder",
feature = "NSView"
))]
#[unsafe(method(drawWithFrame:inView:characterIndex:layoutManager:))]
#[unsafe(method_family = none)]
fn drawWithFrame_inView_characterIndex_layoutManager(
&self,
cell_frame: NSRect,
control_view: Option<&NSView>,
char_index: NSUInteger,
layout_manager: &NSLayoutManager,
mtm: MainThreadMarker,
);
#[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(wantsToTrackMouseForEvent:inRect:ofView:atCharacterIndex:))]
#[unsafe(method_family = none)]
fn wantsToTrackMouseForEvent_inRect_ofView_atCharacterIndex(
&self,
the_event: &NSEvent,
cell_frame: NSRect,
control_view: Option<&NSView>,
char_index: NSUInteger,
mtm: MainThreadMarker,
) -> bool;
#[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(trackMouse:inRect:ofView:atCharacterIndex:untilMouseUp:))]
#[unsafe(method_family = none)]
fn trackMouse_inRect_ofView_atCharacterIndex_untilMouseUp(
&self,
the_event: &NSEvent,
cell_frame: NSRect,
control_view: Option<&NSView>,
char_index: NSUInteger,
flag: bool,
mtm: MainThreadMarker,
) -> bool;
#[cfg(feature = "NSTextContainer")]
#[unsafe(method(cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:))]
#[unsafe(method_family = none)]
fn cellFrameForTextContainer_proposedLineFragment_glyphPosition_characterIndex(
&self,
text_container: &NSTextContainer,
line_frag: NSRect,
position: NSPoint,
char_index: NSUInteger,
) -> NSRect;
}
);
extern_class!(
#[unsafe(super(NSCell, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSCell")]
pub struct NSTextAttachmentCell;
);
#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
extern_conformance!(
unsafe impl NSAccessibility for NSTextAttachmentCell {}
);
#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSTextAttachmentCell {}
);
#[cfg(feature = "NSCell")]
extern_conformance!(
unsafe impl NSCoding for NSTextAttachmentCell {}
);
#[cfg(feature = "NSCell")]
extern_conformance!(
unsafe impl NSCopying for NSTextAttachmentCell {}
);
#[cfg(feature = "NSCell")]
unsafe impl CopyingHelper for NSTextAttachmentCell {
type Result = Self;
}
#[cfg(feature = "NSCell")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSTextAttachmentCell {}
);
#[cfg(feature = "NSCell")]
extern_conformance!(
unsafe impl NSTextAttachmentCellProtocol for NSTextAttachmentCell {}
);
#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSTextAttachmentCell {}
);
#[cfg(feature = "NSCell")]
impl NSTextAttachmentCell {
extern_methods!();
}
#[cfg(feature = "NSCell")]
impl NSTextAttachmentCell {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initTextCell:))]
#[unsafe(method_family = init)]
pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
#[cfg(feature = "NSImage")]
#[unsafe(method(initImageCell:))]
#[unsafe(method_family = init)]
pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
);
}
#[cfg(feature = "NSCell")]
impl NSTextAttachmentCell {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}