use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type NSDraggingImageComponentKey = NSString;
extern "C" {
pub static NSDraggingImageComponentIconKey: &'static NSDraggingImageComponentKey;
}
extern "C" {
pub static NSDraggingImageComponentLabelKey: &'static NSDraggingImageComponentKey;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSDraggingImageComponent;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSDraggingImageComponent {}
);
impl NSDraggingImageComponent {
extern_methods!(
#[unsafe(method(draggingImageComponentWithKey:))]
#[unsafe(method_family = none)]
pub fn draggingImageComponentWithKey(
key: &NSDraggingImageComponentKey,
) -> Retained<NSDraggingImageComponent>;
#[unsafe(method(initWithKey:))]
#[unsafe(method_family = init)]
pub fn initWithKey(
this: Allocated<Self>,
key: &NSDraggingImageComponentKey,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(key))]
#[unsafe(method_family = none)]
pub fn key(&self) -> Retained<NSDraggingImageComponentKey>;
#[unsafe(method(setKey:))]
#[unsafe(method_family = none)]
pub fn setKey(&self, key: &NSDraggingImageComponentKey);
#[unsafe(method(contents))]
#[unsafe(method_family = none)]
pub fn contents(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setContents:))]
#[unsafe(method_family = none)]
pub unsafe fn setContents(&self, contents: Option<&AnyObject>);
#[unsafe(method(frame))]
#[unsafe(method_family = none)]
pub fn frame(&self) -> NSRect;
#[unsafe(method(setFrame:))]
#[unsafe(method_family = none)]
pub fn setFrame(&self, frame: NSRect);
);
}
impl NSDraggingImageComponent {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSDraggingItem;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSDraggingItem {}
);
impl NSDraggingItem {
extern_methods!(
#[cfg(feature = "NSPasteboard")]
#[unsafe(method(initWithPasteboardWriter:))]
#[unsafe(method_family = init)]
pub fn initWithPasteboardWriter(
this: Allocated<Self>,
pasteboard_writer: &ProtocolObject<dyn NSPasteboardWriting>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(item))]
#[unsafe(method_family = none)]
pub fn item(&self) -> Retained<AnyObject>;
#[unsafe(method(draggingFrame))]
#[unsafe(method_family = none)]
pub fn draggingFrame(&self) -> NSRect;
#[unsafe(method(setDraggingFrame:))]
#[unsafe(method_family = none)]
pub fn setDraggingFrame(&self, dragging_frame: NSRect);
#[cfg(feature = "block2")]
#[unsafe(method(imageComponentsProvider))]
#[unsafe(method_family = none)]
pub fn imageComponentsProvider(
&self,
) -> *mut block2::DynBlock<dyn Fn() -> NonNull<NSArray<NSDraggingImageComponent>>>;
#[cfg(feature = "block2")]
#[unsafe(method(setImageComponentsProvider:))]
#[unsafe(method_family = none)]
pub unsafe fn setImageComponentsProvider(
&self,
image_components_provider: Option<
&block2::DynBlock<dyn Fn() -> NonNull<NSArray<NSDraggingImageComponent>>>,
>,
);
#[unsafe(method(setDraggingFrame:contents:))]
#[unsafe(method_family = none)]
pub unsafe fn setDraggingFrame_contents(&self, frame: NSRect, contents: Option<&AnyObject>);
#[unsafe(method(imageComponents))]
#[unsafe(method_family = none)]
pub fn imageComponents(&self) -> Option<Retained<NSArray<NSDraggingImageComponent>>>;
);
}
impl NSDraggingItem {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}