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

use crate::*;

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSFontCollectionVisibility(pub NSUInteger);
bitflags::bitflags! {
    impl NSFontCollectionVisibility: NSUInteger {
        #[doc(alias = "NSFontCollectionVisibilityProcess")]
        const Process = 1<<0;
        #[doc(alias = "NSFontCollectionVisibilityUser")]
        const User = 1<<1;
        #[doc(alias = "NSFontCollectionVisibilityComputer")]
        const Computer = 1<<2;
    }
}

unsafe impl Encode for NSFontCollectionVisibility {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSFontCollectionVisibility {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_TYPED_ENUM
pub type NSFontCollectionMatchingOptionKey = NSString;

extern "C" {
    pub static NSFontCollectionIncludeDisabledFontsOption:
        &'static NSFontCollectionMatchingOptionKey;
}

extern "C" {
    pub static NSFontCollectionRemoveDuplicatesOption: &'static NSFontCollectionMatchingOptionKey;
}

extern "C" {
    pub static NSFontCollectionDisallowAutoActivationOption:
        &'static NSFontCollectionMatchingOptionKey;
}

// NS_TYPED_EXTENSIBLE_ENUM
pub type NSFontCollectionName = NSString;

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

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

unsafe impl NSCoding for NSFontCollection {}

unsafe impl NSCopying for NSFontCollection {}

unsafe impl NSMutableCopying for NSFontCollection {}

unsafe impl NSObjectProtocol for NSFontCollection {}

extern_methods!(
    unsafe impl NSFontCollection {
        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other fontCollectionWithDescriptors:)]
        pub unsafe fn fontCollectionWithDescriptors(
            query_descriptors: &NSArray<NSFontDescriptor>,
        ) -> Retained<NSFontCollection>;

        #[method_id(@__retain_semantics Other fontCollectionWithAllAvailableDescriptors)]
        pub unsafe fn fontCollectionWithAllAvailableDescriptors() -> Retained<NSFontCollection>;

        #[method_id(@__retain_semantics Other fontCollectionWithLocale:)]
        pub unsafe fn fontCollectionWithLocale(
            locale: &NSLocale,
        ) -> Option<Retained<NSFontCollection>>;

        #[method(showFontCollection:withName:visibility:error:_)]
        pub unsafe fn showFontCollection_withName_visibility_error(
            collection: &NSFontCollection,
            name: &NSFontCollectionName,
            visibility: NSFontCollectionVisibility,
        ) -> Result<(), Retained<NSError>>;

        #[method(hideFontCollectionWithName:visibility:error:_)]
        pub unsafe fn hideFontCollectionWithName_visibility_error(
            name: &NSFontCollectionName,
            visibility: NSFontCollectionVisibility,
        ) -> Result<(), Retained<NSError>>;

        #[method(renameFontCollectionWithName:visibility:toName:error:_)]
        pub unsafe fn renameFontCollectionWithName_visibility_toName_error(
            old_name: &NSFontCollectionName,
            visibility: NSFontCollectionVisibility,
            new_name: &NSFontCollectionName,
        ) -> Result<(), Retained<NSError>>;

        #[method_id(@__retain_semantics Other allFontCollectionNames)]
        pub unsafe fn allFontCollectionNames() -> Retained<NSArray<NSFontCollectionName>>;

        #[method_id(@__retain_semantics Other fontCollectionWithName:)]
        pub unsafe fn fontCollectionWithName(
            name: &NSFontCollectionName,
        ) -> Option<Retained<NSFontCollection>>;

