objc2-photos 0.3.2

Bindings to the Photos/PhotoKit 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/photos/phcollectionlistchangerequest?language=objc)
    #[unsafe(super(PHChangeRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "PHChangeRequest")]
    pub struct PHCollectionListChangeRequest;
);

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

#[cfg(feature = "PHChangeRequest")]
impl PHCollectionListChangeRequest {
    extern_methods!(
        #[unsafe(method(creationRequestForCollectionListWithTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn creationRequestForCollectionListWithTitle(title: &NSString)
            -> Retained<Self>;

        #[cfg(feature = "PHObject")]
        #[unsafe(method(placeholderForCreatedCollectionList))]
        #[unsafe(method_family = none)]
        pub unsafe fn placeholderForCreatedCollectionList(&self) -> Retained<PHObjectPlaceholder>;

        /// # Safety
        ///
        /// `collection_lists` should be of the correct type.
        #[unsafe(method(deleteCollectionLists:))]
        #[unsafe(method_family = none)]
        pub unsafe fn deleteCollectionLists(
            collection_lists: &ProtocolObject<dyn NSFastEnumeration>,
        );

        #[cfg(all(feature = "PHCollection", feature = "PHObject"))]
        #[unsafe(method(changeRequestForCollectionList:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeRequestForCollectionList(
            collection_list: &PHCollectionList,
        ) -> Option<Retained<Self>>;

        #[cfg(all(
            feature = "PHCollection",
            feature = "PHFetchResult",
            feature = "PHObject"
        ))]
        #[unsafe(method(changeRequestForCollectionList:childCollections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeRequestForCollectionList_childCollections(
            collection_list: &PHCollectionList,
            child_collections: &PHFetchResult<PHCollection>,
        ) -> Option<Retained<Self>>;

        #[cfg(all(
            feature = "PHCollection",
            feature = "PHFetchResult",
            feature = "PHObject"
        ))]
        #[unsafe(method(changeRequestForTopLevelCollectionListUserCollections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeRequestForTopLevelCollectionListUserCollections(
            child_collections: &PHFetchResult<PHCollection>,
        ) -> Option<Retained<Self>>;

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

        /// Setter for [`title`][Self::title].
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitle(&self, title: &NSString);

        /// # Safety
        ///
        /// `collections` should be of the correct type.
        #[unsafe(method(addChildCollections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addChildCollections(
            &self,
            collections: &ProtocolObject<dyn NSFastEnumeration>,
        );

        /// # Safety
        ///
        /// `collections` should be of the correct type.
        #[unsafe(method(insertChildCollections:atIndexes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertChildCollections_atIndexes(
            &self,
            collections: &ProtocolObject<dyn NSFastEnumeration>,
            indexes: &NSIndexSet,
        );

        /// # Safety
        ///
        /// `collections` should be of the correct type.
        #[unsafe(method(removeChildCollections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeChildCollections(
            &self,
            collections: &ProtocolObject<dyn NSFastEnumeration>,
        );

        #[unsafe(method(removeChildCollectionsAtIndexes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeChildCollectionsAtIndexes(&self, indexes: &NSIndexSet);

        /// # Safety
        ///
        /// `collections` should be of the correct type.
        #[unsafe(method(replaceChildCollectionsAtIndexes:withChildCollections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceChildCollectionsAtIndexes_withChildCollections(
            &self,
            indexes: &NSIndexSet,
            collections: &ProtocolObject<dyn NSFastEnumeration>,
        );

        #[unsafe(method(moveChildCollectionsAtIndexes:toIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveChildCollectionsAtIndexes_toIndex(
            &self,
            indexes: &NSIndexSet,
            to_index: NSUInteger,
        );
    );
}

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