use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKNavigationType(pub NSInteger);
impl WKNavigationType {
#[doc(alias = "WKNavigationTypeLinkActivated")]
pub const LinkActivated: Self = Self(0);
#[doc(alias = "WKNavigationTypeFormSubmitted")]
pub const FormSubmitted: Self = Self(1);
#[doc(alias = "WKNavigationTypeBackForward")]
pub const BackForward: Self = Self(2);
#[doc(alias = "WKNavigationTypeReload")]
pub const Reload: Self = Self(3);
#[doc(alias = "WKNavigationTypeFormResubmitted")]
pub const FormResubmitted: Self = Self(4);
#[doc(alias = "WKNavigationTypeOther")]
pub const Other: Self = Self(-1);
}
unsafe impl Encode for WKNavigationType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKNavigationType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKNavigationAction;
unsafe impl ClassType for WKNavigationAction {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for WKNavigationAction {}
extern_methods!(
unsafe impl WKNavigationAction {
#[cfg(feature = "WKFrameInfo")]
#[method_id(@__retain_semantics Other targetFrame)]
pub unsafe fn targetFrame(&self) -> Option<Retained<WKFrameInfo>>;
#[method(navigationType)]
pub unsafe fn navigationType(&self) -> WKNavigationType;
#[method_id(@__retain_semantics Other request)]
pub unsafe fn request(&self) -> Retained<NSURLRequest>;
#[method(shouldPerformDownload)]
pub unsafe fn shouldPerformDownload(&self) -> bool;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[method(modifierFlags)]
pub unsafe fn modifierFlags(&self) -> NSEventModifierFlags;
#[method(buttonNumber)]
pub unsafe fn buttonNumber(&self) -> NSInteger;
}
);
extern_methods!(
unsafe impl WKNavigationAction {
#[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() -> Retained<Self>;
}
);