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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use objc2_ui_kit::*;

use crate::*;

extern_class!(
    /// A specialized `UIContextMenuConfiguration` object to defer a context menu presentation when the
    /// when the context menu gestures are first recognized and a possible menu presentation is not immediately known.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/becontextmenuconfiguration?language=objc)
    #[unsafe(super(UIContextMenuConfiguration, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEContextMenuConfiguration;
);

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

impl BEContextMenuConfiguration {
    extern_methods!(
        /// Fulfills the configuration with a concrete configuration. Once fulfilled, the context menu presentation will begin.
        /// You should call this method as soon as you have determined that a menu presentation is possible for the configuration, as to
        /// minimize the delay between the context menu gesture's recognition and the menu's presentation. If no menu presentation is possible,
        /// fulfill with a `nil` configuration.
        ///
        /// There is a system-defined timeout before the configuration is cancelled, where no menu presents. This method returns `YES` if the
        /// configuration did successfully prepare, and `NO` otherwise.
        ///
        /// : The fulfilled configuration is used by `UIContextMenuInteractionDelegate` when referencing any `UIContextMenuConfiguration`,
        /// rather than this object.
        #[unsafe(method(fulfillUsingConfiguration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fulfillUsingConfiguration(
            &self,
            configuration: Option<&UIContextMenuConfiguration>,
        ) -> bool;

        /// Creates a new configuration for the context menu interaction.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// For a concrete configuration, use the parent `UIContextMenuConfiguration` class instead.
        ///
        /// # Safety
        ///
        /// - `identifier` should be of the correct type.
        /// - `preview_provider` must be a valid pointer or null.
        /// - `action_provider` must be a valid pointer or null.
        #[unsafe(method(configurationWithIdentifier:previewProvider:actionProvider:))]
        #[unsafe(method_family = none)]
        pub unsafe fn configurationWithIdentifier_previewProvider_actionProvider(
            identifier: Option<&ProtocolObject<dyn NSCopying>>,
            preview_provider: UIContextMenuContentPreviewProvider,
            action_provider: UIContextMenuActionProvider,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl BEContextMenuConfiguration {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}