use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MCAdvertiserAssistant;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MCAdvertiserAssistant {}
);
impl MCAdvertiserAssistant {
extern_methods!(
#[cfg(feature = "MCSession")]
#[unsafe(method(initWithServiceType:discoveryInfo:session:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithServiceType_discoveryInfo_session(
this: Allocated<Self>,
service_type: &NSString,
info: Option<&NSDictionary<NSString, NSString>>,
session: &MCSession,
) -> Retained<Self>;
#[unsafe(method(start))]
#[unsafe(method_family = none)]
pub unsafe fn start(&self);
#[unsafe(method(stop))]
#[unsafe(method_family = none)]
pub unsafe fn stop(&self);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn MCAdvertiserAssistantDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn MCAdvertiserAssistantDelegate>>,
);
#[cfg(feature = "MCSession")]
#[unsafe(method(session))]
#[unsafe(method_family = none)]
pub unsafe fn session(&self) -> Retained<MCSession>;
#[unsafe(method(discoveryInfo))]
#[unsafe(method_family = none)]
pub unsafe fn discoveryInfo(&self) -> Option<Retained<NSDictionary<NSString, NSString>>>;
#[unsafe(method(serviceType))]
#[unsafe(method_family = none)]
pub unsafe fn serviceType(&self) -> Retained<NSString>;
);
}
impl MCAdvertiserAssistant {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait MCAdvertiserAssistantDelegate: NSObjectProtocol {
#[optional]
#[unsafe(method(advertiserAssistantWillPresentInvitation:))]
#[unsafe(method_family = none)]
unsafe fn advertiserAssistantWillPresentInvitation(
&self,
advertiser_assistant: &MCAdvertiserAssistant,
);
#[optional]
#[unsafe(method(advertiserAssistantDidDismissInvitation:))]
#[unsafe(method_family = none)]
unsafe fn advertiserAssistantDidDismissInvitation(
&self,
advertiser_assistant: &MCAdvertiserAssistant,
);
}
);