objc2-web-kit 0.2.2

Bindings to the WebKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKContentMode(pub NSInteger);
impl WKContentMode {
    #[doc(alias = "WKContentModeRecommended")]
    pub const Recommended: Self = Self(0);
    #[doc(alias = "WKContentModeMobile")]
    pub const Mobile: Self = Self(1);
    #[doc(alias = "WKContentModeDesktop")]
    pub const Desktop: Self = Self(2);
}

unsafe impl Encode for WKContentMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for WKContentMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WKWebpagePreferences;

    unsafe impl ClassType for WKWebpagePreferences {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for WKWebpagePreferences {}

extern_methods!(
    unsafe impl WKWebpagePreferences {
        #[method(preferredContentMode)]
        pub unsafe fn preferredContentMode(&self) -> WKContentMode;

        #[method(setPreferredContentMode:)]
        pub unsafe fn setPreferredContentMode(&self, preferred_content_mode: WKContentMode);

        #[method(allowsContentJavaScript)]
        pub unsafe fn allowsContentJavaScript(&self) -> bool;

        #[method(setAllowsContentJavaScript:)]
        pub unsafe fn setAllowsContentJavaScript(&self, allows_content_java_script: bool);

        #[method(isLockdownModeEnabled)]
        pub unsafe fn isLockdownModeEnabled(&self) -> bool;

        #[method(setLockdownModeEnabled:)]
        pub unsafe fn setLockdownModeEnabled(&self, lockdown_mode_enabled: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl WKWebpagePreferences {
        #[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>;
    }
);