use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static UIStateRestorationViewControllerStoryboardKey: &'static NSString;
}
extern "C" {
pub static UIApplicationStateRestorationBundleVersionKey: &'static NSString;
}
extern "C" {
pub static UIApplicationStateRestorationUserInterfaceIdiomKey: &'static NSString;
}
extern "C" {
pub static UIApplicationStateRestorationTimestampKey: &'static NSString;
}
extern "C" {
pub static UIApplicationStateRestorationSystemVersionKey: &'static NSString;
}
extern_protocol!(
pub unsafe trait UIViewControllerRestoration: MainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[unsafe(method(viewControllerWithRestorationIdentifierPath:coder:))]
#[unsafe(method_family = none)]
unsafe fn viewControllerWithRestorationIdentifierPath_coder(
identifier_components: &NSArray<NSString>,
coder: &NSCoder,
mtm: MainThreadMarker,
) -> Option<Retained<UIViewController>>;
}
);
extern_protocol!(
pub unsafe trait UIDataSourceModelAssociation: MainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(modelIdentifierForElementAtIndexPath:inView:))]
#[unsafe(method_family = none)]
fn modelIdentifierForElementAtIndexPath_inView(
&self,
idx: &NSIndexPath,
view: &UIView,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(indexPathForElementWithModelIdentifier:inView:))]
#[unsafe(method_family = none)]
fn indexPathForElementWithModelIdentifier_inView(
&self,
identifier: &NSString,
view: &UIView,
) -> Option<Retained<NSIndexPath>>;
}
);
extern_protocol!(
pub unsafe trait UIStateRestoring: NSObjectProtocol + MainThreadOnly {
#[optional]
#[unsafe(method(restorationParent))]
#[unsafe(method_family = none)]
fn restorationParent(&self) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
#[optional]
#[unsafe(method(objectRestorationClass))]
#[unsafe(method_family = none)]
fn objectRestorationClass(&self) -> Option<&'static AnyClass>;
#[optional]
#[unsafe(method(encodeRestorableStateWithCoder:))]
#[unsafe(method_family = none)]
unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
#[optional]
#[unsafe(method(decodeRestorableStateWithCoder:))]
#[unsafe(method_family = none)]
unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
#[optional]
#[unsafe(method(applicationFinishedRestoringState))]
#[unsafe(method_family = none)]
fn applicationFinishedRestoringState(&self);
}
);
extern_protocol!(
pub unsafe trait UIObjectRestoration: MainThreadOnly {
#[unsafe(method(objectWithRestorationIdentifierPath:coder:))]
#[unsafe(method_family = none)]
unsafe fn objectWithRestorationIdentifierPath_coder(
identifier_components: &NSArray<NSString>,
coder: &NSCoder,
mtm: MainThreadMarker,
) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
}
);