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/swhighlightpersistenceeventtrigger?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SWHighlightPersistenceEventTrigger(pub NSInteger);
impl SWHighlightPersistenceEventTrigger {
    #[doc(alias = "SWHighlightPersistenceEventTriggerCreated")]
    pub const Created: Self = Self(1);
    #[doc(alias = "SWHighlightPersistenceEventTriggerDeleted")]
    pub const Deleted: Self = Self(2);
    #[doc(alias = "SWHighlightPersistenceEventTriggerRenamed")]
    pub const Renamed: Self = Self(3);
    #[doc(alias = "SWHighlightPersistenceEventTriggerMoved")]
    pub const Moved: Self = Self(4);
}

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

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

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

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

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

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

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

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

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

impl SWHighlightPersistenceEvent {
    extern_methods!(
        #[unsafe(method(persistenceEventTrigger))]
        #[unsafe(method_family = none)]
        pub unsafe fn persistenceEventTrigger(&self) -> SWHighlightPersistenceEventTrigger;

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