objc2_shared_with_you/generated/
SWHighlightPersistenceEvent.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::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swhighlightpersistenceeventtrigger?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct SWHighlightPersistenceEventTrigger(pub NSInteger);
14impl SWHighlightPersistenceEventTrigger {
15    #[doc(alias = "SWHighlightPersistenceEventTriggerCreated")]
16    pub const Created: Self = Self(1);
17    #[doc(alias = "SWHighlightPersistenceEventTriggerDeleted")]
18    pub const Deleted: Self = Self(2);
19    #[doc(alias = "SWHighlightPersistenceEventTriggerRenamed")]
20    pub const Renamed: Self = Self(3);
21    #[doc(alias = "SWHighlightPersistenceEventTriggerMoved")]
22    pub const Moved: Self = Self(4);
23}
24
25unsafe impl Encode for SWHighlightPersistenceEventTrigger {
26    const ENCODING: Encoding = NSInteger::ENCODING;
27}
28
29unsafe impl RefEncode for SWHighlightPersistenceEventTrigger {
30    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33extern_class!(
34    /// A model object representing a persistence event that has happened on some content.
35    ///
36    /// See also [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swhighlightpersistenceevent?language=objc)
37    #[unsafe(super(NSObject))]
38    #[derive(Debug, PartialEq, Eq, Hash)]
39    pub struct SWHighlightPersistenceEvent;
40);
41
42extern_conformance!(
43    unsafe impl NSCoding for SWHighlightPersistenceEvent {}
44);
45
46extern_conformance!(
47    unsafe impl NSCopying for SWHighlightPersistenceEvent {}
48);
49
50unsafe impl CopyingHelper for SWHighlightPersistenceEvent {
51    type Result = Self;
52}
53
54extern_conformance!(
55    unsafe impl NSObjectProtocol for SWHighlightPersistenceEvent {}
56);
57
58extern_conformance!(
59    unsafe impl NSSecureCoding for SWHighlightPersistenceEvent {}
60);
61
62#[cfg(feature = "SWHighlightEvent")]
63extern_conformance!(
64    unsafe impl SWHighlightEvent for SWHighlightPersistenceEvent {}
65);
66
67impl SWHighlightPersistenceEvent {
68    extern_methods!(
69        #[unsafe(method(persistenceEventTrigger))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn persistenceEventTrigger(&self) -> SWHighlightPersistenceEventTrigger;
72
73        #[cfg(feature = "SWHighlight")]
74        /// Initializes a highlight persistence event object when the highlight persistence is changed.
75        ///
76        /// Parameter `highlight`: The object on which the event occurred.
77        ///
78        /// Parameter `trigger`: The trigger persistence event for the highlight.
79        #[unsafe(method(initWithHighlight:trigger:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithHighlight_trigger(
82            this: Allocated<Self>,
83            highlight: &SWHighlight,
84            trigger: SWHighlightPersistenceEventTrigger,
85        ) -> Retained<Self>;
86
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}