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

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UTType;

    unsafe impl ClassType for UTType {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for UTType {}

unsafe impl Sync for UTType {}

unsafe impl NSCoding for UTType {}

unsafe impl NSCopying for UTType {}

unsafe impl NSObjectProtocol for UTType {}

unsafe impl NSSecureCoding for UTType {}

extern_methods!(
    unsafe impl UTType {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics Other typeWithIdentifier:)]
        pub unsafe fn typeWithIdentifier(identifier: &NSString) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other typeWithFilenameExtension:)]
        pub unsafe fn typeWithFilenameExtension(
            filename_extension: &NSString,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other typeWithFilenameExtension:conformingToType:)]
        pub unsafe fn typeWithFilenameExtension_conformingToType(
            filename_extension: &NSString,
            supertype: &UTType,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other typeWithMIMEType:)]
        pub unsafe fn typeWithMIMEType(mime_type: &NSString) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other typeWithMIMEType:conformingToType:)]
        pub unsafe fn typeWithMIMEType_conformingToType(
            mime_type: &NSString,
            supertype: &UTType,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other identifier)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        #[method_id(@__retain_semantics Other preferredFilenameExtension)]
        pub unsafe fn preferredFilenameExtension(&self) -> Option<Retained<NSString>>;

        #[method_id(@__retain_semantics Other preferredMIMEType)]
        pub unsafe fn preferredMIMEType(&self) -> Option<Retained<NSString>>;

        #[method_id(@__retain_semantics Other localizedDescription)]
        pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;

        #[method_id(@__retain_semantics Other version)]
        pub unsafe fn version(&self) -> Option<Retained<NSNumber>>;

        #[method_id(@__retain_semantics Other referenceURL)]
        pub unsafe fn referenceURL(&self) -> Option<Retained<NSURL>>;

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

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

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

extern_methods!(
    /// Conformance
    unsafe impl UTType {
        #[method(conformsToType:)]
        pub unsafe fn conformsToType(&self, r#type: &UTType) -> bool;

        #[method(isSupertypeOfType:)]
        pub unsafe fn isSupertypeOfType(&self, r#type: &UTType) -> bool;

        #[method(isSubtypeOfType:)]
        pub unsafe fn isSubtypeOfType(&self, r#type: &UTType) -> bool;

        #[method_id(@__retain_semantics Other supertypes)]
        pub unsafe fn supertypes(&self) -> Retained<NSSet<UTType>>;
    }
);

extern_methods!(
    /// UTTagSpecification
    unsafe impl UTType {
        #[method_id(@__retain_semantics Other typeWithTag:tagClass:conformingToType:)]
        pub unsafe fn typeWithTag_tagClass_conformingToType(
            tag: &NSString,
            tag_class: &NSString,
            supertype: Option<&UTType>,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other typesWithTag:tagClass:conformingToType:)]
        pub unsafe fn typesWithTag_tagClass_conformingToType(
            tag: &NSString,
            tag_class: &NSString,
            supertype: Option<&UTType>,
        ) -> Retained<NSArray<UTType>>;

        #[method_id(@__retain_semantics Other tags)]
        pub unsafe fn tags(&self) -> Retained<NSDictionary<NSString, NSArray<NSString>>>;
    }
);

extern_methods!(
    /// LocalConstants
    unsafe impl UTType {
        #[method_id(@__retain_semantics Other exportedTypeWithIdentifier:)]
        pub unsafe fn exportedTypeWithIdentifier(identifier: &NSString) -> Retained<UTType>;

        #[method_id(@__retain_semantics Other exportedTypeWithIdentifier:conformingToType:)]
        pub unsafe fn exportedTypeWithIdentifier_conformingToType(
            identifier: &NSString,
            parent_type: &UTType,
        ) -> Retained<UTType>;

        #[method_id(@__retain_semantics Other importedTypeWithIdentifier:)]
        pub unsafe fn importedTypeWithIdentifier(identifier: &NSString) -> Retained<UTType>;

        #[method_id(@__retain_semantics Other importedTypeWithIdentifier:conformingToType:)]
        pub unsafe fn importedTypeWithIdentifier_conformingToType(
            identifier: &NSString,
            parent_type: &UTType,
        ) -> Retained<UTType>;
    }
);
