objc2-browser-engine-kit 0.3.2

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

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bekeyentrycontext?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEKeyEntryContext;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for BEKeyEntryContext {}
);

impl BEKeyEntryContext {
    extern_methods!(
        #[cfg(feature = "BEKeyEntry")]
        /// BEKeyEntry for which this context is representing.
        #[unsafe(method(keyEntry))]
        #[unsafe(method_family = none)]
        pub unsafe fn keyEntry(&self) -> Retained<BEKeyEntry>;

        /// Represents whether the web document is editable
        #[unsafe(method(isDocumentEditable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isDocumentEditable(&self) -> bool;

        /// Setter for [`isDocumentEditable`][Self::isDocumentEditable].
        #[unsafe(method(setDocumentEditable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDocumentEditable(&self, document_editable: bool);

        /// Represents whether a character should be inserted.
        #[unsafe(method(shouldInsertCharacter))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldInsertCharacter(&self) -> bool;

        /// Setter for [`shouldInsertCharacter`][Self::shouldInsertCharacter].
        #[unsafe(method(setShouldInsertCharacter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldInsertCharacter(&self, should_insert_character: bool);

        /// Represents whether the key event should be evaluated within the context of a composed input mode.
        ///
        /// When using an input mode with composed input, such as Chinese/Japanese/Korean, the markedText
        /// will be used to combine multiple key events into a single character.
        #[unsafe(method(shouldEvaluateForInputSystemHandling))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldEvaluateForInputSystemHandling(&self) -> bool;

        /// Setter for [`shouldEvaluateForInputSystemHandling`][Self::shouldEvaluateForInputSystemHandling].
        #[unsafe(method(setShouldEvaluateForInputSystemHandling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldEvaluateForInputSystemHandling(
            &self,
            should_evaluate_for_input_system_handling: bool,
        );

        #[cfg(feature = "BEKeyEntry")]
        /// Initializes an instance of BEKeyEventContext with its corresponding `keyState`
        #[unsafe(method(initWithKeyEntry:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithKeyEntry(
            this: Allocated<Self>,
            key_entry: &BEKeyEntry,
        ) -> Retained<Self>;

        #[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>;
    );
}