objc2-shared-with-you 0.3.2

Bindings to the SharedWithYou 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 crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swhighlightchangeeventtrigger?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SWHighlightChangeEventTrigger(pub NSInteger);
impl SWHighlightChangeEventTrigger {
    #[doc(alias = "SWHighlightChangeEventTriggerEdit")]
    pub const Edit: Self = Self(1);
    #[doc(alias = "SWHighlightChangeEventTriggerComment")]
    pub const Comment: Self = Self(2);
}

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

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

extern_class!(
    /// A model object representing activity that has happened on some content.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swhighlightchangeevent?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct SWHighlightChangeEvent;
);

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

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

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

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

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

#[cfg(feature = "SWHighlightEvent")]
extern_conformance!(
    unsafe impl SWHighlightEvent for SWHighlightChangeEvent {}
);

impl SWHighlightChangeEvent {
    extern_methods!(
        #[unsafe(method(changeEventTrigger))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeEventTrigger(&self) -> SWHighlightChangeEventTrigger;

        #[cfg(feature = "SWHighlight")]
        /// Initializes a highlight change event object to represent changes to a highlight.
        ///
        /// Parameter `highlight`: The object on which the event occurred.
        ///
        /// Parameter `trigger`: The trigger change event for the highlight.
        #[unsafe(method(initWithHighlight:trigger:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithHighlight_trigger(
            this: Allocated<Self>,
            highlight: &SWHighlight,
            trigger: SWHighlightChangeEventTrigger,
        ) -> 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>;

        #[unsafe(method(highlightURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn highlightURL(&self) -> Retained<NSURL>;
    );
}