use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct MCBrowserViewController;
);
#[cfg(all(feature = "MCNearbyServiceBrowser", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl MCNearbyServiceBrowserDelegate for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for MCBrowserViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MCBrowserViewController {
extern_methods!(
#[cfg(feature = "MCSession")]
#[unsafe(method(initWithServiceType:session:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithServiceType_session(
this: Allocated<Self>,
service_type: &NSString,
session: &MCSession,
) -> Retained<Self>;
#[cfg(all(feature = "MCNearbyServiceBrowser", feature = "MCSession"))]
#[unsafe(method(initWithBrowser:session:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithBrowser_session(
this: Allocated<Self>,
browser: &MCNearbyServiceBrowser,
session: &MCSession,
) -> Retained<Self>;
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn MCBrowserViewControllerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn MCBrowserViewControllerDelegate>>,
);
#[cfg(feature = "MCNearbyServiceBrowser")]
#[unsafe(method(browser))]
#[unsafe(method_family = none)]
pub unsafe fn browser(&self) -> Retained<MCNearbyServiceBrowser>;
#[cfg(feature = "MCSession")]
#[unsafe(method(session))]
#[unsafe(method_family = none)]
pub unsafe fn session(&self) -> Retained<MCSession>;
#[unsafe(method(minimumNumberOfPeers))]
#[unsafe(method_family = none)]
pub unsafe fn minimumNumberOfPeers(&self) -> NSUInteger;
#[unsafe(method(setMinimumNumberOfPeers:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumNumberOfPeers(&self, minimum_number_of_peers: NSUInteger);
#[unsafe(method(maximumNumberOfPeers))]
#[unsafe(method_family = none)]
pub unsafe fn maximumNumberOfPeers(&self) -> NSUInteger;
#[unsafe(method(setMaximumNumberOfPeers:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumNumberOfPeers(&self, maximum_number_of_peers: NSUInteger);
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MCBrowserViewController {
extern_methods!(
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSNibName>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MCBrowserViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MCBrowserViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait MCBrowserViewControllerDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(browserViewControllerDidFinish:))]
#[unsafe(method_family = none)]
unsafe fn browserViewControllerDidFinish(
&self,
browser_view_controller: &MCBrowserViewController,
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(browserViewControllerWasCancelled:))]
#[unsafe(method_family = none)]
unsafe fn browserViewControllerWasCancelled(
&self,
browser_view_controller: &MCBrowserViewController,
);
#[cfg(all(feature = "MCPeerID", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(browserViewController:shouldPresentNearbyPeer:withDiscoveryInfo:))]
#[unsafe(method_family = none)]
unsafe fn browserViewController_shouldPresentNearbyPeer_withDiscoveryInfo(
&self,
browser_view_controller: &MCBrowserViewController,
peer_id: &MCPeerID,
info: Option<&NSDictionary<NSString, NSString>>,
) -> bool;
}
);