//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSToolbarItem")]
    pub struct NSSharingServicePickerToolbarItem;

    #[cfg(feature = "NSToolbarItem")]
    unsafe impl ClassType for NSSharingServicePickerToolbarItem {
        #[inherits(NSObject)]
        type Super = NSToolbarItem;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "NSToolbarItem")]
unsafe impl NSCopying for NSSharingServicePickerToolbarItem {}

#[cfg(feature = "NSToolbarItem")]
unsafe impl NSObjectProtocol for NSSharingServicePickerToolbarItem {}

extern_methods!(
    #[cfg(feature = "NSToolbarItem")]
    unsafe impl NSSharingServicePickerToolbarItem {
        #[cfg(feature = "NSSharingService")]
        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>>;

        #[cfg(feature = "NSSharingService")]
        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn NSSharingServicePickerToolbarItemDelegate>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSToolbarItem`
    #[cfg(feature = "NSToolbarItem")]
    unsafe impl NSSharingServicePickerToolbarItem {
        #[cfg(feature = "NSToolbar")]
        #[method_id(@__retain_semantics Init initWithItemIdentifier:)]
        pub unsafe fn initWithItemIdentifier(
            this: Allocated<Self>,
            item_identifier: &NSToolbarItemIdentifier,
        ) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "NSToolbarItem")]
    unsafe impl NSSharingServicePickerToolbarItem {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_protocol!(
    #[cfg(feature = "NSSharingService")]
    pub unsafe trait NSSharingServicePickerToolbarItemDelegate:
        NSSharingServicePickerDelegate + IsMainThreadOnly
    {
        #[cfg(feature = "NSToolbarItem")]
        #[method_id(@__retain_semantics Other itemsForSharingServicePickerToolbarItem:)]
        unsafe fn itemsForSharingServicePickerToolbarItem(
            &self,
            picker_toolbar_item: &NSSharingServicePickerToolbarItem,
        ) -> Retained<NSArray>;
    }

    #[cfg(feature = "NSSharingService")]
    unsafe impl ProtocolType for dyn NSSharingServicePickerToolbarItemDelegate {}
);
