//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSArchiver")]
    #[deprecated = "Use NSKeyedArchiver instead"]
    pub struct NSArchiver;

    #[cfg(feature = "Foundation_NSArchiver")]
    unsafe impl ClassType for NSArchiver {
        #[inherits(NSObject)]
        type Super = NSCoder;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSArchiver")]
unsafe impl NSObjectProtocol for NSArchiver {}

extern_methods!(
    #[cfg(feature = "Foundation_NSArchiver")]
    unsafe impl NSArchiver {
        #[cfg(feature = "Foundation_NSMutableData")]
        #[method_id(@__retain_semantics Init initForWritingWithMutableData:)]
        pub unsafe fn initForWritingWithMutableData(
            this: Option<Allocated<Self>>,
            mdata: &NSMutableData,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSMutableData")]
        #[method_id(@__retain_semantics Other archiverData)]
        pub unsafe fn archiverData(&self) -> Id<NSMutableData>;

        #[method(encodeRootObject:)]
        pub unsafe fn encodeRootObject(&self, root_object: &AnyObject);

        #[method(encodeConditionalObject:)]
        pub unsafe fn encodeConditionalObject(&self, object: Option<&AnyObject>);

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other archivedDataWithRootObject:)]
        pub unsafe fn archivedDataWithRootObject(root_object: &AnyObject) -> Id<NSData>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(archiveRootObject:toFile:)]
        pub unsafe fn archiveRootObject_toFile(root_object: &AnyObject, path: &NSString) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method(encodeClassName:intoClassName:)]
        pub unsafe fn encodeClassName_intoClassName(
            &self,
            true_name: &NSString,
            in_archive_name: &NSString,
        );

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other classNameEncodedForTrueClassName:)]
        pub unsafe fn classNameEncodedForTrueClassName(
            &self,
            true_name: &NSString,
        ) -> Option<Id<NSString>>;

        #[method(replaceObject:withObject:)]
        pub unsafe fn replaceObject_withObject(&self, object: &AnyObject, new_object: &AnyObject);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSArchiver")]
    unsafe impl NSArchiver {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSUnarchiver")]
    #[deprecated = "Use NSKeyedUnarchiver instead"]
    pub struct NSUnarchiver;

    #[cfg(feature = "Foundation_NSUnarchiver")]
    unsafe impl ClassType for NSUnarchiver {
        #[inherits(NSObject)]
        type Super = NSCoder;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSUnarchiver")]
unsafe impl NSObjectProtocol for NSUnarchiver {}

extern_methods!(
    #[cfg(feature = "Foundation_NSUnarchiver")]
    unsafe impl NSUnarchiver {
        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Init initForReadingWithData:)]
        pub unsafe fn initForReadingWithData(
            this: Option<Allocated<Self>>,
            data: &NSData,
        ) -> Option<Id<Self>>;

        #[method(setObjectZone:)]
        pub unsafe fn setObjectZone(&self, zone: *mut NSZone);

        #[method(objectZone)]
        pub unsafe fn objectZone(&self) -> *mut NSZone;

        #[method(isAtEnd)]
        pub unsafe fn isAtEnd(&self) -> bool;

        #[method(systemVersion)]
        pub unsafe fn systemVersion(&self) -> c_uint;

        #[cfg(feature = "Foundation_NSData")]
        #[method_id(@__retain_semantics Other unarchiveObjectWithData:)]
        pub unsafe fn unarchiveObjectWithData(data: &NSData) -> Option<Id<AnyObject>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other unarchiveObjectWithFile:)]
        pub unsafe fn unarchiveObjectWithFile(path: &NSString) -> Option<Id<AnyObject>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(decodeClassName:asClassName:)]
        pub unsafe fn decodeClassName_asClassName_class(
            in_archive_name: &NSString,
            true_name: &NSString,
        );

        #[cfg(feature = "Foundation_NSString")]
        #[method(decodeClassName:asClassName:)]
        pub unsafe fn decodeClassName_asClassName(
            &self,
            in_archive_name: &NSString,
            true_name: &NSString,
        );

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other classNameDecodedForArchiveClassName:)]
        pub unsafe fn classNameDecodedForArchiveClassName_class(
            in_archive_name: &NSString,
        ) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other classNameDecodedForArchiveClassName:)]
        pub unsafe fn classNameDecodedForArchiveClassName(
            &self,
            in_archive_name: &NSString,
        ) -> Id<NSString>;

        #[method(replaceObject:withObject:)]
        pub unsafe fn replaceObject_withObject(&self, object: &AnyObject, new_object: &AnyObject);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSUnarchiver")]
    unsafe impl NSUnarchiver {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);