        #[method_id(@__retain_semantics Other fontCollectionWithName:visibility:)]
        pub unsafe fn fontCollectionWithName_visibility(
            name: &NSFontCollectionName,
            visibility: NSFontCollectionVisibility,
        ) -> Option<Retained<NSFontCollection>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other queryDescriptors)]
        pub unsafe fn queryDescriptors(&self) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other exclusionDescriptors)]
        pub unsafe fn exclusionDescriptors(&self) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other matchingDescriptors)]
        pub unsafe fn matchingDescriptors(&self) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other matchingDescriptorsWithOptions:)]
        pub unsafe fn matchingDescriptorsWithOptions(
            &self,
            options: Option<&NSDictionary<NSFontCollectionMatchingOptionKey, NSNumber>>,
        ) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other matchingDescriptorsForFamily:)]
        pub unsafe fn matchingDescriptorsForFamily(
            &self,
            family: &NSString,
        ) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other matchingDescriptorsForFamily:options:)]
        pub unsafe fn matchingDescriptorsForFamily_options(
            &self,
            family: &NSString,
            options: Option<&NSDictionary<NSFontCollectionMatchingOptionKey, NSNumber>>,
        ) -> Option<Retained<NSArray<NSFontDescriptor>>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSFontCollection {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

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

    unsafe impl ClassType for NSMutableFontCollection {
        #[inherits(NSObject)]
        type Super = NSFontCollection;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for NSMutableFontCollection {}

unsafe impl NSCopying for NSMutableFontCollection {}

unsafe impl NSMutableCopying for NSMutableFontCollection {}

unsafe impl NSObjectProtocol for NSMutableFontCollection {}

extern_methods!(
    unsafe impl NSMutableFontCollection {
        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other fontCollectionWithDescriptors:)]
        pub unsafe fn fontCollectionWithDescriptors(
            query_descriptors: &NSArray<NSFontDescriptor>,
        ) -> Retained<NSMutableFontCollection>;

        #[method_id(@__retain_semantics Other fontCollectionWithAllAvailableDescriptors)]
        pub unsafe fn fontCollectionWithAllAvailableDescriptors(
        ) -> Retained<NSMutableFontCollection>;

        #[method_id(@__retain_semantics Other fontCollectionWithLocale:)]
        pub unsafe fn fontCollectionWithLocale(
            locale: &NSLocale,
        ) -> Retained<NSMutableFontCollection>;

        #[method_id(@__retain_semantics Other fontCollectionWithName:)]
        pub unsafe fn fontCollectionWithName(
            name: &NSFontCollectionName,
        ) -> Option<Retained<NSMutableFontCollection>>;

        #[method_id(@__retain_semantics Other fontCollectionWithName:visibility:)]
        pub unsafe fn fontCollectionWithName_visibility(
            name: &NSFontCollectionName,
            visibility: NSFontCollectionVisibility,
        ) -> Option<Retained<NSMutableFontCollection>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other queryDescriptors)]
        pub unsafe fn queryDescriptors(&self) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method(setQueryDescriptors:)]
        pub unsafe fn setQueryDescriptors(
            &self,
            query_descriptors: Option<&NSArray<NSFontDescriptor>>,
        );

        #[cfg(feature = "NSFontDescriptor")]
        #[method_id(@__retain_semantics Other exclusionDescriptors)]
        pub unsafe fn exclusionDescriptors(&self) -> Option<Retained<NSArray<NSFontDescriptor>>>;

        #[cfg(feature = "NSFontDescriptor")]
        #[method(setExclusionDescriptors:)]
        pub unsafe fn setExclusionDescriptors(
            &self,
            exclusion_descriptors: Option<&NSArray<NSFontDescriptor>>,
        );

        #[cfg(feature = "NSFontDescriptor")]
        #[method(addQueryForDescriptors:)]
        pub unsafe fn addQueryForDescriptors(&self, descriptors: &NSArray<NSFontDescriptor>);

        #[cfg(feature = "NSFontDescriptor")]
        #[method(removeQueryForDescriptors:)]
        pub unsafe fn removeQueryForDescriptors(&self, descriptors: &NSArray<NSFontDescriptor>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSMutableFontCollection {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

extern "C" {
    pub static NSFontCollectionDidChangeNotification: &'static NSNotificationName;
}

// NS_TYPED_ENUM
pub type NSFontCollectionUserInfoKey = NSString;

extern "C" {
    pub static NSFontCollectionActionKey: &'static NSFontCollectionUserInfoKey;
}

extern "C" {
    pub static NSFontCollectionNameKey: &'static NSFontCollectionUserInfoKey;
}

extern "C" {
    pub static NSFontCollectionOldNameKey: &'static NSFontCollectionUserInfoKey;
}

extern "C" {
    pub static NSFontCollectionVisibilityKey: &'static NSFontCollectionUserInfoKey;
}

// NS_TYPED_ENUM
pub type NSFontCollectionActionTypeKey = NSString;

extern "C" {
    pub static NSFontCollectionWasShown: &'static NSFontCollectionActionTypeKey;
}

extern "C" {
    pub static NSFontCollectionWasHidden: &'static NSFontCollectionActionTypeKey;
}

extern "C" {
    pub static NSFontCollectionWasRenamed: &'static NSFontCollectionActionTypeKey;
}

extern "C" {
    pub static NSFontCollectionAllFonts: &'static NSFontCollectionName;
}

extern "C" {
    pub static NSFontCollectionUser: &'static NSFontCollectionName;
}

extern "C" {
    pub static NSFontCollectionFavorites: &'static NSFontCollectionName;
}

extern "C" {
    pub static NSFontCollectionRecentlyUsed: &'static NSFontCollectionName;
}
