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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Subclass BEAccessibilityTextMarker to encode information about text-based positioning information in browser engines within document models.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarker?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEAccessibilityTextMarker;
);

extern_conformance!(
    unsafe impl NSCoding for BEAccessibilityTextMarker {}
);

extern_conformance!(
    unsafe impl NSCopying for BEAccessibilityTextMarker {}
);

unsafe impl CopyingHelper for BEAccessibilityTextMarker {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for BEAccessibilityTextMarker {}
);

impl BEAccessibilityTextMarker {
    extern_methods!();
}

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

extern_class!(
    /// BEAccessibilityTextMarkerRange holds the start and end markers for a text range.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarkerrange?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BEAccessibilityTextMarkerRange;
);

extern_conformance!(
    unsafe impl NSCoding for BEAccessibilityTextMarkerRange {}
);

extern_conformance!(
    unsafe impl NSCopying for BEAccessibilityTextMarkerRange {}
);

unsafe impl CopyingHelper for BEAccessibilityTextMarkerRange {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for BEAccessibilityTextMarkerRange {}
);

impl BEAccessibilityTextMarkerRange {
    extern_methods!(
        #[unsafe(method(startMarker))]
        #[unsafe(method_family = none)]
        pub unsafe fn startMarker(&self) -> Retained<BEAccessibilityTextMarker>;

        /// Setter for [`startMarker`][Self::startMarker].
        #[unsafe(method(setStartMarker:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStartMarker(&self, start_marker: &BEAccessibilityTextMarker);

        #[unsafe(method(endMarker))]
        #[unsafe(method_family = none)]
        pub unsafe fn endMarker(&self) -> Retained<BEAccessibilityTextMarker>;

        /// Setter for [`endMarker`][Self::endMarker].
        #[unsafe(method(setEndMarker:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEndMarker(&self, end_marker: &BEAccessibilityTextMarker);
    );
}

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

extern_protocol!(
    /// Implement BEAccessibilityTextMarkerSupport to support assistive technology features that rely on granular text offsets.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/beaccessibilitytextmarkersupport?language=objc)
    pub unsafe trait BEAccessibilityTextMarkerSupport: NSObjectProtocol {
        #[cfg(feature = "objc2-core-foundation")]
        /// The accessibility frame for a text range.
        ///
        /// Parameter `range`: The text marker range.
        ///
        /// Returns: The bounds in accessibility space of the text marker range. If the bounds cannot be determined, return CGRectZero.
        #[unsafe(method(accessibilityBoundsForTextMarkerRange:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityBoundsForTextMarkerRange(
            &self,
            range: &BEAccessibilityTextMarkerRange,
        ) -> CGRect;

        /// The accessibility content for a text range.
        ///
        /// Parameter `range`: The text marker range.
        #[unsafe(method(accessibilityContentForTextMarkerRange:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityContentForTextMarkerRange(
            &self,
            range: &BEAccessibilityTextMarkerRange,
        ) -> Option<Retained<NSString>>;

        /// The text marker range of the current selection. Return nil if there is none.
        #[unsafe(method(accessibilityTextMarkerRangeForCurrentSelection))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityTextMarkerRangeForCurrentSelection(
            &self,
        ) -> Option<Retained<BEAccessibilityTextMarkerRange>>;

        /// The text marker range of the current element.
        #[unsafe(method(accessibilityTextMarkerRange))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityTextMarkerRange(&self) -> Retained<BEAccessibilityTextMarkerRange>;

        /// The text marker after the marker.
        ///
        /// Parameter `marker`: The text marker.
        #[unsafe(method(accessibilityNextTextMarker:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityNextTextMarker(
            &self,
            marker: &BEAccessibilityTextMarker,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        /// The text marker before the marker.
        ///
        /// Parameter `marker`: The text marker.
        #[unsafe(method(accessibilityPreviousTextMarker:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityPreviousTextMarker(
            &self,
            marker: &BEAccessibilityTextMarker,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        /// The text marker representing the end-of-line position of the line pointed to by the given marker.
        ///
        /// Parameter `marker`: The text marker.
        #[unsafe(method(accessibilityLineEndMarkerForMarker:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityLineEndMarkerForMarker(
            &self,
            marker: &BEAccessibilityTextMarker,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        /// The text marker representing the start-of-line position of the line pointed to by the given marker.
        ///
        /// Parameter `marker`: The text marker.
        #[unsafe(method(accessibilityLineStartMarkerForMarker:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityLineStartMarkerForMarker(
            &self,
            marker: &BEAccessibilityTextMarker,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        #[cfg(feature = "objc2-core-foundation")]
        /// The text marker for the specific point.
        ///
        /// Parameter `point`: A point in view space.
        #[unsafe(method(accessibilityMarkerForPoint:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityMarkerForPoint(
            &self,
            point: CGPoint,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        /// The text marker given an index-based position.
        ///
        /// Parameter `position`: The text position as an index.
        #[unsafe(method(accessibilityTextMarkerForPosition:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityTextMarkerForPosition(
            &self,
            position: NSInteger,
        ) -> Option<Retained<BEAccessibilityTextMarker>>;

        /// The text marker range given an index-based range.
        ///
        /// Parameter `range`: The text marker range as an NSRange.
        #[unsafe(method(accessibilityTextMarkerRangeForRange:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityTextMarkerRangeForRange(
            &self,
            range: NSRange,
        ) -> Option<Retained<BEAccessibilityTextMarkerRange>>;

        /// The index-based range given a text marker range.
        ///
        /// Parameter `range`: The text marker range.
        #[unsafe(method(accessibilityRangeForTextMarkerRange:))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityRangeForTextMarkerRange(
            &self,
            range: &BEAccessibilityTextMarkerRange,
        ) -> NSRange;
    }
);