icrate 0.0.1

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)]
    pub struct NSPasteboardItem;

    unsafe impl ClassType for NSPasteboardItem {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl NSPasteboardItem {
        #[method_id(@__retain_semantics Other types)]
        pub unsafe fn types(&self) -> Id<NSArray<NSPasteboardType>, Shared>;

        #[method_id(@__retain_semantics Other availableTypeFromArray:)]
        pub unsafe fn availableTypeFromArray(
            &self,
            types: &NSArray<NSPasteboardType>,
        ) -> Option<Id<NSPasteboardType, Shared>>;

        #[method(setDataProvider:forTypes:)]
        pub unsafe fn setDataProvider_forTypes(
            &self,
            dataProvider: &NSPasteboardItemDataProvider,
            types: &NSArray<NSPasteboardType>,
        ) -> bool;

        #[method(setData:forType:)]
        pub unsafe fn setData_forType(&self, data: &NSData, type_: &NSPasteboardType) -> bool;

        #[method(setString:forType:)]
        pub unsafe fn setString_forType(&self, string: &NSString, type_: &NSPasteboardType)
            -> bool;

        #[method(setPropertyList:forType:)]
        pub unsafe fn setPropertyList_forType(
            &self,
            propertyList: &Object,
            type_: &NSPasteboardType,
        ) -> bool;

        #[method_id(@__retain_semantics Other dataForType:)]
        pub unsafe fn dataForType(&self, type_: &NSPasteboardType) -> Option<Id<NSData, Shared>>;

        #[method_id(@__retain_semantics Other stringForType:)]
        pub unsafe fn stringForType(
            &self,
            type_: &NSPasteboardType,
        ) -> Option<Id<NSString, Shared>>;

        #[method_id(@__retain_semantics Other propertyListForType:)]
        pub unsafe fn propertyListForType(
            &self,
            type_: &NSPasteboardType,
        ) -> Option<Id<Object, Shared>>;
    }
);

extern_protocol!(
    pub struct NSPasteboardItemDataProvider;

    unsafe impl ProtocolType for NSPasteboardItemDataProvider {
        #[method(pasteboard:item:provideDataForType:)]
        pub unsafe fn pasteboard_item_provideDataForType(
            &self,
            pasteboard: Option<&NSPasteboard>,
            item: &NSPasteboardItem,
            type_: &NSPasteboardType,
        );

        #[optional]
        #[method(pasteboardFinishedWithDataProvider:)]
        pub unsafe fn pasteboardFinishedWithDataProvider(&self, pasteboard: &NSPasteboard);
    }
);