objc2-core-data 0.3.2

Bindings to the CoreData 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspropertydescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPropertyDescription;
);

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

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

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

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

impl NSPropertyDescription {
    extern_methods!(
        #[cfg(feature = "NSEntityDescription")]
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(entity))]
        #[unsafe(method_family = none)]
        pub unsafe fn entity(&self) -> Retained<NSEntityDescription>;

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

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: &NSString);

        #[unsafe(method(isOptional))]
        #[unsafe(method_family = none)]
        pub unsafe fn isOptional(&self) -> bool;

        /// Setter for [`isOptional`][Self::isOptional].
        #[unsafe(method(setOptional:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOptional(&self, optional: bool);

        #[unsafe(method(isTransient))]
        #[unsafe(method_family = none)]
        pub unsafe fn isTransient(&self) -> bool;

        /// Setter for [`isTransient`][Self::isTransient].
        #[unsafe(method(setTransient:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTransient(&self, transient: bool);

        #[unsafe(method(validationPredicates))]
        #[unsafe(method_family = none)]
        pub unsafe fn validationPredicates(&self) -> Retained<NSArray<NSPredicate>>;

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

        #[unsafe(method(setValidationPredicates:withValidationWarnings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValidationPredicates_withValidationWarnings(
            &self,
            validation_predicates: Option<&NSArray<NSPredicate>>,
            validation_warnings: Option<&NSArray<NSString>>,
        );

        #[unsafe(method(userInfo))]
        #[unsafe(method_family = none)]
        pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;

        /// Setter for [`userInfo`][Self::userInfo].
        ///
        /// # Safety
        ///
        /// `user_info` generic should be of the correct type.
        #[unsafe(method(setUserInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);

        #[deprecated = "Use NSEntityDescription.indexes instead"]
        #[unsafe(method(isIndexed))]
        #[unsafe(method_family = none)]
        pub unsafe fn isIndexed(&self) -> bool;

        /// Setter for [`isIndexed`][Self::isIndexed].
        #[deprecated = "Use NSEntityDescription.indexes instead"]
        #[unsafe(method(setIndexed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIndexed(&self, indexed: bool);

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

        #[unsafe(method(versionHashModifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn versionHashModifier(&self) -> Option<Retained<NSString>>;

        /// Setter for [`versionHashModifier`][Self::versionHashModifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setVersionHashModifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVersionHashModifier(&self, version_hash_modifier: Option<&NSString>);

        #[unsafe(method(isIndexedBySpotlight))]
        #[unsafe(method_family = none)]
        pub unsafe fn isIndexedBySpotlight(&self) -> bool;

        /// Setter for [`isIndexedBySpotlight`][Self::isIndexedBySpotlight].
        #[unsafe(method(setIndexedBySpotlight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIndexedBySpotlight(&self, indexed_by_spotlight: bool);

        #[deprecated = "Spotlight integration is deprecated. Use CoreSpotlight integration instead."]
        #[unsafe(method(isStoredInExternalRecord))]
        #[unsafe(method_family = none)]
        pub unsafe fn isStoredInExternalRecord(&self) -> bool;

        /// Setter for [`isStoredInExternalRecord`][Self::isStoredInExternalRecord].
        #[deprecated = "Spotlight integration is deprecated. Use CoreSpotlight integration instead."]
        #[unsafe(method(setStoredInExternalRecord:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStoredInExternalRecord(&self, stored_in_external_record: bool);

        #[unsafe(method(renamingIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn renamingIdentifier(&self) -> Option<Retained<NSString>>;

        /// Setter for [`renamingIdentifier`][Self::renamingIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setRenamingIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRenamingIdentifier(&self, renaming_identifier: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSPropertyDescription {
    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>;
    );
}