objc2_browser_engine_kit/generated/
BEContextMenuConfiguration.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6use objc2_ui_kit::*;
7
8use crate::*;
9
10extern_class!(
11    /// A specialized `UIContextMenuConfiguration` object to defer a context menu presentation when the
12    /// when the context menu gestures are first recognized and a possible menu presentation is not immediately known.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/becontextmenuconfiguration?language=objc)
15    #[unsafe(super(UIContextMenuConfiguration, NSObject))]
16    #[thread_kind = MainThreadOnly]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct BEContextMenuConfiguration;
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for BEContextMenuConfiguration {}
23);
24
25impl BEContextMenuConfiguration {
26    extern_methods!(
27        /// Fulfills the configuration with a concrete configuration. Once fulfilled, the context menu presentation will begin.
28        /// You should call this method as soon as you have determined that a menu presentation is possible for the configuration, as to
29        /// minimize the delay between the context menu gesture's recognition and the menu's presentation. If no menu presentation is possible,
30        /// fulfill with a `nil` configuration.
31        ///
32        /// There is a system-defined timeout before the configuration is cancelled, where no menu presents. This method returns `YES` if the
33        /// configuration did successfully prepare, and `NO` otherwise.
34        ///
35        /// : The fulfilled configuration is used by `UIContextMenuInteractionDelegate` when referencing any `UIContextMenuConfiguration`,
36        /// rather than this object.
37        #[unsafe(method(fulfillUsingConfiguration:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn fulfillUsingConfiguration(
40            &self,
41            configuration: Option<&UIContextMenuConfiguration>,
42        ) -> bool;
43
44        /// Creates a new configuration for the context menu interaction.
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        /// For a concrete configuration, use the parent `UIContextMenuConfiguration` class instead.
50        ///
51        /// # Safety
52        ///
53        /// - `identifier` should be of the correct type.
54        /// - `preview_provider` must be a valid pointer or null.
55        /// - `action_provider` must be a valid pointer or null.
56        #[unsafe(method(configurationWithIdentifier:previewProvider:actionProvider:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn configurationWithIdentifier_previewProvider_actionProvider(
59            identifier: Option<&ProtocolObject<dyn NSCopying>>,
60            preview_provider: UIContextMenuContentPreviewProvider,
61            action_provider: UIContextMenuActionProvider,
62            mtm: MainThreadMarker,
63        ) -> Retained<Self>;
64    );
65}
66
67/// Methods declared on superclass `NSObject`.
68impl BEContextMenuConfiguration {
69    extern_methods!(
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
73    );
74}