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::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
use objc2_uniform_type_identifiers::*;

use crate::*;

extern_class!(
    /// A SWHighlight object that represents an active collaboration
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/sharedwithyou/swcollaborationhighlight?language=objc)
    #[unsafe(super(SWHighlight, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "SWHighlight")]
    pub struct SWCollaborationHighlight;
);

#[cfg(feature = "SWHighlight")]
extern_conformance!(
    unsafe impl NSCoding for SWCollaborationHighlight {}
);

#[cfg(feature = "SWHighlight")]
extern_conformance!(
    unsafe impl NSCopying for SWCollaborationHighlight {}
);

#[cfg(feature = "SWHighlight")]
unsafe impl CopyingHelper for SWCollaborationHighlight {
    type Result = Self;
}

#[cfg(feature = "SWHighlight")]
extern_conformance!(
    unsafe impl NSObjectProtocol for SWCollaborationHighlight {}
);

#[cfg(feature = "SWHighlight")]
extern_conformance!(
    unsafe impl NSSecureCoding for SWCollaborationHighlight {}
);

#[cfg(feature = "SWHighlight")]
impl SWCollaborationHighlight {
    extern_methods!(
        /// Unique identifier as provided by the app hosting the collaboration
        ///
        /// This identifier is unique across platforms and shares
        #[unsafe(method(collaborationIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn collaborationIdentifier(&self) -> Retained<NSString>;

        /// Title of the collaboration highlight
        ///
        /// Title of the collaboration if provided by the app hosting the collaboration
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Option<Retained<NSString>>;

        /// Date when the file was created
        #[unsafe(method(creationDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn creationDate(&self) -> Retained<NSDate>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        /// UTI type for this collaboration highlight
        #[unsafe(method(contentType))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentType(&self) -> Retained<UTType>;
    );
}

/// Methods declared on superclass `SWHighlight`.
#[cfg(feature = "SWHighlight")]
impl SWCollaborationHighlight {
    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>;
    );
}