use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIFontDescriptorSymbolicTraits(pub u32);
bitflags::bitflags! {
impl UIFontDescriptorSymbolicTraits: u32 {
const UIFontDescriptorTraitItalic = 1<<0;
const UIFontDescriptorTraitBold = 1<<1;
const UIFontDescriptorTraitExpanded = 1<<5;
const UIFontDescriptorTraitCondensed = 1<<6;
const UIFontDescriptorTraitMonoSpace = 1<<10;
const UIFontDescriptorTraitVertical = 1<<11;
const UIFontDescriptorTraitUIOptimized = 1<<12;
const UIFontDescriptorTraitTightLeading = 1<<15;
const UIFontDescriptorTraitLooseLeading = 1<<16;
const UIFontDescriptorClassMask = 0xF0000000;
const UIFontDescriptorClassUnknown = 0<<28;
const UIFontDescriptorClassOldStyleSerifs = 1<<28;
const UIFontDescriptorClassTransitionalSerifs = 2<<28;
const UIFontDescriptorClassModernSerifs = 3<<28;
const UIFontDescriptorClassClarendonSerifs = 4<<28;
const UIFontDescriptorClassSlabSerifs = 5<<28;
const UIFontDescriptorClassFreeformSerifs = 7<<28;
const UIFontDescriptorClassSansSerif = 8<<28;
const UIFontDescriptorClassOrnamentals = 9<<28;
const UIFontDescriptorClassScripts = 10<<28;
const UIFontDescriptorClassSymbolic = 12<<28;
}
}
unsafe impl Encode for UIFontDescriptorSymbolicTraits {
const ENCODING: Encoding = u32::ENCODING;
}
unsafe impl RefEncode for UIFontDescriptorSymbolicTraits {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type UIFontDescriptorClass = NSUInteger;
pub type UIFontTextStyle = NSString;
pub type UIFontDescriptorAttributeName = NSString;
pub type UIFontDescriptorTraitKey = NSString;
pub type UIFontDescriptorFeatureKey = NSString;
pub type UIFontWeight = CGFloat;
pub type UIFontWidth = CGFloat;
pub type UIFontDescriptorSystemDesign = NSString;
extern "C" {
pub static UIFontDescriptorSystemDesignDefault: &'static UIFontDescriptorSystemDesign;
}
extern "C" {
pub static UIFontDescriptorSystemDesignRounded: &'static UIFontDescriptorSystemDesign;
}
extern "C" {
pub static UIFontDescriptorSystemDesignSerif: &'static UIFontDescriptorSystemDesign;
}
extern "C" {
pub static UIFontDescriptorSystemDesignMonospaced: &'static UIFontDescriptorSystemDesign;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIFontDescriptor;
unsafe impl ClassType for UIFontDescriptor {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl Send for UIFontDescriptor {}
unsafe impl Sync for UIFontDescriptor {}
unsafe impl NSCoding for UIFontDescriptor {}
unsafe impl NSCopying for UIFontDescriptor {}
unsafe impl NSObjectProtocol for UIFontDescriptor {}
unsafe impl NSSecureCoding for UIFontDescriptor {}
extern_methods!(
unsafe impl UIFontDescriptor {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Other postscriptName)]
pub unsafe fn postscriptName(&self) -> Retained<NSString>;
#[method(pointSize)]
pub unsafe fn pointSize(&self) -> CGFloat;
#[method(matrix)]
pub unsafe fn matrix(&self) -> CGAffineTransform;
#[method(symbolicTraits)]
pub unsafe fn symbolicTraits(&self) -> UIFontDescriptorSymbolicTraits;
#[method_id(@__retain_semantics Other objectForKey:)]
pub unsafe fn objectForKey(
&self,
an_attribute: &UIFontDescriptorAttributeName,
) -> Option<Retained<AnyObject>>;
#[method_id(@__retain_semantics Other fontAttributes)]
pub unsafe fn fontAttributes(
&self,
) -> Retained<NSDictionary<UIFontDescriptorAttributeName, AnyObject>>;
#[method_id(@__retain_semantics Other matchingFontDescriptorsWithMandatoryKeys:)]
pub unsafe fn matchingFontDescriptorsWithMandatoryKeys(
&self,
mandatory_keys: Option<&NSSet<UIFontDescriptorAttributeName>>,
) -> Retained<NSArray<UIFontDescriptor>>;
#[method_id(@__retain_semantics Other fontDescriptorWithFontAttributes:)]
pub unsafe fn fontDescriptorWithFontAttributes(
attributes: &NSDictionary<UIFontDescriptorAttributeName, AnyObject>,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithName:size:)]
pub unsafe fn fontDescriptorWithName_size(
font_name: &NSString,
size: CGFloat,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithName:matrix:)]
pub unsafe fn fontDescriptorWithName_matrix(
font_name: &NSString,
matrix: CGAffineTransform,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other preferredFontDescriptorWithTextStyle:)]
pub unsafe fn preferredFontDescriptorWithTextStyle(
style: &UIFontTextStyle,
) -> Retained<UIFontDescriptor>;
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Other preferredFontDescriptorWithTextStyle:compatibleWithTraitCollection:)]
pub unsafe fn preferredFontDescriptorWithTextStyle_compatibleWithTraitCollection(
style: &UIFontTextStyle,
trait_collection: Option<&UITraitCollection>,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Init initWithFontAttributes:)]
pub unsafe fn initWithFontAttributes(
this: Allocated<Self>,
attributes: &NSDictionary<UIFontDescriptorAttributeName, AnyObject>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other fontDescriptorByAddingAttributes:)]
pub unsafe fn fontDescriptorByAddingAttributes(
&self,
attributes: &NSDictionary<UIFontDescriptorAttributeName, AnyObject>,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithSize:)]
pub unsafe fn fontDescriptorWithSize(
&self,
new_point_size: CGFloat,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithMatrix:)]
pub unsafe fn fontDescriptorWithMatrix(
&self,
matrix: CGAffineTransform,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithFace:)]
pub unsafe fn fontDescriptorWithFace(
&self,
new_face: &NSString,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithFamily:)]
pub unsafe fn fontDescriptorWithFamily(
&self,
new_family: &NSString,
) -> Retained<UIFontDescriptor>;
#[method_id(@__retain_semantics Other fontDescriptorWithSymbolicTraits:)]
pub unsafe fn fontDescriptorWithSymbolicTraits(
&self,
symbolic_traits: UIFontDescriptorSymbolicTraits,
) -> Option<Retained<UIFontDescriptor>>;
#[method_id(@__retain_semantics Other fontDescriptorWithDesign:)]
pub unsafe fn fontDescriptorWithDesign(
&self,
design: &UIFontDescriptorSystemDesign,
) -> Option<Retained<UIFontDescriptor>>;
}
);
extern_methods!(
unsafe impl UIFontDescriptor {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern "C" {
pub static UIFontDescriptorFamilyAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorNameAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorFaceAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorSizeAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorVisibleNameAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorMatrixAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorCharacterSetAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorCascadeListAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorTraitsAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorFixedAdvanceAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorFeatureSettingsAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontDescriptorTextStyleAttribute: &'static UIFontDescriptorAttributeName;
}
extern "C" {
pub static UIFontSymbolicTrait: &'static UIFontDescriptorTraitKey;
}
extern "C" {
pub static UIFontWeightTrait: &'static UIFontDescriptorTraitKey;
}
extern "C" {
pub static UIFontWidthTrait: &'static UIFontDescriptorTraitKey;
}
extern "C" {
pub static UIFontSlantTrait: &'static UIFontDescriptorTraitKey;
}
extern "C" {
pub static UIFontWeightUltraLight: UIFontWeight;
}
extern "C" {
pub static UIFontWeightThin: UIFontWeight;
}
extern "C" {
pub static UIFontWeightLight: UIFontWeight;
}
extern "C" {
pub static UIFontWeightRegular: UIFontWeight;
}
extern "C" {
pub static UIFontWeightMedium: UIFontWeight;
}
extern "C" {
pub static UIFontWeightSemibold: UIFontWeight;
}
extern "C" {
pub static UIFontWeightBold: UIFontWeight;
}
extern "C" {
pub static UIFontWeightHeavy: UIFontWeight;
}
extern "C" {
pub static UIFontWeightBlack: UIFontWeight;
}
extern "C" {
pub static UIFontWidthCondensed: UIFontWidth;
}
extern "C" {
pub static UIFontWidthStandard: UIFontWidth;
}
extern "C" {
pub static UIFontWidthExpanded: UIFontWidth;
}
extern "C" {
pub static UIFontWidthCompressed: UIFontWidth;
}
extern "C" {
pub static UIFontFeatureTypeIdentifierKey: &'static UIFontDescriptorFeatureKey;
}
extern "C" {
pub static UIFontFeatureSelectorIdentifierKey: &'static UIFontDescriptorFeatureKey;
}
extern "C" {
pub static UIFontTextStyleLargeTitle: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleExtraLargeTitle: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleExtraLargeTitle2: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleTitle1: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleTitle2: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleTitle3: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleHeadline: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleSubheadline: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleBody: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleCallout: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleFootnote: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleCaption1: &'static UIFontTextStyle;
}
extern "C" {
pub static UIFontTextStyleCaption2: &'static UIFontTextStyle;
}