Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

File diff suppressed because one or more lines are too long

2441
vendor/objc2-ui-kit/Cargo.toml vendored Normal file

File diff suppressed because it is too large Load Diff

14
vendor/objc2-ui-kit/README.md vendored Normal file
View File

@@ -0,0 +1,14 @@
# `objc2-ui-kit`
[![Latest version](https://badgen.net/crates/v/objc2-ui-kit)](https://crates.io/crates/objc2-ui-kit)
[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt)
[![Documentation](https://docs.rs/objc2-ui-kit/badge.svg)](https://docs.rs/objc2-ui-kit/)
[![CI](https://github.com/madsmtm/objc2/actions/workflows/ci.yml/badge.svg)](https://github.com/madsmtm/objc2/actions/workflows/ci.yml)
Rust bindings to Apple's framework UIKit.
This README is kept intentionally small to consolidate the documentation, see
[the Rust docs](https://docs.rs/objc2-ui-kit/) for more details on this crate.
This crate is part of the [`objc2` project](https://github.com/madsmtm/objc2),
see that for related crates.

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,441 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static NSFontAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSParagraphStyleAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSForegroundColorAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSBackgroundColorAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSLigatureAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSKernAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSTrackingAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSStrikethroughStyleAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSUnderlineStyleAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSStrokeColorAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSStrokeWidthAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSShadowAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSTextEffectAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSAttachmentAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSLinkAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSBaselineOffsetAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSUnderlineColorAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSStrikethroughColorAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSWritingDirectionAttributeName: &'static NSAttributedStringKey;
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSUnderlineStyle(pub NSInteger);
bitflags::bitflags! {
impl NSUnderlineStyle: NSInteger {
#[doc(alias = "NSUnderlineStyleNone")]
const None = 0x00;
#[doc(alias = "NSUnderlineStyleSingle")]
const Single = 0x01;
#[doc(alias = "NSUnderlineStyleThick")]
const Thick = 0x02;
#[doc(alias = "NSUnderlineStyleDouble")]
const Double = 0x09;
#[doc(alias = "NSUnderlineStylePatternSolid")]
const PatternSolid = 0x0000;
#[doc(alias = "NSUnderlineStylePatternDot")]
const PatternDot = 0x0100;
#[doc(alias = "NSUnderlineStylePatternDash")]
const PatternDash = 0x0200;
#[doc(alias = "NSUnderlineStylePatternDashDot")]
const PatternDashDot = 0x0300;
#[doc(alias = "NSUnderlineStylePatternDashDotDot")]
const PatternDashDotDot = 0x0400;
#[doc(alias = "NSUnderlineStyleByWord")]
const ByWord = 0x8000;
}
}
unsafe impl Encode for NSUnderlineStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSUnderlineStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWritingDirectionFormatType(pub NSInteger);
impl NSWritingDirectionFormatType {
pub const NSWritingDirectionEmbedding: Self = Self(0 << 1);
pub const NSWritingDirectionOverride: Self = Self(1 << 1);
}
unsafe impl Encode for NSWritingDirectionFormatType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWritingDirectionFormatType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_TYPED_ENUM
pub type NSTextEffectStyle = NSString;
extern "C" {
pub static NSTextEffectLetterpressStyle: &'static NSTextEffectStyle;
}
extern_category!(
/// Category on [`NSMutableAttributedString`].
pub unsafe trait NSAttributedStringAttributeFixing {
#[method(fixAttributesInRange:)]
unsafe fn fixAttributesInRange(&self, range: NSRange);
}
unsafe impl NSAttributedStringAttributeFixing for NSMutableAttributedString {}
);
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentType = NSString;
extern "C" {
pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
}
extern "C" {
pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
}
extern "C" {
pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
}
extern "C" {
pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
}
// NS_TYPED_ENUM
pub type NSTextLayoutSectionKey = NSString;
extern "C" {
pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
}
extern "C" {
pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextScalingType(pub NSInteger);
impl NSTextScalingType {
pub const NSTextScalingStandard: Self = Self(0);
pub const NSTextScalingiOS: Self = Self(1);
}
unsafe impl Encode for NSTextScalingType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextScalingType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentAttributeKey = NSString;
extern "C" {
pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSCharacterEncodingDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSDefaultAttributesDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSPaperMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSDefaultFontExcludedDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSHyphenationFactorDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSDefaultTabIntervalDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSSourceTextScalingDocumentAttribute:
&'static NSAttributedStringDocumentAttributeKey;
}
extern "C" {
pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentReadingOptionKey = NSString;
extern "C" {
pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
}
extern "C" {
pub static NSDefaultAttributesDocumentOption:
&'static NSAttributedStringDocumentReadingOptionKey;
}
extern "C" {
pub static NSCharacterEncodingDocumentOption:
&'static NSAttributedStringDocumentReadingOptionKey;
}
extern "C" {
pub static NSTargetTextScalingDocumentOption:
&'static NSAttributedStringDocumentReadingOptionKey;
}
extern "C" {
pub static NSSourceTextScalingDocumentOption:
&'static NSAttributedStringDocumentReadingOptionKey;
}
extern_category!(
/// Category on [`NSAttributedString`].
pub unsafe trait NSAttributedStringDocumentFormats {
#[method_id(@__retain_semantics Init initWithURL:options:documentAttributes:error:_)]
unsafe fn initWithURL_options_documentAttributes_error(
this: Allocated<Self>,
url: &NSURL,
options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
dict: Option<
&mut Option<
Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
>,
>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[method_id(@__retain_semantics Init initWithData:options:documentAttributes:error:_)]
unsafe fn initWithData_options_documentAttributes_error(
this: Allocated<Self>,
data: &NSData,
options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
dict: Option<
&mut Option<
Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
>,
>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[method_id(@__retain_semantics Other dataFromRange:documentAttributes:error:_)]
unsafe fn dataFromRange_documentAttributes_error(
&self,
range: NSRange,
dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
) -> Result<Retained<NSData>, Retained<NSError>>;
#[method_id(@__retain_semantics Other fileWrapperFromRange:documentAttributes:error:_)]
unsafe fn fileWrapperFromRange_documentAttributes_error(
&self,
range: NSRange,
dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
) -> Result<Retained<NSFileWrapper>, Retained<NSError>>;
}
unsafe impl NSAttributedStringDocumentFormats for NSAttributedString {}
);
extern_category!(
/// Category on [`NSMutableAttributedString`].
pub unsafe trait NSMutableAttributedStringDocumentFormats {
#[method(readFromURL:options:documentAttributes:error:_)]
unsafe fn readFromURL_options_documentAttributes_error(
&self,
url: &NSURL,
opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
dict: Option<
&mut Option<
Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
>,
>,
) -> Result<(), Retained<NSError>>;
#[method(readFromData:options:documentAttributes:error:_)]
unsafe fn readFromData_options_documentAttributes_error(
&self,
data: &NSData,
opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
dict: Option<
&mut Option<
Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
>,
>,
) -> Result<(), Retained<NSError>>;
}
unsafe impl NSMutableAttributedStringDocumentFormats for NSMutableAttributedString {}
);
extern_category!(
/// Category on [`NSAttributedString`].
pub unsafe trait NSAttributedStringKitAdditions {
#[method(containsAttachmentsInRange:)]
unsafe fn containsAttachmentsInRange(&self, range: NSRange) -> bool;
}
unsafe impl NSAttributedStringKitAdditions for NSAttributedString {}
);
extern "C" {
pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
}
extern "C" {
pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
}
pub static NSUnderlinePatternSolid: NSUnderlineStyle =
NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
pub static NSUnderlinePatternDot: NSUnderlineStyle =
NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
pub static NSUnderlinePatternDash: NSUnderlineStyle =
NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
// NS_ENUM
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextWritingDirection(pub NSInteger);
impl NSTextWritingDirection {
#[deprecated]
#[doc(alias = "NSTextWritingDirectionEmbedding")]
pub const Embedding: Self = Self(0 << 1);
#[deprecated]
#[doc(alias = "NSTextWritingDirectionOverride")]
pub const Override: Self = Self(1 << 1);
}
unsafe impl Encode for NSTextWritingDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextWritingDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

View File

@@ -0,0 +1,63 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type NSDataAssetName = NSString;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSDataAsset;
unsafe impl ClassType for NSDataAsset {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl Send for NSDataAsset {}
unsafe impl Sync for NSDataAsset {}
unsafe impl NSCopying for NSDataAsset {}
unsafe impl NSObjectProtocol for NSDataAsset {}
extern_methods!(
unsafe impl NSDataAsset {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithName:)]
pub unsafe fn initWithName(
this: Allocated<Self>,
name: &NSDataAssetName,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init initWithName:bundle:)]
pub unsafe fn initWithName_bundle(
this: Allocated<Self>,
name: &NSDataAssetName,
bundle: &NSBundle,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Retained<NSDataAssetName>;
#[method_id(@__retain_semantics Other data)]
pub unsafe fn data(&self) -> Retained<NSData>;
#[method_id(@__retain_semantics Other typeIdentifier)]
pub unsafe fn typeIdentifier(&self) -> Retained<NSString>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSDataAsset {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,158 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
__inner_extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSDiffableDataSourceSectionSnapshot<ItemIdentifierType: ?Sized = AnyObject> {
__superclass: NSObject,
_inner0: PhantomData<*mut ItemIdentifierType>,
notunwindsafe: PhantomData<&'static mut ()>,
}
unsafe impl<ItemIdentifierType: ?Sized + Message> ClassType
for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
type Super = NSObject;
type Mutability = InteriorMutable;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
unsafe impl<ItemIdentifierType: ?Sized + IsIdCloneable> NSCopying
for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}
unsafe impl<ItemIdentifierType: ?Sized> NSObjectProtocol
for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}
extern_methods!(
unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method(appendItems:)]
pub unsafe fn appendItems(&self, items: &NSArray<ItemIdentifierType>);
#[method(appendItems:intoParentItem:)]
pub unsafe fn appendItems_intoParentItem(
&self,
items: &NSArray<ItemIdentifierType>,
parent_item: Option<&ItemIdentifierType>,
);
#[method(insertItems:beforeItem:)]
pub unsafe fn insertItems_beforeItem(
&self,
items: &NSArray<ItemIdentifierType>,
before_identifier: &ItemIdentifierType,
);
#[method(insertItems:afterItem:)]
pub unsafe fn insertItems_afterItem(
&self,
items: &NSArray<ItemIdentifierType>,
after_identifier: &ItemIdentifierType,
);
#[method(deleteItems:)]
pub unsafe fn deleteItems(&self, items: &NSArray<ItemIdentifierType>);
#[method(deleteAllItems)]
pub unsafe fn deleteAllItems(&self);
#[method(expandItems:)]
pub unsafe fn expandItems(&self, items: &NSArray<ItemIdentifierType>);
#[method(collapseItems:)]
pub unsafe fn collapseItems(&self, items: &NSArray<ItemIdentifierType>);
#[method(replaceChildrenOfParentItem:withSnapshot:)]
pub unsafe fn replaceChildrenOfParentItem_withSnapshot(
&self,
parent_item: &ItemIdentifierType,
snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
);
#[method(insertSnapshot:beforeItem:)]
pub unsafe fn insertSnapshot_beforeItem(
&self,
snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
item: &ItemIdentifierType,
);
#[method_id(@__retain_semantics Other insertSnapshot:afterItem:)]
pub unsafe fn insertSnapshot_afterItem(
&self,
snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
item: &ItemIdentifierType,
) -> Retained<ItemIdentifierType>;
#[method(isExpanded:)]
pub unsafe fn isExpanded(&self, item: &ItemIdentifierType) -> bool;
#[method(isVisible:)]
pub unsafe fn isVisible(&self, item: &ItemIdentifierType) -> bool;
#[method(containsItem:)]
pub unsafe fn containsItem(&self, item: &ItemIdentifierType) -> bool;
#[method(levelOfItem:)]
pub unsafe fn levelOfItem(&self, item: &ItemIdentifierType) -> NSInteger;
#[method(indexOfItem:)]
pub unsafe fn indexOfItem(&self, item: &ItemIdentifierType) -> NSInteger;
#[method_id(@__retain_semantics Other expandedItems)]
pub unsafe fn expandedItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other parentOfChildItem:)]
pub unsafe fn parentOfChildItem(
&self,
child_item: &ItemIdentifierType,
) -> Option<Retained<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other snapshotOfParentItem:)]
pub unsafe fn snapshotOfParentItem(
&self,
parent_item: &ItemIdentifierType,
) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other snapshotOfParentItem:includingParentItem:)]
pub unsafe fn snapshotOfParentItem_includingParentItem(
&self,
parent_item: &ItemIdentifierType,
including_parent_item: bool,
) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other rootItems)]
pub unsafe fn rootItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other visibleItems)]
pub unsafe fn visibleItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
#[method_id(@__retain_semantics Other visualDescription)]
pub unsafe fn visualDescription(&self) -> Retained<NSString>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,30 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_category!(
/// Category "UIKitAdditions" on [`NSIndexPath`].
#[doc(alias = "UIKitAdditions")]
pub unsafe trait NSIndexPathUIKitAdditions {
#[method_id(@__retain_semantics Other indexPathForRow:inSection:)]
unsafe fn indexPathForRow_inSection(row: NSInteger, section: NSInteger) -> Retained<Self>;
#[method_id(@__retain_semantics Other indexPathForItem:inSection:)]
unsafe fn indexPathForItem_inSection(item: NSInteger, section: NSInteger)
-> Retained<Self>;
#[method(section)]
unsafe fn section(&self) -> NSInteger;
#[method(row)]
unsafe fn row(&self) -> NSInteger;
#[method(item)]
unsafe fn item(&self) -> NSInteger;
}
unsafe impl NSIndexPathUIKitAdditions for NSIndexPath {}
);

View File

@@ -0,0 +1,99 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPreferredPresentationStyle(pub NSInteger);
impl UIPreferredPresentationStyle {
#[doc(alias = "UIPreferredPresentationStyleUnspecified")]
pub const Unspecified: Self = Self(0);
#[doc(alias = "UIPreferredPresentationStyleInline")]
pub const Inline: Self = Self(1);
#[doc(alias = "UIPreferredPresentationStyleAttachment")]
pub const Attachment: Self = Self(2);
}
unsafe impl Encode for UIPreferredPresentationStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPreferredPresentationStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_category!(
/// Category "UIKitAdditions" on [`NSItemProvider`].
#[doc(alias = "UIKitAdditions")]
pub unsafe trait NSItemProviderUIKitAdditions {
#[method_id(@__retain_semantics Other teamData)]
unsafe fn teamData(&self) -> Option<Retained<NSData>>;
#[method(setTeamData:)]
unsafe fn setTeamData(&self, team_data: Option<&NSData>);
#[method(preferredPresentationSize)]
unsafe fn preferredPresentationSize(&self) -> CGSize;
#[method(setPreferredPresentationSize:)]
unsafe fn setPreferredPresentationSize(&self, preferred_presentation_size: CGSize);
#[method(preferredPresentationStyle)]
unsafe fn preferredPresentationStyle(&self) -> UIPreferredPresentationStyle;
#[method(setPreferredPresentationStyle:)]
unsafe fn setPreferredPresentationStyle(
&self,
preferred_presentation_style: UIPreferredPresentationStyle,
);
}
unsafe impl NSItemProviderUIKitAdditions for NSItemProvider {}
);
extern_protocol!(
pub unsafe trait UIItemProviderPresentationSizeProviding:
NSObjectProtocol + IsMainThreadOnly
{
#[method(preferredPresentationSizeForItemProvider)]
unsafe fn preferredPresentationSizeForItemProvider(&self) -> CGSize;
}
unsafe impl ProtocolType for dyn UIItemProviderPresentationSizeProviding {}
);
extern_protocol!(
pub unsafe trait UIItemProviderReadingAugmentationProviding {
#[method_id(@__retain_semantics Other objectWithItemProviderData:typeIdentifier:requestedClass:error:_)]
unsafe fn objectWithItemProviderData_typeIdentifier_requestedClass_error(
data: &NSData,
type_identifier: &NSString,
requested_class: &AnyClass,
) -> Result<Retained<AnyObject>, Retained<NSError>>;
#[method_id(@__retain_semantics Other additionalLeadingReadableTypeIdentifiersForItemProvider)]
unsafe fn additionalLeadingReadableTypeIdentifiersForItemProvider(
) -> Retained<NSArray<NSString>>;
#[method_id(@__retain_semantics Other additionalTrailingReadableTypeIdentifiersForItemProvider)]
unsafe fn additionalTrailingReadableTypeIdentifiersForItemProvider(
) -> Retained<NSArray<NSString>>;
}
unsafe impl ProtocolType for dyn UIItemProviderReadingAugmentationProviding {}
);
extern_protocol!(
pub unsafe trait UIItemProviderReadingAugmentationDesignating:
NSItemProviderReading
{
#[method(_ui_augmentingNSItemProviderReadingClass)]
unsafe fn _ui_augmentingNSItemProviderReadingClass() -> &'static AnyClass;
}
unsafe impl ProtocolType for dyn UIItemProviderReadingAugmentationDesignating {}
);

View File

@@ -0,0 +1,342 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
__inner_extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSLayoutAnchor<AnchorType: ?Sized = AnyObject> {
__superclass: NSObject,
_inner0: PhantomData<*mut AnchorType>,
notunwindsafe: PhantomData<&'static mut ()>,
}
unsafe impl<AnchorType: ?Sized + Message> ClassType for NSLayoutAnchor<AnchorType> {
type Super = NSObject;
type Mutability = MainThreadOnly;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
unsafe impl<AnchorType: ?Sized + NSCoding> NSCoding for NSLayoutAnchor<AnchorType> {}
unsafe impl<AnchorType: ?Sized + IsIdCloneable> NSCopying for NSLayoutAnchor<AnchorType> {}
unsafe impl<AnchorType: ?Sized> NSObjectProtocol for NSLayoutAnchor<AnchorType> {}
extern_methods!(
unsafe impl<AnchorType: Message> NSLayoutAnchor<AnchorType> {
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToAnchor:)]
pub unsafe fn constraintEqualToAnchor(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:)]
pub unsafe fn constraintGreaterThanOrEqualToAnchor(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:)]
pub unsafe fn constraintLessThanOrEqualToAnchor(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToAnchor:constant:)]
pub unsafe fn constraintEqualToAnchor_constant(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:constant:)]
pub unsafe fn constraintGreaterThanOrEqualToAnchor_constant(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:constant:)]
pub unsafe fn constraintLessThanOrEqualToAnchor_constant(
&self,
anchor: &NSLayoutAnchor<AnchorType>,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[method_id(@__retain_semantics Other item)]
pub unsafe fn item(&self) -> Option<Retained<AnyObject>>;
#[method(hasAmbiguousLayout)]
pub unsafe fn hasAmbiguousLayout(&self) -> bool;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintsAffectingLayout)]
pub unsafe fn constraintsAffectingLayout(&self) -> Retained<NSArray<NSLayoutConstraint>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl<AnchorType: Message> NSLayoutAnchor<AnchorType> {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug)]
pub struct NSLayoutXAxisAnchor;
unsafe impl ClassType for NSLayoutXAxisAnchor {
#[inherits(NSObject)]
type Super = NSLayoutAnchor;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for NSLayoutXAxisAnchor {}
unsafe impl NSCopying for NSLayoutXAxisAnchor {}
unsafe impl NSObjectProtocol for NSLayoutXAxisAnchor {}
extern_methods!(
unsafe impl NSLayoutXAxisAnchor {
#[method_id(@__retain_semantics Other anchorWithOffsetToAnchor:)]
pub unsafe fn anchorWithOffsetToAnchor(
&self,
other_anchor: &NSLayoutXAxisAnchor,
) -> Retained<NSLayoutDimension>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSLayoutXAxisAnchor {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug)]
pub struct NSLayoutYAxisAnchor;
unsafe impl ClassType for NSLayoutYAxisAnchor {
#[inherits(NSObject)]
type Super = NSLayoutAnchor;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for NSLayoutYAxisAnchor {}
unsafe impl NSCopying for NSLayoutYAxisAnchor {}
unsafe impl NSObjectProtocol for NSLayoutYAxisAnchor {}
extern_methods!(
unsafe impl NSLayoutYAxisAnchor {
#[method_id(@__retain_semantics Other anchorWithOffsetToAnchor:)]
pub unsafe fn anchorWithOffsetToAnchor(
&self,
other_anchor: &NSLayoutYAxisAnchor,
) -> Retained<NSLayoutDimension>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSLayoutYAxisAnchor {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug)]
pub struct NSLayoutDimension;
unsafe impl ClassType for NSLayoutDimension {
#[inherits(NSObject)]
type Super = NSLayoutAnchor;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for NSLayoutDimension {}
unsafe impl NSCopying for NSLayoutDimension {}
unsafe impl NSObjectProtocol for NSLayoutDimension {}
extern_methods!(
unsafe impl NSLayoutDimension {
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToConstant:)]
pub unsafe fn constraintEqualToConstant(&self, c: CGFloat) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToConstant:)]
pub unsafe fn constraintGreaterThanOrEqualToConstant(
&self,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToConstant:)]
pub unsafe fn constraintLessThanOrEqualToConstant(
&self,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToAnchor:multiplier:)]
pub unsafe fn constraintEqualToAnchor_multiplier(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:multiplier:)]
pub unsafe fn constraintGreaterThanOrEqualToAnchor_multiplier(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:multiplier:)]
pub unsafe fn constraintLessThanOrEqualToAnchor_multiplier(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToAnchor:multiplier:constant:)]
pub unsafe fn constraintEqualToAnchor_multiplier_constant(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToAnchor:multiplier:constant:)]
pub unsafe fn constraintGreaterThanOrEqualToAnchor_multiplier_constant(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToAnchor:multiplier:constant:)]
pub unsafe fn constraintLessThanOrEqualToAnchor_multiplier_constant(
&self,
anchor: &NSLayoutDimension,
m: CGFloat,
c: CGFloat,
) -> Retained<NSLayoutConstraint>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSLayoutDimension {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// UIViewDynamicSystemSpacingSupport
unsafe impl NSLayoutXAxisAnchor {
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToSystemSpacingAfterAnchor:multiplier:)]
pub unsafe fn constraintEqualToSystemSpacingAfterAnchor_multiplier(
&self,
anchor: &NSLayoutXAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToSystemSpacingAfterAnchor:multiplier:)]
pub unsafe fn constraintGreaterThanOrEqualToSystemSpacingAfterAnchor_multiplier(
&self,
anchor: &NSLayoutXAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToSystemSpacingAfterAnchor:multiplier:)]
pub unsafe fn constraintLessThanOrEqualToSystemSpacingAfterAnchor_multiplier(
&self,
anchor: &NSLayoutXAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
}
);
extern_methods!(
/// UIViewDynamicSystemSpacingSupport
unsafe impl NSLayoutYAxisAnchor {
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintEqualToSystemSpacingBelowAnchor:multiplier:)]
pub unsafe fn constraintEqualToSystemSpacingBelowAnchor_multiplier(
&self,
anchor: &NSLayoutYAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintGreaterThanOrEqualToSystemSpacingBelowAnchor:multiplier:)]
pub unsafe fn constraintGreaterThanOrEqualToSystemSpacingBelowAnchor_multiplier(
&self,
anchor: &NSLayoutYAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
#[cfg(feature = "NSLayoutConstraint")]
#[method_id(@__retain_semantics Other constraintLessThanOrEqualToSystemSpacingBelowAnchor:multiplier:)]
pub unsafe fn constraintLessThanOrEqualToSystemSpacingBelowAnchor_multiplier(
&self,
anchor: &NSLayoutYAxisAnchor,
multiplier: CGFloat,
) -> Retained<NSLayoutConstraint>;
}
);

View File

@@ -0,0 +1,281 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_EXTENSIBLE_ENUM
pub type UILayoutPriority = c_float;
pub static UILayoutPriorityRequired: UILayoutPriority = 1000 as _;
pub static UILayoutPriorityDefaultHigh: UILayoutPriority = 750 as _;
pub static UILayoutPriorityDragThatCanResizeScene: UILayoutPriority = 510 as _;
pub static UILayoutPrioritySceneSizeStayPut: UILayoutPriority = 500 as _;
pub static UILayoutPriorityDragThatCannotResizeScene: UILayoutPriority = 490 as _;
pub static UILayoutPriorityDefaultLow: UILayoutPriority = 250 as _;
pub static UILayoutPriorityFittingSizeLevel: UILayoutPriority = 50 as _;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutRelation(pub NSInteger);
impl NSLayoutRelation {
#[doc(alias = "NSLayoutRelationLessThanOrEqual")]
pub const LessThanOrEqual: Self = Self(-1);
#[doc(alias = "NSLayoutRelationEqual")]
pub const Equal: Self = Self(0);
#[doc(alias = "NSLayoutRelationGreaterThanOrEqual")]
pub const GreaterThanOrEqual: Self = Self(1);
}
unsafe impl Encode for NSLayoutRelation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSLayoutRelation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutAttribute(pub NSInteger);
impl NSLayoutAttribute {
#[doc(alias = "NSLayoutAttributeLeft")]
pub const Left: Self = Self(1);
#[doc(alias = "NSLayoutAttributeRight")]
pub const Right: Self = Self(2);
#[doc(alias = "NSLayoutAttributeTop")]
pub const Top: Self = Self(3);
#[doc(alias = "NSLayoutAttributeBottom")]
pub const Bottom: Self = Self(4);
#[doc(alias = "NSLayoutAttributeLeading")]
pub const Leading: Self = Self(5);
#[doc(alias = "NSLayoutAttributeTrailing")]
pub const Trailing: Self = Self(6);
#[doc(alias = "NSLayoutAttributeWidth")]
pub const Width: Self = Self(7);
#[doc(alias = "NSLayoutAttributeHeight")]
pub const Height: Self = Self(8);
#[doc(alias = "NSLayoutAttributeCenterX")]
pub const CenterX: Self = Self(9);
#[doc(alias = "NSLayoutAttributeCenterY")]
pub const CenterY: Self = Self(10);
#[doc(alias = "NSLayoutAttributeLastBaseline")]
pub const LastBaseline: Self = Self(11);
#[doc(alias = "NSLayoutAttributeBaseline")]
pub const Baseline: Self = Self(NSLayoutAttribute::LastBaseline.0);
#[doc(alias = "NSLayoutAttributeFirstBaseline")]
pub const FirstBaseline: Self = Self(12);
#[doc(alias = "NSLayoutAttributeLeftMargin")]
pub const LeftMargin: Self = Self(13);
#[doc(alias = "NSLayoutAttributeRightMargin")]
pub const RightMargin: Self = Self(14);
#[doc(alias = "NSLayoutAttributeTopMargin")]
pub const TopMargin: Self = Self(15);
#[doc(alias = "NSLayoutAttributeBottomMargin")]
pub const BottomMargin: Self = Self(16);
#[doc(alias = "NSLayoutAttributeLeadingMargin")]
pub const LeadingMargin: Self = Self(17);
#[doc(alias = "NSLayoutAttributeTrailingMargin")]
pub const TrailingMargin: Self = Self(18);
#[doc(alias = "NSLayoutAttributeCenterXWithinMargins")]
pub const CenterXWithinMargins: Self = Self(19);
#[doc(alias = "NSLayoutAttributeCenterYWithinMargins")]
pub const CenterYWithinMargins: Self = Self(20);
#[doc(alias = "NSLayoutAttributeNotAnAttribute")]
pub const NotAnAttribute: Self = Self(0);
}
unsafe impl Encode for NSLayoutAttribute {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSLayoutAttribute {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutFormatOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSLayoutFormatOptions: NSUInteger {
const NSLayoutFormatAlignAllLeft = 1<<NSLayoutAttribute::Left.0;
const NSLayoutFormatAlignAllRight = 1<<NSLayoutAttribute::Right.0;
const NSLayoutFormatAlignAllTop = 1<<NSLayoutAttribute::Top.0;
const NSLayoutFormatAlignAllBottom = 1<<NSLayoutAttribute::Bottom.0;
const NSLayoutFormatAlignAllLeading = 1<<NSLayoutAttribute::Leading.0;
const NSLayoutFormatAlignAllTrailing = 1<<NSLayoutAttribute::Trailing.0;
const NSLayoutFormatAlignAllCenterX = 1<<NSLayoutAttribute::CenterX.0;
const NSLayoutFormatAlignAllCenterY = 1<<NSLayoutAttribute::CenterY.0;
const NSLayoutFormatAlignAllLastBaseline = 1<<NSLayoutAttribute::LastBaseline.0;
const NSLayoutFormatAlignAllFirstBaseline = 1<<NSLayoutAttribute::FirstBaseline.0;
const NSLayoutFormatAlignAllBaseline = NSLayoutFormatOptions::NSLayoutFormatAlignAllLastBaseline.0;
const NSLayoutFormatAlignmentMask = 0xFFFF;
const NSLayoutFormatDirectionLeadingToTrailing = 0<<16;
const NSLayoutFormatDirectionLeftToRight = 1<<16;
const NSLayoutFormatDirectionRightToLeft = 2<<16;
const NSLayoutFormatDirectionMask = 0x3<<16;
const NSLayoutFormatSpacingEdgeToEdge = 0<<19;
const NSLayoutFormatSpacingBaselineToBaseline = 1<<19;
const NSLayoutFormatSpacingMask = 0x1<<19;
}
}
unsafe impl Encode for NSLayoutFormatOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSLayoutFormatOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSLayoutConstraint;
unsafe impl ClassType for NSLayoutConstraint {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for NSLayoutConstraint {}
extern_methods!(
unsafe impl NSLayoutConstraint {
#[method_id(@__retain_semantics Other constraintsWithVisualFormat:options:metrics:views:)]
pub unsafe fn constraintsWithVisualFormat_options_metrics_views(
format: &NSString,
opts: NSLayoutFormatOptions,
metrics: Option<&NSDictionary<NSString, AnyObject>>,
views: &NSDictionary<NSString, AnyObject>,
mtm: MainThreadMarker,
) -> Retained<NSArray<NSLayoutConstraint>>;
#[method_id(@__retain_semantics Other constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:)]
pub unsafe fn constraintWithItem_attribute_relatedBy_toItem_attribute_multiplier_constant(
view1: &AnyObject,
attr1: NSLayoutAttribute,
relation: NSLayoutRelation,
view2: Option<&AnyObject>,
attr2: NSLayoutAttribute,
multiplier: CGFloat,
c: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method(priority)]
pub unsafe fn priority(&self) -> UILayoutPriority;
#[method(setPriority:)]
pub unsafe fn setPriority(&self, priority: UILayoutPriority);
#[method(shouldBeArchived)]
pub unsafe fn shouldBeArchived(&self) -> bool;
#[method(setShouldBeArchived:)]
pub unsafe fn setShouldBeArchived(&self, should_be_archived: bool);
#[method_id(@__retain_semantics Other firstItem)]
pub unsafe fn firstItem(&self) -> Option<Retained<AnyObject>>;
#[method_id(@__retain_semantics Other secondItem)]
pub unsafe fn secondItem(&self) -> Option<Retained<AnyObject>>;
#[method(firstAttribute)]
pub unsafe fn firstAttribute(&self) -> NSLayoutAttribute;
#[method(secondAttribute)]
pub unsafe fn secondAttribute(&self) -> NSLayoutAttribute;
#[cfg(feature = "NSLayoutAnchor")]
#[method_id(@__retain_semantics Other firstAnchor)]
pub unsafe fn firstAnchor(&self) -> Retained<NSLayoutAnchor>;
#[cfg(feature = "NSLayoutAnchor")]
#[method_id(@__retain_semantics Other secondAnchor)]
pub unsafe fn secondAnchor(&self) -> Option<Retained<NSLayoutAnchor>>;
#[method(relation)]
pub unsafe fn relation(&self) -> NSLayoutRelation;
#[method(multiplier)]
pub unsafe fn multiplier(&self) -> CGFloat;
#[method(constant)]
pub unsafe fn constant(&self) -> CGFloat;
#[method(setConstant:)]
pub unsafe fn setConstant(&self, constant: CGFloat);
#[method(isActive)]
pub unsafe fn isActive(&self) -> bool;
#[method(setActive:)]
pub unsafe fn setActive(&self, active: bool);
#[method(activateConstraints:)]
pub unsafe fn activateConstraints(
constraints: &NSArray<NSLayoutConstraint>,
mtm: MainThreadMarker,
);
#[method(deactivateConstraints:)]
pub unsafe fn deactivateConstraints(
constraints: &NSArray<NSLayoutConstraint>,
mtm: MainThreadMarker,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSLayoutConstraint {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// NSIdentifier
unsafe impl NSLayoutConstraint {
#[method_id(@__retain_semantics Other identifier)]
pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
#[method(setIdentifier:)]
pub unsafe fn setIdentifier(&self, identifier: Option<&NSString>);
}
);
extern_protocol!(
pub unsafe trait UILayoutSupport: NSObjectProtocol + IsMainThreadOnly {
#[method(length)]
unsafe fn length(&self) -> CGFloat;
#[cfg(feature = "NSLayoutAnchor")]
#[method_id(@__retain_semantics Other topAnchor)]
unsafe fn topAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
#[cfg(feature = "NSLayoutAnchor")]
#[method_id(@__retain_semantics Other bottomAnchor)]
unsafe fn bottomAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
#[cfg(feature = "NSLayoutAnchor")]
#[method_id(@__retain_semantics Other heightAnchor)]
unsafe fn heightAnchor(&self) -> Retained<NSLayoutDimension>;
}
unsafe impl ProtocolType for dyn UILayoutSupport {}
);

View File

@@ -0,0 +1,722 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextLayoutOrientation(pub NSInteger);
impl NSTextLayoutOrientation {
#[doc(alias = "NSTextLayoutOrientationHorizontal")]
pub const Horizontal: Self = Self(0);
#[doc(alias = "NSTextLayoutOrientationVertical")]
pub const Vertical: Self = Self(1);
}
unsafe impl Encode for NSTextLayoutOrientation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextLayoutOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGlyphProperty(pub NSInteger);
bitflags::bitflags! {
impl NSGlyphProperty: NSInteger {
#[doc(alias = "NSGlyphPropertyNull")]
const Null = 1<<0;
#[doc(alias = "NSGlyphPropertyControlCharacter")]
const ControlCharacter = 1<<1;
#[doc(alias = "NSGlyphPropertyElastic")]
const Elastic = 1<<2;
#[doc(alias = "NSGlyphPropertyNonBaseCharacter")]
const NonBaseCharacter = 1<<3;
}
}
unsafe impl Encode for NSGlyphProperty {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGlyphProperty {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSControlCharacterAction(pub NSInteger);
bitflags::bitflags! {
impl NSControlCharacterAction: NSInteger {
#[doc(alias = "NSControlCharacterActionZeroAdvancement")]
const ZeroAdvancement = 1<<0;
#[doc(alias = "NSControlCharacterActionWhitespace")]
const Whitespace = 1<<1;
#[doc(alias = "NSControlCharacterActionHorizontalTab")]
const HorizontalTab = 1<<2;
#[doc(alias = "NSControlCharacterActionLineBreak")]
const LineBreak = 1<<3;
#[doc(alias = "NSControlCharacterActionParagraphBreak")]
const ParagraphBreak = 1<<4;
#[doc(alias = "NSControlCharacterActionContainerBreak")]
const ContainerBreak = 1<<5;
}
}
unsafe impl Encode for NSControlCharacterAction {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSControlCharacterAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait NSTextLayoutOrientationProvider {
#[method(layoutOrientation)]
unsafe fn layoutOrientation(&self) -> NSTextLayoutOrientation;
}
unsafe impl ProtocolType for dyn NSTextLayoutOrientationProvider {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSLayoutManager;
unsafe impl ClassType for NSLayoutManager {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSLayoutManager {}
unsafe impl NSObjectProtocol for NSLayoutManager {}
unsafe impl NSSecureCoding for NSLayoutManager {}
extern_methods!(
unsafe impl NSLayoutManager {
#[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>>;
#[cfg(feature = "NSTextStorage")]
#[method_id(@__retain_semantics Other textStorage)]
pub unsafe fn textStorage(&self) -> Option<Retained<NSTextStorage>>;
#[cfg(feature = "NSTextStorage")]
#[method(setTextStorage:)]
pub unsafe fn setTextStorage(&self, text_storage: Option<&NSTextStorage>);
#[cfg(feature = "NSTextContainer")]
#[method_id(@__retain_semantics Other textContainers)]
pub unsafe fn textContainers(&self) -> Retained<NSArray<NSTextContainer>>;
#[cfg(feature = "NSTextContainer")]
#[method(addTextContainer:)]
pub unsafe fn addTextContainer(&self, container: &NSTextContainer);
#[cfg(feature = "NSTextContainer")]
#[method(insertTextContainer:atIndex:)]
pub unsafe fn insertTextContainer_atIndex(
&self,
container: &NSTextContainer,
index: NSUInteger,
);
#[method(removeTextContainerAtIndex:)]
pub unsafe fn removeTextContainerAtIndex(&self, index: NSUInteger);
#[cfg(feature = "NSTextContainer")]
#[method(textContainerChangedGeometry:)]
pub unsafe fn textContainerChangedGeometry(&self, container: &NSTextContainer);
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSLayoutManagerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSLayoutManagerDelegate>>,
);
#[method(showsInvisibleCharacters)]
pub unsafe fn showsInvisibleCharacters(&self) -> bool;
#[method(setShowsInvisibleCharacters:)]
pub unsafe fn setShowsInvisibleCharacters(&self, shows_invisible_characters: bool);
#[method(showsControlCharacters)]
pub unsafe fn showsControlCharacters(&self) -> bool;
#[method(setShowsControlCharacters:)]
pub unsafe fn setShowsControlCharacters(&self, shows_control_characters: bool);
#[method(usesFontLeading)]
pub unsafe fn usesFontLeading(&self) -> bool;
#[method(setUsesFontLeading:)]
pub unsafe fn setUsesFontLeading(&self, uses_font_leading: bool);
#[method(allowsNonContiguousLayout)]
pub unsafe fn allowsNonContiguousLayout(&self) -> bool;
#[method(setAllowsNonContiguousLayout:)]
pub unsafe fn setAllowsNonContiguousLayout(&self, allows_non_contiguous_layout: bool);
#[method(hasNonContiguousLayout)]
pub unsafe fn hasNonContiguousLayout(&self) -> bool;
#[method(limitsLayoutForSuspiciousContents)]
pub unsafe fn limitsLayoutForSuspiciousContents(&self) -> bool;
#[method(setLimitsLayoutForSuspiciousContents:)]
pub unsafe fn setLimitsLayoutForSuspiciousContents(
&self,
limits_layout_for_suspicious_contents: bool,
);
#[method(usesDefaultHyphenation)]
pub unsafe fn usesDefaultHyphenation(&self) -> bool;
#[method(setUsesDefaultHyphenation:)]
pub unsafe fn setUsesDefaultHyphenation(&self, uses_default_hyphenation: bool);
#[method(invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:)]
pub unsafe fn invalidateGlyphsForCharacterRange_changeInLength_actualCharacterRange(
&self,
char_range: NSRange,
delta: NSInteger,
actual_char_range: NSRangePointer,
);
#[method(invalidateLayoutForCharacterRange:actualCharacterRange:)]
pub unsafe fn invalidateLayoutForCharacterRange_actualCharacterRange(
&self,
char_range: NSRange,
actual_char_range: NSRangePointer,
);
#[method(invalidateDisplayForCharacterRange:)]
pub unsafe fn invalidateDisplayForCharacterRange(&self, char_range: NSRange);
#[method(invalidateDisplayForGlyphRange:)]
pub unsafe fn invalidateDisplayForGlyphRange(&self, glyph_range: NSRange);
#[cfg(feature = "NSTextStorage")]
#[method(processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:)]
pub unsafe fn processEditingForTextStorage_edited_range_changeInLength_invalidatedRange(
&self,
text_storage: &NSTextStorage,
edit_mask: NSTextStorageEditActions,
new_char_range: NSRange,
delta: NSInteger,
invalidated_char_range: NSRange,
);
#[method(ensureGlyphsForCharacterRange:)]
pub unsafe fn ensureGlyphsForCharacterRange(&self, char_range: NSRange);
#[method(ensureGlyphsForGlyphRange:)]
pub unsafe fn ensureGlyphsForGlyphRange(&self, glyph_range: NSRange);
#[method(ensureLayoutForCharacterRange:)]
pub unsafe fn ensureLayoutForCharacterRange(&self, char_range: NSRange);
#[method(ensureLayoutForGlyphRange:)]
pub unsafe fn ensureLayoutForGlyphRange(&self, glyph_range: NSRange);
#[cfg(feature = "NSTextContainer")]
#[method(ensureLayoutForTextContainer:)]
pub unsafe fn ensureLayoutForTextContainer(&self, container: &NSTextContainer);
#[cfg(feature = "NSTextContainer")]
#[method(ensureLayoutForBoundingRect:inTextContainer:)]
pub unsafe fn ensureLayoutForBoundingRect_inTextContainer(
&self,
bounds: CGRect,
container: &NSTextContainer,
);
#[method(numberOfGlyphs)]
pub unsafe fn numberOfGlyphs(&self) -> NSUInteger;
#[method(isValidGlyphIndex:)]
pub unsafe fn isValidGlyphIndex(&self, glyph_index: NSUInteger) -> bool;
#[method(propertyForGlyphAtIndex:)]
pub unsafe fn propertyForGlyphAtIndex(&self, glyph_index: NSUInteger) -> NSGlyphProperty;
#[method(characterIndexForGlyphAtIndex:)]
pub unsafe fn characterIndexForGlyphAtIndex(&self, glyph_index: NSUInteger) -> NSUInteger;
#[method(glyphIndexForCharacterAtIndex:)]
pub unsafe fn glyphIndexForCharacterAtIndex(&self, char_index: NSUInteger) -> NSUInteger;
#[cfg(feature = "NSTextContainer")]
#[method(setTextContainer:forGlyphRange:)]
pub unsafe fn setTextContainer_forGlyphRange(
&self,
container: &NSTextContainer,
glyph_range: NSRange,
);
#[method(setLineFragmentRect:forGlyphRange:usedRect:)]
pub unsafe fn setLineFragmentRect_forGlyphRange_usedRect(
&self,
fragment_rect: CGRect,
glyph_range: NSRange,
used_rect: CGRect,
);
#[cfg(feature = "NSTextContainer")]
#[method(setExtraLineFragmentRect:usedRect:textContainer:)]
pub unsafe fn setExtraLineFragmentRect_usedRect_textContainer(
&self,
fragment_rect: CGRect,
used_rect: CGRect,
container: &NSTextContainer,
);
#[method(setLocation:forStartOfGlyphRange:)]
pub unsafe fn setLocation_forStartOfGlyphRange(
&self,
location: CGPoint,
glyph_range: NSRange,
);
#[method(setNotShownAttribute:forGlyphAtIndex:)]
pub unsafe fn setNotShownAttribute_forGlyphAtIndex(
&self,
flag: bool,
glyph_index: NSUInteger,
);
#[method(setDrawsOutsideLineFragment:forGlyphAtIndex:)]
pub unsafe fn setDrawsOutsideLineFragment_forGlyphAtIndex(
&self,
flag: bool,
glyph_index: NSUInteger,
);
#[method(setAttachmentSize:forGlyphRange:)]
pub unsafe fn setAttachmentSize_forGlyphRange(
&self,
attachment_size: CGSize,
glyph_range: NSRange,
);
#[method(getFirstUnlaidCharacterIndex:glyphIndex:)]
pub unsafe fn getFirstUnlaidCharacterIndex_glyphIndex(
&self,
char_index: *mut NSUInteger,
glyph_index: *mut NSUInteger,
);
#[method(firstUnlaidCharacterIndex)]
pub unsafe fn firstUnlaidCharacterIndex(&self) -> NSUInteger;
#[method(firstUnlaidGlyphIndex)]
pub unsafe fn firstUnlaidGlyphIndex(&self) -> NSUInteger;
#[cfg(feature = "NSTextContainer")]
#[method_id(@__retain_semantics Other textContainerForGlyphAtIndex:effectiveRange:)]
pub unsafe fn textContainerForGlyphAtIndex_effectiveRange(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
) -> Option<Retained<NSTextContainer>>;
#[cfg(feature = "NSTextContainer")]
#[method_id(@__retain_semantics Other textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)]
pub unsafe fn textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
flag: bool,
) -> Option<Retained<NSTextContainer>>;
#[cfg(feature = "NSTextContainer")]
#[method(usedRectForTextContainer:)]
pub unsafe fn usedRectForTextContainer(&self, container: &NSTextContainer) -> CGRect;
#[method(lineFragmentRectForGlyphAtIndex:effectiveRange:)]
pub unsafe fn lineFragmentRectForGlyphAtIndex_effectiveRange(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
) -> CGRect;
#[method(lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)]
pub unsafe fn lineFragmentRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
flag: bool,
) -> CGRect;
#[method(lineFragmentUsedRectForGlyphAtIndex:effectiveRange:)]
pub unsafe fn lineFragmentUsedRectForGlyphAtIndex_effectiveRange(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
) -> CGRect;
#[method(lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:)]
pub unsafe fn lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout(
&self,
glyph_index: NSUInteger,
effective_glyph_range: NSRangePointer,
flag: bool,
) -> CGRect;
#[method(extraLineFragmentRect)]
pub unsafe fn extraLineFragmentRect(&self) -> CGRect;
#[method(extraLineFragmentUsedRect)]
pub unsafe fn extraLineFragmentUsedRect(&self) -> CGRect;
#[cfg(feature = "NSTextContainer")]
#[method_id(@__retain_semantics Other extraLineFragmentTextContainer)]
pub unsafe fn extraLineFragmentTextContainer(&self) -> Option<Retained<NSTextContainer>>;
#[method(locationForGlyphAtIndex:)]
pub unsafe fn locationForGlyphAtIndex(&self, glyph_index: NSUInteger) -> CGPoint;
#[method(notShownAttributeForGlyphAtIndex:)]
pub unsafe fn notShownAttributeForGlyphAtIndex(&self, glyph_index: NSUInteger) -> bool;
#[method(drawsOutsideLineFragmentForGlyphAtIndex:)]
pub unsafe fn drawsOutsideLineFragmentForGlyphAtIndex(
&self,
glyph_index: NSUInteger,
) -> bool;
#[method(attachmentSizeForGlyphAtIndex:)]
pub unsafe fn attachmentSizeForGlyphAtIndex(&self, glyph_index: NSUInteger) -> CGSize;
#[method(truncatedGlyphRangeInLineFragmentForGlyphAtIndex:)]
pub unsafe fn truncatedGlyphRangeInLineFragmentForGlyphAtIndex(
&self,
glyph_index: NSUInteger,
) -> NSRange;
#[method(glyphRangeForCharacterRange:actualCharacterRange:)]
pub unsafe fn glyphRangeForCharacterRange_actualCharacterRange(
&self,
char_range: NSRange,
actual_char_range: NSRangePointer,
) -> NSRange;
#[method(characterRangeForGlyphRange:actualGlyphRange:)]
pub unsafe fn characterRangeForGlyphRange_actualGlyphRange(
&self,
glyph_range: NSRange,
actual_glyph_range: NSRangePointer,
) -> NSRange;
#[cfg(feature = "NSTextContainer")]
#[method(glyphRangeForTextContainer:)]
pub unsafe fn glyphRangeForTextContainer(&self, container: &NSTextContainer) -> NSRange;
#[method(rangeOfNominallySpacedGlyphsContainingIndex:)]
pub unsafe fn rangeOfNominallySpacedGlyphsContainingIndex(
&self,
glyph_index: NSUInteger,
) -> NSRange;
#[cfg(feature = "NSTextContainer")]
#[method(boundingRectForGlyphRange:inTextContainer:)]
pub unsafe fn boundingRectForGlyphRange_inTextContainer(
&self,
glyph_range: NSRange,
container: &NSTextContainer,
) -> CGRect;
#[cfg(feature = "NSTextContainer")]
#[method(glyphRangeForBoundingRect:inTextContainer:)]
pub unsafe fn glyphRangeForBoundingRect_inTextContainer(
&self,
bounds: CGRect,
container: &NSTextContainer,
) -> NSRange;
#[cfg(feature = "NSTextContainer")]
#[method(glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:)]
pub unsafe fn glyphRangeForBoundingRectWithoutAdditionalLayout_inTextContainer(
&self,
bounds: CGRect,
container: &NSTextContainer,
) -> NSRange;
#[cfg(feature = "NSTextContainer")]
#[method(glyphIndexForPoint:inTextContainer:)]
pub unsafe fn glyphIndexForPoint_inTextContainer(
&self,
point: CGPoint,
container: &NSTextContainer,
) -> NSUInteger;
#[cfg(feature = "NSTextContainer")]
#[method(fractionOfDistanceThroughGlyphForPoint:inTextContainer:)]
pub unsafe fn fractionOfDistanceThroughGlyphForPoint_inTextContainer(
&self,
point: CGPoint,
container: &NSTextContainer,
) -> CGFloat;
#[cfg(feature = "NSTextContainer")]
#[method(characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:)]
pub unsafe fn characterIndexForPoint_inTextContainer_fractionOfDistanceBetweenInsertionPoints(
&self,
point: CGPoint,
container: &NSTextContainer,
partial_fraction: *mut CGFloat,
) -> NSUInteger;
#[method(getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:)]
pub unsafe fn getLineFragmentInsertionPointsForCharacterAtIndex_alternatePositions_inDisplayOrder_positions_characterIndexes(
&self,
char_index: NSUInteger,
a_flag: bool,
d_flag: bool,
positions: *mut CGFloat,
char_indexes: *mut NSUInteger,
) -> NSUInteger;
#[cfg(all(feature = "NSTextContainer", feature = "block2"))]
#[method(enumerateLineFragmentsForGlyphRange:usingBlock:)]
pub unsafe fn enumerateLineFragmentsForGlyphRange_usingBlock(
&self,
glyph_range: NSRange,
block: &block2::Block<
dyn Fn(CGRect, CGRect, NonNull<NSTextContainer>, NSRange, NonNull<Bool>),
>,
);
#[cfg(all(feature = "NSTextContainer", feature = "block2"))]
#[method(enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:)]
pub unsafe fn enumerateEnclosingRectsForGlyphRange_withinSelectedGlyphRange_inTextContainer_usingBlock(
&self,
glyph_range: NSRange,
selected_range: NSRange,
text_container: &NSTextContainer,
block: &block2::Block<dyn Fn(CGRect, NonNull<Bool>)>,
);
#[method(drawBackgroundForGlyphRange:atPoint:)]
pub unsafe fn drawBackgroundForGlyphRange_atPoint(
&self,
glyphs_to_show: NSRange,
origin: CGPoint,
);
#[method(drawGlyphsForGlyphRange:atPoint:)]
pub unsafe fn drawGlyphsForGlyphRange_atPoint(
&self,
glyphs_to_show: NSRange,
origin: CGPoint,
);
#[cfg(feature = "UIColor")]
#[method(fillBackgroundRectArray:count:forCharacterRange:color:)]
pub unsafe fn fillBackgroundRectArray_count_forCharacterRange_color(
&self,
rect_array: NonNull<CGRect>,
rect_count: NSUInteger,
char_range: NSRange,
color: &UIColor,
);
#[cfg(feature = "NSAttributedString")]
#[method(drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)]
pub unsafe fn drawUnderlineForGlyphRange_underlineType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin(
&self,
glyph_range: NSRange,
underline_val: NSUnderlineStyle,
baseline_offset: CGFloat,
line_rect: CGRect,
line_glyph_range: NSRange,
container_origin: CGPoint,
);
#[cfg(feature = "NSAttributedString")]
#[method(underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)]
pub unsafe fn underlineGlyphRange_underlineType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin(
&self,
glyph_range: NSRange,
underline_val: NSUnderlineStyle,
line_rect: CGRect,
line_glyph_range: NSRange,
container_origin: CGPoint,
);
#[cfg(feature = "NSAttributedString")]
#[method(drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)]
pub unsafe fn drawStrikethroughForGlyphRange_strikethroughType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin(
&self,
glyph_range: NSRange,
strikethrough_val: NSUnderlineStyle,
baseline_offset: CGFloat,
line_rect: CGRect,
line_glyph_range: NSRange,
container_origin: CGPoint,
);
#[cfg(feature = "NSAttributedString")]
#[method(strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:)]
pub unsafe fn strikethroughGlyphRange_strikethroughType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin(
&self,
glyph_range: NSRange,
strikethrough_val: NSUnderlineStyle,
line_rect: CGRect,
line_glyph_range: NSRange,
container_origin: CGPoint,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSLayoutManager {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait NSLayoutManagerDelegate: NSObjectProtocol {
#[optional]
#[method(layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)]
unsafe fn layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(
&self,
layout_manager: &NSLayoutManager,
glyph_index: NSUInteger,
rect: CGRect,
) -> CGFloat;
#[optional]
#[method(layoutManager:paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:)]
unsafe fn layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect(
&self,
layout_manager: &NSLayoutManager,
glyph_index: NSUInteger,
rect: CGRect,
) -> CGFloat;
#[optional]
#[method(layoutManager:paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:)]
unsafe fn layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(
&self,
layout_manager: &NSLayoutManager,
glyph_index: NSUInteger,
rect: CGRect,
) -> CGFloat;
#[optional]
#[method(layoutManager:shouldUseAction:forControlCharacterAtIndex:)]
unsafe fn layoutManager_shouldUseAction_forControlCharacterAtIndex(
&self,
layout_manager: &NSLayoutManager,
action: NSControlCharacterAction,
char_index: NSUInteger,
) -> NSControlCharacterAction;
#[optional]
#[method(layoutManager:shouldBreakLineByWordBeforeCharacterAtIndex:)]
unsafe fn layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex(
&self,
layout_manager: &NSLayoutManager,
char_index: NSUInteger,
) -> bool;
#[optional]
#[method(layoutManager:shouldBreakLineByHyphenatingBeforeCharacterAtIndex:)]
unsafe fn layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex(
&self,
layout_manager: &NSLayoutManager,
char_index: NSUInteger,
) -> bool;
#[cfg(feature = "NSTextContainer")]
#[optional]
#[method(layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:)]
unsafe fn layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex(
&self,
layout_manager: &NSLayoutManager,
glyph_index: NSUInteger,
text_container: &NSTextContainer,
proposed_rect: CGRect,
glyph_position: CGPoint,
char_index: NSUInteger,
) -> CGRect;
#[cfg(feature = "NSTextContainer")]
#[optional]
#[method(layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange:)]
unsafe fn layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange(
&self,
layout_manager: &NSLayoutManager,
line_fragment_rect: NonNull<CGRect>,
line_fragment_used_rect: NonNull<CGRect>,
baseline_offset: NonNull<CGFloat>,
text_container: &NSTextContainer,
glyph_range: NSRange,
) -> bool;
#[optional]
#[method(layoutManagerDidInvalidateLayout:)]
unsafe fn layoutManagerDidInvalidateLayout(&self, sender: &NSLayoutManager);
#[cfg(feature = "NSTextContainer")]
#[optional]
#[method(layoutManager:didCompleteLayoutForTextContainer:atEnd:)]
unsafe fn layoutManager_didCompleteLayoutForTextContainer_atEnd(
&self,
layout_manager: &NSLayoutManager,
text_container: Option<&NSTextContainer>,
layout_finished_flag: bool,
);
#[cfg(feature = "NSTextContainer")]
#[optional]
#[method(layoutManager:textContainer:didChangeGeometryFromSize:)]
unsafe fn layoutManager_textContainer_didChangeGeometryFromSize(
&self,
layout_manager: &NSLayoutManager,
text_container: &NSTextContainer,
old_size: CGSize,
);
}
unsafe impl ProtocolType for dyn NSLayoutManagerDelegate {}
);
extern_methods!(
/// NSLayoutManagerDeprecated
unsafe impl NSLayoutManager {
#[deprecated = "Please use usesDefaultHyphenation or -[NSParagraphStyle hyphenationFactor] instead."]
#[method(hyphenationFactor)]
pub unsafe fn hyphenationFactor(&self) -> CGFloat;
#[deprecated = "Please use usesDefaultHyphenation or -[NSParagraphStyle hyphenationFactor] instead."]
#[method(setHyphenationFactor:)]
pub unsafe fn setHyphenationFactor(&self, hyphenation_factor: CGFloat);
}
);

View File

@@ -0,0 +1,388 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLineBreakMode(pub NSInteger);
impl NSLineBreakMode {
pub const NSLineBreakByWordWrapping: Self = Self(0);
pub const NSLineBreakByCharWrapping: Self = Self(1);
pub const NSLineBreakByClipping: Self = Self(2);
pub const NSLineBreakByTruncatingHead: Self = Self(3);
pub const NSLineBreakByTruncatingTail: Self = Self(4);
pub const NSLineBreakByTruncatingMiddle: Self = Self(5);
}
unsafe impl Encode for NSLineBreakMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSLineBreakMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLineBreakStrategy(pub NSUInteger);
bitflags::bitflags! {
impl NSLineBreakStrategy: NSUInteger {
#[doc(alias = "NSLineBreakStrategyNone")]
const None = 0;
#[doc(alias = "NSLineBreakStrategyPushOut")]
const PushOut = 1<<0;
#[doc(alias = "NSLineBreakStrategyHangulWordPriority")]
const HangulWordPriority = 1<<1;
#[doc(alias = "NSLineBreakStrategyStandard")]
const Standard = 0xFFFF;
}
}
unsafe impl Encode for NSLineBreakStrategy {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSLineBreakStrategy {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_TYPED_ENUM
pub type NSTextTabOptionKey = NSString;
extern "C" {
pub static NSTabColumnTerminatorsAttributeName: &'static NSTextTabOptionKey;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextTab;
unsafe impl ClassType for NSTextTab {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextTab {}
unsafe impl NSCopying for NSTextTab {}
unsafe impl NSObjectProtocol for NSTextTab {}
unsafe impl NSSecureCoding for NSTextTab {}
extern_methods!(
unsafe impl NSTextTab {
#[method_id(@__retain_semantics Other columnTerminatorsForLocale:)]
pub unsafe fn columnTerminatorsForLocale(
a_locale: Option<&NSLocale>,
) -> Retained<NSCharacterSet>;
#[cfg(feature = "NSText")]
#[method_id(@__retain_semantics Init initWithTextAlignment:location:options:)]
pub unsafe fn initWithTextAlignment_location_options(
this: Allocated<Self>,
alignment: NSTextAlignment,
loc: CGFloat,
options: &NSDictionary<NSTextTabOptionKey, AnyObject>,
) -> Retained<Self>;
#[cfg(feature = "NSText")]
#[method(alignment)]
pub unsafe fn alignment(&self) -> NSTextAlignment;
#[method(location)]
pub unsafe fn location(&self) -> CGFloat;
#[method_id(@__retain_semantics Other options)]
pub unsafe fn options(&self) -> Retained<NSDictionary<NSTextTabOptionKey, AnyObject>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextTab {
#[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 NSParagraphStyle;
unsafe impl ClassType for NSParagraphStyle {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSParagraphStyle {}
unsafe impl NSCopying for NSParagraphStyle {}
unsafe impl NSMutableCopying for NSParagraphStyle {}
unsafe impl NSObjectProtocol for NSParagraphStyle {}
unsafe impl NSSecureCoding for NSParagraphStyle {}
extern_methods!(
unsafe impl NSParagraphStyle {
#[method_id(@__retain_semantics Other defaultParagraphStyle)]
pub unsafe fn defaultParagraphStyle() -> Retained<NSParagraphStyle>;
#[cfg(feature = "NSText")]
#[method(defaultWritingDirectionForLanguage:)]
pub unsafe fn defaultWritingDirectionForLanguage(
language_name: Option<&NSString>,
) -> NSWritingDirection;
#[method(lineSpacing)]
pub unsafe fn lineSpacing(&self) -> CGFloat;
#[method(paragraphSpacing)]
pub unsafe fn paragraphSpacing(&self) -> CGFloat;
#[cfg(feature = "NSText")]
#[method(alignment)]
pub unsafe fn alignment(&self) -> NSTextAlignment;
#[method(headIndent)]
pub unsafe fn headIndent(&self) -> CGFloat;
#[method(tailIndent)]
pub unsafe fn tailIndent(&self) -> CGFloat;
#[method(firstLineHeadIndent)]
pub unsafe fn firstLineHeadIndent(&self) -> CGFloat;
#[method(minimumLineHeight)]
pub unsafe fn minimumLineHeight(&self) -> CGFloat;
#[method(maximumLineHeight)]
pub unsafe fn maximumLineHeight(&self) -> CGFloat;
#[method(lineBreakMode)]
pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSText")]
#[method(baseWritingDirection)]
pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection;
#[method(lineHeightMultiple)]
pub unsafe fn lineHeightMultiple(&self) -> CGFloat;
#[method(paragraphSpacingBefore)]
pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat;
#[method(hyphenationFactor)]
pub unsafe fn hyphenationFactor(&self) -> c_float;
#[method(usesDefaultHyphenation)]
pub unsafe fn usesDefaultHyphenation(&self) -> bool;
#[method_id(@__retain_semantics Other tabStops)]
pub unsafe fn tabStops(&self) -> Retained<NSArray<NSTextTab>>;
#[method(defaultTabInterval)]
pub unsafe fn defaultTabInterval(&self) -> CGFloat;
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Other textLists)]
pub unsafe fn textLists(&self) -> Retained<NSArray<NSTextList>>;
#[method(allowsDefaultTighteningForTruncation)]
pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool;
#[method(lineBreakStrategy)]
pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSParagraphStyle {
#[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 NSMutableParagraphStyle;
unsafe impl ClassType for NSMutableParagraphStyle {
#[inherits(NSObject)]
type Super = NSParagraphStyle;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSMutableParagraphStyle {}
unsafe impl NSCopying for NSMutableParagraphStyle {}
unsafe impl NSMutableCopying for NSMutableParagraphStyle {}
unsafe impl NSObjectProtocol for NSMutableParagraphStyle {}
unsafe impl NSSecureCoding for NSMutableParagraphStyle {}
extern_methods!(
unsafe impl NSMutableParagraphStyle {
#[method(lineSpacing)]
pub unsafe fn lineSpacing(&self) -> CGFloat;
#[method(setLineSpacing:)]
pub unsafe fn setLineSpacing(&self, line_spacing: CGFloat);
#[method(paragraphSpacing)]
pub unsafe fn paragraphSpacing(&self) -> CGFloat;
#[method(setParagraphSpacing:)]
pub unsafe fn setParagraphSpacing(&self, paragraph_spacing: CGFloat);
#[cfg(feature = "NSText")]
#[method(alignment)]
pub unsafe fn alignment(&self) -> NSTextAlignment;
#[cfg(feature = "NSText")]
#[method(setAlignment:)]
pub unsafe fn setAlignment(&self, alignment: NSTextAlignment);
#[method(firstLineHeadIndent)]
pub unsafe fn firstLineHeadIndent(&self) -> CGFloat;
#[method(setFirstLineHeadIndent:)]
pub unsafe fn setFirstLineHeadIndent(&self, first_line_head_indent: CGFloat);
#[method(headIndent)]
pub unsafe fn headIndent(&self) -> CGFloat;
#[method(setHeadIndent:)]
pub unsafe fn setHeadIndent(&self, head_indent: CGFloat);
#[method(tailIndent)]
pub unsafe fn tailIndent(&self) -> CGFloat;
#[method(setTailIndent:)]
pub unsafe fn setTailIndent(&self, tail_indent: CGFloat);
#[method(lineBreakMode)]
pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
#[method(setLineBreakMode:)]
pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
#[method(minimumLineHeight)]
pub unsafe fn minimumLineHeight(&self) -> CGFloat;
#[method(setMinimumLineHeight:)]
pub unsafe fn setMinimumLineHeight(&self, minimum_line_height: CGFloat);
#[method(maximumLineHeight)]
pub unsafe fn maximumLineHeight(&self) -> CGFloat;
#[method(setMaximumLineHeight:)]
pub unsafe fn setMaximumLineHeight(&self, maximum_line_height: CGFloat);
#[cfg(feature = "NSText")]
#[method(baseWritingDirection)]
pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection;
#[cfg(feature = "NSText")]
#[method(setBaseWritingDirection:)]
pub unsafe fn setBaseWritingDirection(&self, base_writing_direction: NSWritingDirection);
#[method(lineHeightMultiple)]
pub unsafe fn lineHeightMultiple(&self) -> CGFloat;
#[method(setLineHeightMultiple:)]
pub unsafe fn setLineHeightMultiple(&self, line_height_multiple: CGFloat);
#[method(paragraphSpacingBefore)]
pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat;
#[method(setParagraphSpacingBefore:)]
pub unsafe fn setParagraphSpacingBefore(&self, paragraph_spacing_before: CGFloat);
#[method(hyphenationFactor)]
pub unsafe fn hyphenationFactor(&self) -> c_float;
#[method(setHyphenationFactor:)]
pub unsafe fn setHyphenationFactor(&self, hyphenation_factor: c_float);
#[method(usesDefaultHyphenation)]
pub unsafe fn usesDefaultHyphenation(&self) -> bool;
#[method(setUsesDefaultHyphenation:)]
pub unsafe fn setUsesDefaultHyphenation(&self, uses_default_hyphenation: bool);
#[method_id(@__retain_semantics Other tabStops)]
pub unsafe fn tabStops(&self) -> Retained<NSArray<NSTextTab>>;
#[method(setTabStops:)]
pub unsafe fn setTabStops(&self, tab_stops: Option<&NSArray<NSTextTab>>);
#[method(defaultTabInterval)]
pub unsafe fn defaultTabInterval(&self) -> CGFloat;
#[method(setDefaultTabInterval:)]
pub unsafe fn setDefaultTabInterval(&self, default_tab_interval: CGFloat);
#[method(allowsDefaultTighteningForTruncation)]
pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool;
#[method(setAllowsDefaultTighteningForTruncation:)]
pub unsafe fn setAllowsDefaultTighteningForTruncation(
&self,
allows_default_tightening_for_truncation: bool,
);
#[method(lineBreakStrategy)]
pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy;
#[method(setLineBreakStrategy:)]
pub unsafe fn setLineBreakStrategy(&self, line_break_strategy: NSLineBreakStrategy);
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Other textLists)]
pub unsafe fn textLists(&self) -> Retained<NSArray<NSTextList>>;
#[cfg(feature = "NSTextList")]
#[method(setTextLists:)]
pub unsafe fn setTextLists(&self, text_lists: &NSArray<NSTextList>);
#[method(addTabStop:)]
pub unsafe fn addTabStop(&self, an_object: &NSTextTab);
#[method(removeTabStop:)]
pub unsafe fn removeTabStop(&self, an_object: &NSTextTab);
#[method(setParagraphStyle:)]
pub unsafe fn setParagraphStyle(&self, obj: &NSParagraphStyle);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSMutableParagraphStyle {
#[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>;
}
);

View File

@@ -0,0 +1,63 @@
//! 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 NSShadow;
unsafe impl ClassType for NSShadow {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSShadow {}
unsafe impl NSCopying for NSShadow {}
unsafe impl NSObjectProtocol for NSShadow {}
unsafe impl NSSecureCoding for NSShadow {}
extern_methods!(
unsafe impl NSShadow {
#[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(shadowOffset)]
pub unsafe fn shadowOffset(&self) -> CGSize;
#[method(setShadowOffset:)]
pub unsafe fn setShadowOffset(&self, shadow_offset: CGSize);
#[method(shadowBlurRadius)]
pub unsafe fn shadowBlurRadius(&self) -> CGFloat;
#[method(setShadowBlurRadius:)]
pub unsafe fn setShadowBlurRadius(&self, shadow_blur_radius: CGFloat);
#[method_id(@__retain_semantics Other shadowColor)]
pub unsafe fn shadowColor(&self) -> Option<Retained<AnyObject>>;
#[method(setShadowColor:)]
pub unsafe fn setShadowColor(&self, shadow_color: Option<&AnyObject>);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSShadow {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,177 @@
//! 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 NSStringDrawingContext;
unsafe impl ClassType for NSStringDrawingContext {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSStringDrawingContext {}
extern_methods!(
unsafe impl NSStringDrawingContext {
#[method(minimumScaleFactor)]
pub unsafe fn minimumScaleFactor(&self) -> CGFloat;
#[method(setMinimumScaleFactor:)]
pub unsafe fn setMinimumScaleFactor(&self, minimum_scale_factor: CGFloat);
#[method(actualScaleFactor)]
pub unsafe fn actualScaleFactor(&self) -> CGFloat;
#[method(totalBounds)]
pub unsafe fn totalBounds(&self) -> CGRect;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSStringDrawingContext {
#[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_category!(
/// Category on [`NSString`].
pub unsafe trait NSStringDrawing {
#[method(sizeWithAttributes:)]
unsafe fn sizeWithAttributes(
&self,
attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
) -> CGSize;
#[method(drawAtPoint:withAttributes:)]
unsafe fn drawAtPoint_withAttributes(
&self,
point: CGPoint,
attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
);
#[method(drawInRect:withAttributes:)]
unsafe fn drawInRect_withAttributes(
&self,
rect: CGRect,
attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
);
}
unsafe impl NSStringDrawing for NSString {}
);
extern_category!(
/// Category "NSStringDrawing" on [`NSAttributedString`].
#[doc(alias = "NSStringDrawing")]
pub unsafe trait NSAttributedStringNSStringDrawing {
#[method(size)]
unsafe fn size(&self) -> CGSize;
#[method(drawAtPoint:)]
unsafe fn drawAtPoint(&self, point: CGPoint);
#[method(drawInRect:)]
unsafe fn drawInRect(&self, rect: CGRect);
}
unsafe impl NSAttributedStringNSStringDrawing for NSAttributedString {}
);
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSStringDrawingOptions(pub NSInteger);
bitflags::bitflags! {
impl NSStringDrawingOptions: NSInteger {
const NSStringDrawingUsesLineFragmentOrigin = 1<<0;
const NSStringDrawingUsesFontLeading = 1<<1;
const NSStringDrawingUsesDeviceMetrics = 1<<3;
const NSStringDrawingTruncatesLastVisibleLine = 1<<5;
}
}
unsafe impl Encode for NSStringDrawingOptions {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSStringDrawingOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_category!(
/// Category "NSExtendedStringDrawing" on [`NSString`].
#[doc(alias = "NSExtendedStringDrawing")]
pub unsafe trait NSStringNSExtendedStringDrawing {
#[method(drawWithRect:options:attributes:context:)]
unsafe fn drawWithRect_options_attributes_context(
&self,
rect: CGRect,
options: NSStringDrawingOptions,
attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
context: Option<&NSStringDrawingContext>,
);
#[method(boundingRectWithSize:options:attributes:context:)]
unsafe fn boundingRectWithSize_options_attributes_context(
&self,
size: CGSize,
options: NSStringDrawingOptions,
attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
context: Option<&NSStringDrawingContext>,
) -> CGRect;
}
unsafe impl NSStringNSExtendedStringDrawing for NSString {}
);
extern_category!(
/// Category "NSExtendedStringDrawing" on [`NSAttributedString`].
#[doc(alias = "NSExtendedStringDrawing")]
pub unsafe trait NSAttributedStringNSExtendedStringDrawing {
#[method(drawWithRect:options:context:)]
unsafe fn drawWithRect_options_context(
&self,
rect: CGRect,
options: NSStringDrawingOptions,
context: Option<&NSStringDrawingContext>,
);
#[method(boundingRectWithSize:options:context:)]
unsafe fn boundingRectWithSize_options_context(
&self,
size: CGSize,
options: NSStringDrawingOptions,
context: Option<&NSStringDrawingContext>,
) -> CGRect;
}
unsafe impl NSAttributedStringNSExtendedStringDrawing for NSAttributedString {}
);
extern_methods!(
/// NSStringDrawingContextDeprecated
unsafe impl NSStringDrawingContext {
#[deprecated]
#[method(minimumTrackingAdjustment)]
pub unsafe fn minimumTrackingAdjustment(&self) -> CGFloat;
#[deprecated]
#[method(setMinimumTrackingAdjustment:)]
pub unsafe fn setMinimumTrackingAdjustment(&self, minimum_tracking_adjustment: CGFloat);
#[deprecated]
#[method(actualTrackingAdjustment)]
pub unsafe fn actualTrackingAdjustment(&self) -> CGFloat;
}
);

View File

@@ -0,0 +1,26 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWritingDirection(pub NSInteger);
impl NSWritingDirection {
#[doc(alias = "NSWritingDirectionNatural")]
pub const Natural: Self = Self(-1);
#[doc(alias = "NSWritingDirectionLeftToRight")]
pub const LeftToRight: Self = Self(0);
#[doc(alias = "NSWritingDirectionRightToLeft")]
pub const RightToLeft: Self = Self(1);
}
unsafe impl Encode for NSWritingDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSWritingDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

View File

@@ -0,0 +1,269 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub const NSAttachmentCharacter: c_uint = 0xFFFC;
extern_protocol!(
pub unsafe trait NSTextAttachmentContainer: NSObjectProtocol {
#[cfg(all(feature = "NSTextContainer", feature = "UIImage"))]
#[method_id(@__retain_semantics Other imageForBounds:textContainer:characterIndex:)]
unsafe fn imageForBounds_textContainer_characterIndex(
&self,
image_bounds: CGRect,
text_container: Option<&NSTextContainer>,
char_index: NSUInteger,
) -> Option<Retained<UIImage>>;
#[cfg(feature = "NSTextContainer")]
#[method(attachmentBoundsForTextContainer:proposedLineFragment:glyphPosition:characterIndex:)]
unsafe fn attachmentBoundsForTextContainer_proposedLineFragment_glyphPosition_characterIndex(
&self,
text_container: Option<&NSTextContainer>,
line_frag: CGRect,
position: CGPoint,
char_index: NSUInteger,
) -> CGRect;
}
unsafe impl ProtocolType for dyn NSTextAttachmentContainer {}
);
extern_protocol!(
pub unsafe trait NSTextAttachmentLayout: NSObjectProtocol {
#[cfg(all(
feature = "NSTextContainer",
feature = "NSTextRange",
feature = "UIImage"
))]
#[method_id(@__retain_semantics Other imageForBounds:attributes:location:textContainer:)]
unsafe fn imageForBounds_attributes_location_textContainer(
&self,
bounds: CGRect,
attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
location: &ProtocolObject<dyn NSTextLocation>,
text_container: Option<&NSTextContainer>,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "NSTextContainer", feature = "NSTextRange"))]
#[method(attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:)]
unsafe fn attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position(
&self,
attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
location: &ProtocolObject<dyn NSTextLocation>,
text_container: Option<&NSTextContainer>,
proposed_line_fragment: CGRect,
position: CGPoint,
) -> CGRect;
#[cfg(all(
feature = "NSTextContainer",
feature = "NSTextRange",
feature = "UIResponder",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other viewProviderForParentView:location:textContainer:)]
unsafe fn viewProviderForParentView_location_textContainer(
&self,
parent_view: Option<&UIView>,
location: &ProtocolObject<dyn NSTextLocation>,
text_container: Option<&NSTextContainer>,
) -> Option<Retained<NSTextAttachmentViewProvider>>;
}
unsafe impl ProtocolType for dyn NSTextAttachmentLayout {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextAttachment;
unsafe impl ClassType for NSTextAttachment {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextAttachment {}
unsafe impl NSObjectProtocol for NSTextAttachment {}
unsafe impl NSSecureCoding for NSTextAttachment {}
unsafe impl NSTextAttachmentContainer for NSTextAttachment {}
unsafe impl NSTextAttachmentLayout for NSTextAttachment {}
extern_methods!(
unsafe impl NSTextAttachment {
#[method_id(@__retain_semantics Init initWithData:ofType:)]
pub unsafe fn initWithData_ofType(
this: Allocated<Self>,
content_data: Option<&NSData>,
uti: Option<&NSString>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other contents)]
pub unsafe fn contents(&self) -> Option<Retained<NSData>>;
#[method(setContents:)]
pub unsafe fn setContents(&self, contents: Option<&NSData>);
#[method_id(@__retain_semantics Other fileType)]
pub unsafe fn fileType(&self) -> Option<Retained<NSString>>;
#[method(setFileType:)]
pub unsafe fn setFileType(&self, file_type: Option<&NSString>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[method(bounds)]
pub unsafe fn bounds(&self) -> CGRect;
#[method(setBounds:)]
pub unsafe fn setBounds(&self, bounds: CGRect);
#[method_id(@__retain_semantics Other fileWrapper)]
pub unsafe fn fileWrapper(&self) -> Option<Retained<NSFileWrapper>>;
#[method(setFileWrapper:)]
pub unsafe fn setFileWrapper(&self, file_wrapper: Option<&NSFileWrapper>);
#[method(lineLayoutPadding)]
pub unsafe fn lineLayoutPadding(&self) -> CGFloat;
#[method(setLineLayoutPadding:)]
pub unsafe fn setLineLayoutPadding(&self, line_layout_padding: CGFloat);
#[method(textAttachmentViewProviderClassForFileType:)]
pub unsafe fn textAttachmentViewProviderClassForFileType(
file_type: &NSString,
) -> Option<&'static AnyClass>;
#[method(registerTextAttachmentViewProviderClass:forFileType:)]
pub unsafe fn registerTextAttachmentViewProviderClass_forFileType(
text_attachment_view_provider_class: &AnyClass,
file_type: &NSString,
);
#[method(allowsTextAttachmentView)]
pub unsafe fn allowsTextAttachmentView(&self) -> bool;
#[method(setAllowsTextAttachmentView:)]
pub unsafe fn setAllowsTextAttachmentView(&self, allows_text_attachment_view: bool);
#[method(usesTextAttachmentView)]
pub unsafe fn usesTextAttachmentView(&self) -> bool;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextAttachment {
#[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_category!(
/// Category on [`NSAttributedString`].
pub unsafe trait NSAttributedStringAttachmentConveniences {
#[method_id(@__retain_semantics Other attributedStringWithAttachment:)]
unsafe fn attributedStringWithAttachment(
attachment: &NSTextAttachment,
) -> Retained<NSAttributedString>;
}
unsafe impl NSAttributedStringAttachmentConveniences for NSAttributedString {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextAttachmentViewProvider;
unsafe impl ClassType for NSTextAttachmentViewProvider {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextAttachmentViewProvider {}
extern_methods!(
unsafe impl NSTextAttachmentViewProvider {
#[cfg(all(
feature = "NSTextLayoutManager",
feature = "NSTextRange",
feature = "UIResponder",
feature = "UIView"
))]
#[method_id(@__retain_semantics Init initWithTextAttachment:parentView:textLayoutManager:location:)]
pub unsafe fn initWithTextAttachment_parentView_textLayoutManager_location(
this: Allocated<Self>,
text_attachment: &NSTextAttachment,
parent_view: Option<&UIView>,
text_layout_manager: Option<&NSTextLayoutManager>,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Retained<Self>;
#[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>;
#[method_id(@__retain_semantics Other textAttachment)]
pub unsafe fn textAttachment(&self) -> Option<Retained<NSTextAttachment>>;
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other textLayoutManager)]
pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other location)]
pub unsafe fn location(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other view)]
pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method(setView:)]
pub unsafe fn setView(&self, view: Option<&UIView>);
#[method(loadView)]
pub unsafe fn loadView(&self);
#[method(tracksTextAttachmentViewBounds)]
pub unsafe fn tracksTextAttachmentViewBounds(&self) -> bool;
#[method(setTracksTextAttachmentViewBounds:)]
pub unsafe fn setTracksTextAttachmentViewBounds(
&self,
tracks_text_attachment_view_bounds: bool,
);
#[cfg(all(feature = "NSTextContainer", feature = "NSTextRange"))]
#[method(attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:)]
pub unsafe fn attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position(
&self,
attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
location: &ProtocolObject<dyn NSTextLocation>,
text_container: Option<&NSTextContainer>,
proposed_line_fragment: CGRect,
position: CGPoint,
) -> CGRect;
}
);

View File

@@ -0,0 +1,121 @@
//! 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 NSTextContainer;
unsafe impl ClassType for NSTextContainer {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextContainer {}
unsafe impl NSObjectProtocol for NSTextContainer {}
unsafe impl NSSecureCoding for NSTextContainer {}
#[cfg(feature = "NSLayoutManager")]
unsafe impl NSTextLayoutOrientationProvider for NSTextContainer {}
extern_methods!(
unsafe impl NSTextContainer {
#[method_id(@__retain_semantics Init initWithSize:)]
pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "NSLayoutManager")]
#[method_id(@__retain_semantics Other layoutManager)]
pub unsafe fn layoutManager(&self) -> Option<Retained<NSLayoutManager>>;
#[cfg(feature = "NSLayoutManager")]
#[method(setLayoutManager:)]
pub unsafe fn setLayoutManager(&self, layout_manager: Option<&NSLayoutManager>);
#[cfg(feature = "NSLayoutManager")]
#[method(replaceLayoutManager:)]
pub unsafe fn replaceLayoutManager(&self, new_layout_manager: &NSLayoutManager);
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other textLayoutManager)]
pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[method(size)]
pub unsafe fn size(&self) -> CGSize;
#[method(setSize:)]
pub unsafe fn setSize(&self, size: CGSize);
#[cfg(feature = "UIBezierPath")]
#[method_id(@__retain_semantics Other exclusionPaths)]
pub unsafe fn exclusionPaths(&self) -> Retained<NSArray<UIBezierPath>>;
#[cfg(feature = "UIBezierPath")]
#[method(setExclusionPaths:)]
pub unsafe fn setExclusionPaths(&self, exclusion_paths: &NSArray<UIBezierPath>);
#[cfg(feature = "NSParagraphStyle")]
#[method(lineBreakMode)]
pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSParagraphStyle")]
#[method(setLineBreakMode:)]
pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
#[method(lineFragmentPadding)]
pub unsafe fn lineFragmentPadding(&self) -> CGFloat;
#[method(setLineFragmentPadding:)]
pub unsafe fn setLineFragmentPadding(&self, line_fragment_padding: CGFloat);
#[method(maximumNumberOfLines)]
pub unsafe fn maximumNumberOfLines(&self) -> NSUInteger;
#[method(setMaximumNumberOfLines:)]
pub unsafe fn setMaximumNumberOfLines(&self, maximum_number_of_lines: NSUInteger);
#[cfg(feature = "NSText")]
#[method(lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:)]
pub unsafe fn lineFragmentRectForProposedRect_atIndex_writingDirection_remainingRect(
&self,
proposed_rect: CGRect,
character_index: NSUInteger,
base_writing_direction: NSWritingDirection,
remaining_rect: *mut CGRect,
) -> CGRect;
#[method(isSimpleRectangularTextContainer)]
pub unsafe fn isSimpleRectangularTextContainer(&self) -> bool;
#[method(widthTracksTextView)]
pub unsafe fn widthTracksTextView(&self) -> bool;
#[method(setWidthTracksTextView:)]
pub unsafe fn setWidthTracksTextView(&self, width_tracks_text_view: bool);
#[method(heightTracksTextView)]
pub unsafe fn heightTracksTextView(&self) -> bool;
#[method(setHeightTracksTextView:)]
pub unsafe fn setHeightTracksTextView(&self, height_tracks_text_view: bool);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextContainer {
#[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>;
}
);

View File

@@ -0,0 +1,359 @@
//! 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 NSTextContentManagerEnumerationOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextContentManagerEnumerationOptions: NSUInteger {
#[doc(alias = "NSTextContentManagerEnumerationOptionsNone")]
const None = 0;
#[doc(alias = "NSTextContentManagerEnumerationOptionsReverse")]
const Reverse = 1<<0;
}
}
unsafe impl Encode for NSTextContentManagerEnumerationOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextContentManagerEnumerationOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait NSTextElementProvider: NSObjectProtocol {
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other documentRange)]
unsafe fn documentRange(&self) -> Retained<NSTextRange>;
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange", feature = "block2"))]
#[method_id(@__retain_semantics Other enumerateTextElementsFromLocation:options:usingBlock:)]
unsafe fn enumerateTextElementsFromLocation_options_usingBlock(
&self,
text_location: Option<&ProtocolObject<dyn NSTextLocation>>,
options: NSTextContentManagerEnumerationOptions,
block: &block2::Block<dyn Fn(NonNull<NSTextElement>) -> Bool + '_>,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange"))]
#[method(replaceContentsInRange:withTextElements:)]
unsafe fn replaceContentsInRange_withTextElements(
&self,
range: &NSTextRange,
text_elements: Option<&NSArray<NSTextElement>>,
);
#[cfg(feature = "block2")]
#[method(synchronizeToBackingStore:)]
unsafe fn synchronizeToBackingStore(
&self,
completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
);
#[cfg(feature = "NSTextRange")]
#[optional]
#[method_id(@__retain_semantics Other locationFromLocation:withOffset:)]
unsafe fn locationFromLocation_withOffset(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
offset: NSInteger,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(feature = "NSTextRange")]
#[optional]
#[method(offsetFromLocation:toLocation:)]
unsafe fn offsetFromLocation_toLocation(
&self,
from: &ProtocolObject<dyn NSTextLocation>,
to: &ProtocolObject<dyn NSTextLocation>,
) -> NSInteger;
#[cfg(feature = "NSTextRange")]
#[optional]
#[method_id(@__retain_semantics Other adjustedRangeFromRange:forEditingTextSelection:)]
unsafe fn adjustedRangeFromRange_forEditingTextSelection(
&self,
text_range: &NSTextRange,
for_editing_text_selection: bool,
) -> Option<Retained<NSTextRange>>;
}
unsafe impl ProtocolType for dyn NSTextElementProvider {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextContentManager;
unsafe impl ClassType for NSTextContentManager {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextContentManager {}
unsafe impl NSObjectProtocol for NSTextContentManager {}
unsafe impl NSSecureCoding for NSTextContentManager {}
unsafe impl NSTextElementProvider for NSTextContentManager {}
extern_methods!(
unsafe impl NSTextContentManager {
#[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 delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextContentManagerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSTextContentManagerDelegate>>,
);
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other textLayoutManagers)]
pub unsafe fn textLayoutManagers(&self) -> Retained<NSArray<NSTextLayoutManager>>;
#[cfg(feature = "NSTextLayoutManager")]
#[method(addTextLayoutManager:)]
pub unsafe fn addTextLayoutManager(&self, text_layout_manager: &NSTextLayoutManager);
#[cfg(feature = "NSTextLayoutManager")]
#[method(removeTextLayoutManager:)]
pub unsafe fn removeTextLayoutManager(&self, text_layout_manager: &NSTextLayoutManager);
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other primaryTextLayoutManager)]
pub unsafe fn primaryTextLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[cfg(feature = "NSTextLayoutManager")]
#[method(setPrimaryTextLayoutManager:)]
pub unsafe fn setPrimaryTextLayoutManager(
&self,
primary_text_layout_manager: Option<&NSTextLayoutManager>,
);
#[cfg(feature = "block2")]
#[method(synchronizeTextLayoutManagers:)]
pub unsafe fn synchronizeTextLayoutManagers(
&self,
completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
);
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange"))]
#[method_id(@__retain_semantics Other textElementsForRange:)]
pub unsafe fn textElementsForRange(
&self,
range: &NSTextRange,
) -> Retained<NSArray<NSTextElement>>;
#[method(hasEditingTransaction)]
pub unsafe fn hasEditingTransaction(&self) -> bool;
#[cfg(feature = "block2")]
#[method(performEditingTransactionUsingBlock:)]
pub unsafe fn performEditingTransactionUsingBlock(
&self,
transaction: &block2::Block<dyn Fn() + '_>,
);
#[cfg(feature = "NSTextRange")]
#[method(recordEditActionInRange:newTextRange:)]
pub unsafe fn recordEditActionInRange_newTextRange(
&self,
original_text_range: &NSTextRange,
new_text_range: &NSTextRange,
);
#[method(automaticallySynchronizesTextLayoutManagers)]
pub unsafe fn automaticallySynchronizesTextLayoutManagers(&self) -> bool;
#[method(setAutomaticallySynchronizesTextLayoutManagers:)]
pub unsafe fn setAutomaticallySynchronizesTextLayoutManagers(
&self,
automatically_synchronizes_text_layout_managers: bool,
);
#[method(automaticallySynchronizesToBackingStore)]
pub unsafe fn automaticallySynchronizesToBackingStore(&self) -> bool;
#[method(setAutomaticallySynchronizesToBackingStore:)]
pub unsafe fn setAutomaticallySynchronizesToBackingStore(
&self,
automatically_synchronizes_to_backing_store: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextContentManager {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait NSTextContentManagerDelegate: NSObjectProtocol {
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange"))]
#[optional]
#[method_id(@__retain_semantics Other textContentManager:textElementAtLocation:)]
unsafe fn textContentManager_textElementAtLocation(
&self,
text_content_manager: &NSTextContentManager,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Option<Retained<NSTextElement>>;
#[cfg(feature = "NSTextElement")]
#[optional]
#[method(textContentManager:shouldEnumerateTextElement:options:)]
unsafe fn textContentManager_shouldEnumerateTextElement_options(
&self,
text_content_manager: &NSTextContentManager,
text_element: &NSTextElement,
options: NSTextContentManagerEnumerationOptions,
) -> bool;
}
unsafe impl ProtocolType for dyn NSTextContentManagerDelegate {}
);
extern_protocol!(
pub unsafe trait NSTextContentStorageDelegate: NSTextContentManagerDelegate {
#[cfg(feature = "NSTextElement")]
#[optional]
#[method_id(@__retain_semantics Other textContentStorage:textParagraphWithRange:)]
unsafe fn textContentStorage_textParagraphWithRange(
&self,
text_content_storage: &NSTextContentStorage,
range: NSRange,
) -> Option<Retained<NSTextParagraph>>;
}
unsafe impl ProtocolType for dyn NSTextContentStorageDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextContentStorage;
unsafe impl ClassType for NSTextContentStorage {
#[inherits(NSObject)]
type Super = NSTextContentManager;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextContentStorage {}
unsafe impl NSObjectProtocol for NSTextContentStorage {}
unsafe impl NSSecureCoding for NSTextContentStorage {}
unsafe impl NSTextElementProvider for NSTextContentStorage {}
#[cfg(feature = "NSTextStorage")]
unsafe impl NSTextStorageObserving for NSTextContentStorage {}
extern_methods!(
unsafe impl NSTextContentStorage {
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextContentStorageDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSTextContentStorageDelegate>>,
);
#[method_id(@__retain_semantics Other attributedString)]
pub unsafe fn attributedString(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAttributedString:)]
pub unsafe fn setAttributedString(&self, attributed_string: Option<&NSAttributedString>);
#[cfg(feature = "NSTextElement")]
#[method_id(@__retain_semantics Other attributedStringForTextElement:)]
pub unsafe fn attributedStringForTextElement(
&self,
text_element: &NSTextElement,
) -> Option<Retained<NSAttributedString>>;
#[cfg(feature = "NSTextElement")]
#[method_id(@__retain_semantics Other textElementForAttributedString:)]
pub unsafe fn textElementForAttributedString(
&self,
attributed_string: &NSAttributedString,
) -> Option<Retained<NSTextElement>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other locationFromLocation:withOffset:)]
pub unsafe fn locationFromLocation_withOffset(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
offset: NSInteger,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(feature = "NSTextRange")]
#[method(offsetFromLocation:toLocation:)]
pub unsafe fn offsetFromLocation_toLocation(
&self,
from: &ProtocolObject<dyn NSTextLocation>,
to: &ProtocolObject<dyn NSTextLocation>,
) -> NSInteger;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other adjustedRangeFromRange:forEditingTextSelection:)]
pub unsafe fn adjustedRangeFromRange_forEditingTextSelection(
&self,
text_range: &NSTextRange,
for_editing_text_selection: bool,
) -> Option<Retained<NSTextRange>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSTextContentManager`
unsafe impl NSTextContentStorage {
#[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>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextContentStorage {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern "C" {
pub static NSTextContentStorageUnsupportedAttributeAddedNotification:
&'static NSNotificationName;
}

View File

@@ -0,0 +1,125 @@
//! 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 NSTextElement;
unsafe impl ClassType for NSTextElement {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextElement {}
extern_methods!(
unsafe impl NSTextElement {
#[cfg(feature = "NSTextContentManager")]
#[method_id(@__retain_semantics Init initWithTextContentManager:)]
pub unsafe fn initWithTextContentManager(
this: Allocated<Self>,
text_content_manager: Option<&NSTextContentManager>,
) -> Retained<Self>;
#[cfg(feature = "NSTextContentManager")]
#[method_id(@__retain_semantics Other textContentManager)]
pub unsafe fn textContentManager(&self) -> Option<Retained<NSTextContentManager>>;
#[cfg(feature = "NSTextContentManager")]
#[method(setTextContentManager:)]
pub unsafe fn setTextContentManager(
&self,
text_content_manager: Option<&NSTextContentManager>,
);
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other elementRange)]
pub unsafe fn elementRange(&self) -> Option<Retained<NSTextRange>>;
#[cfg(feature = "NSTextRange")]
#[method(setElementRange:)]
pub unsafe fn setElementRange(&self, element_range: Option<&NSTextRange>);
#[method_id(@__retain_semantics Other childElements)]
pub unsafe fn childElements(&self) -> Retained<NSArray<NSTextElement>>;
#[method_id(@__retain_semantics Other parentElement)]
pub unsafe fn parentElement(&self) -> Option<Retained<NSTextElement>>;
#[method(isRepresentedElement)]
pub unsafe fn isRepresentedElement(&self) -> bool;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextElement {
#[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 NSTextParagraph;
unsafe impl ClassType for NSTextParagraph {
#[inherits(NSObject)]
type Super = NSTextElement;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextParagraph {}
extern_methods!(
unsafe impl NSTextParagraph {
#[method_id(@__retain_semantics Init initWithAttributedString:)]
pub unsafe fn initWithAttributedString(
this: Allocated<Self>,
attributed_string: Option<&NSAttributedString>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other attributedString)]
pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other paragraphContentRange)]
pub unsafe fn paragraphContentRange(&self) -> Option<Retained<NSTextRange>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other paragraphSeparatorRange)]
pub unsafe fn paragraphSeparatorRange(&self) -> Option<Retained<NSTextRange>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSTextElement`
unsafe impl NSTextParagraph {
#[cfg(feature = "NSTextContentManager")]
#[method_id(@__retain_semantics Init initWithTextContentManager:)]
pub unsafe fn initWithTextContentManager(
this: Allocated<Self>,
text_content_manager: Option<&NSTextContentManager>,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextParagraph {
#[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>;
}
);

View File

@@ -0,0 +1,176 @@
//! 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 NSTextLayoutFragmentEnumerationOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextLayoutFragmentEnumerationOptions: NSUInteger {
#[doc(alias = "NSTextLayoutFragmentEnumerationOptionsNone")]
const None = 0;
#[doc(alias = "NSTextLayoutFragmentEnumerationOptionsReverse")]
const Reverse = 1<<0;
#[doc(alias = "NSTextLayoutFragmentEnumerationOptionsEstimatesSize")]
const EstimatesSize = 1<<1;
#[doc(alias = "NSTextLayoutFragmentEnumerationOptionsEnsuresLayout")]
const EnsuresLayout = 1<<2;
#[doc(alias = "NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment")]
const EnsuresExtraLineFragment = 1<<3;
}
}
unsafe impl Encode for NSTextLayoutFragmentEnumerationOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextLayoutFragmentEnumerationOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextLayoutFragmentState(pub NSUInteger);
impl NSTextLayoutFragmentState {
#[doc(alias = "NSTextLayoutFragmentStateNone")]
pub const None: Self = Self(0);
#[doc(alias = "NSTextLayoutFragmentStateEstimatedUsageBounds")]
pub const EstimatedUsageBounds: Self = Self(1);
#[doc(alias = "NSTextLayoutFragmentStateCalculatedUsageBounds")]
pub const CalculatedUsageBounds: Self = Self(2);
#[doc(alias = "NSTextLayoutFragmentStateLayoutAvailable")]
pub const LayoutAvailable: Self = Self(3);
}
unsafe impl Encode for NSTextLayoutFragmentState {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextLayoutFragmentState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextLayoutFragment;
unsafe impl ClassType for NSTextLayoutFragment {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextLayoutFragment {}
unsafe impl NSObjectProtocol for NSTextLayoutFragment {}
unsafe impl NSSecureCoding for NSTextLayoutFragment {}
extern_methods!(
unsafe impl NSTextLayoutFragment {
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange"))]
#[method_id(@__retain_semantics Init initWithTextElement:range:)]
pub unsafe fn initWithTextElement_range(
this: Allocated<Self>,
text_element: &NSTextElement,
range_in_element: Option<&NSTextRange>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other textLayoutManager)]
pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[cfg(feature = "NSTextElement")]
#[method_id(@__retain_semantics Other textElement)]
pub unsafe fn textElement(&self) -> Option<Retained<NSTextElement>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other rangeInElement)]
pub unsafe fn rangeInElement(&self) -> Retained<NSTextRange>;
#[cfg(feature = "NSTextLineFragment")]
#[method_id(@__retain_semantics Other textLineFragments)]
pub unsafe fn textLineFragments(&self) -> Retained<NSArray<NSTextLineFragment>>;
#[cfg(feature = "NSTextLineFragment")]
#[method_id(@__retain_semantics Other textLineFragmentForVerticalOffset:requiresExactMatch:)]
pub unsafe fn textLineFragmentForVerticalOffset_requiresExactMatch(
&self,
vertical_offset: CGFloat,
requires_exact_match: bool,
) -> Option<Retained<NSTextLineFragment>>;
#[cfg(all(feature = "NSTextLineFragment", feature = "NSTextRange"))]
#[method_id(@__retain_semantics Other textLineFragmentForTextLocation:isUpstreamAffinity:)]
pub unsafe fn textLineFragmentForTextLocation_isUpstreamAffinity(
&self,
text_location: &ProtocolObject<dyn NSTextLocation>,
is_upstream_affinity: bool,
) -> Option<Retained<NSTextLineFragment>>;
#[method_id(@__retain_semantics Other layoutQueue)]
pub unsafe fn layoutQueue(&self) -> Option<Retained<NSOperationQueue>>;
#[method(setLayoutQueue:)]
pub unsafe fn setLayoutQueue(&self, layout_queue: Option<&NSOperationQueue>);
#[method(state)]
pub unsafe fn state(&self) -> NSTextLayoutFragmentState;
#[method(invalidateLayout)]
pub unsafe fn invalidateLayout(&self);
#[method(layoutFragmentFrame)]
pub unsafe fn layoutFragmentFrame(&self) -> CGRect;
#[method(renderingSurfaceBounds)]
pub unsafe fn renderingSurfaceBounds(&self) -> CGRect;
#[method(leadingPadding)]
pub unsafe fn leadingPadding(&self) -> CGFloat;
#[method(trailingPadding)]
pub unsafe fn trailingPadding(&self) -> CGFloat;
#[method(topMargin)]
pub unsafe fn topMargin(&self) -> CGFloat;
#[method(bottomMargin)]
pub unsafe fn bottomMargin(&self) -> CGFloat;
#[cfg(feature = "NSTextAttachment")]
#[method_id(@__retain_semantics Other textAttachmentViewProviders)]
pub unsafe fn textAttachmentViewProviders(
&self,
) -> Retained<NSArray<NSTextAttachmentViewProvider>>;
#[cfg(feature = "NSTextRange")]
#[method(frameForTextAttachmentAtLocation:)]
pub unsafe fn frameForTextAttachmentAtLocation(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> CGRect;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextLayoutFragment {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,361 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextLayoutManagerSegmentType(pub NSInteger);
impl NSTextLayoutManagerSegmentType {
#[doc(alias = "NSTextLayoutManagerSegmentTypeStandard")]
pub const Standard: Self = Self(0);
#[doc(alias = "NSTextLayoutManagerSegmentTypeSelection")]
pub const Selection: Self = Self(1);
#[doc(alias = "NSTextLayoutManagerSegmentTypeHighlight")]
pub const Highlight: Self = Self(2);
}
unsafe impl Encode for NSTextLayoutManagerSegmentType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextLayoutManagerSegmentType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextLayoutManagerSegmentOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextLayoutManagerSegmentOptions: NSUInteger {
#[doc(alias = "NSTextLayoutManagerSegmentOptionsNone")]
const None = 0;
#[doc(alias = "NSTextLayoutManagerSegmentOptionsRangeNotRequired")]
const RangeNotRequired = 1<<0;
#[doc(alias = "NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded")]
const MiddleFragmentsExcluded = 1<<1;
#[doc(alias = "NSTextLayoutManagerSegmentOptionsHeadSegmentExtended")]
const HeadSegmentExtended = 1<<2;
#[doc(alias = "NSTextLayoutManagerSegmentOptionsTailSegmentExtended")]
const TailSegmentExtended = 1<<3;
#[doc(alias = "NSTextLayoutManagerSegmentOptionsUpstreamAffinity")]
const UpstreamAffinity = 1<<4;
}
}
unsafe impl Encode for NSTextLayoutManagerSegmentOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextLayoutManagerSegmentOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextLayoutManager;
unsafe impl ClassType for NSTextLayoutManager {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextLayoutManager {}
unsafe impl NSObjectProtocol for NSTextLayoutManager {}
unsafe impl NSSecureCoding for NSTextLayoutManager {}
#[cfg(feature = "NSTextSelectionNavigation")]
unsafe impl NSTextSelectionDataSource for NSTextLayoutManager {}
extern_methods!(
unsafe impl NSTextLayoutManager {
#[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 delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextLayoutManagerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSTextLayoutManagerDelegate>>,
);
#[method(usesFontLeading)]
pub unsafe fn usesFontLeading(&self) -> bool;
#[method(setUsesFontLeading:)]
pub unsafe fn setUsesFontLeading(&self, uses_font_leading: bool);
#[method(limitsLayoutForSuspiciousContents)]
pub unsafe fn limitsLayoutForSuspiciousContents(&self) -> bool;
#[method(setLimitsLayoutForSuspiciousContents:)]
pub unsafe fn setLimitsLayoutForSuspiciousContents(
&self,
limits_layout_for_suspicious_contents: bool,
);
#[method(usesHyphenation)]
pub unsafe fn usesHyphenation(&self) -> bool;
#[method(setUsesHyphenation:)]
pub unsafe fn setUsesHyphenation(&self, uses_hyphenation: bool);
#[cfg(feature = "NSTextContentManager")]
#[method_id(@__retain_semantics Other textContentManager)]
pub unsafe fn textContentManager(&self) -> Option<Retained<NSTextContentManager>>;
#[cfg(feature = "NSTextContentManager")]
#[method(replaceTextContentManager:)]
pub unsafe fn replaceTextContentManager(&self, text_content_manager: &NSTextContentManager);
#[cfg(feature = "NSTextContainer")]
#[method_id(@__retain_semantics Other textContainer)]
pub unsafe fn textContainer(&self) -> Option<Retained<NSTextContainer>>;
#[cfg(feature = "NSTextContainer")]
#[method(setTextContainer:)]
pub unsafe fn setTextContainer(&self, text_container: Option<&NSTextContainer>);
#[method(usageBoundsForTextContainer)]
pub unsafe fn usageBoundsForTextContainer(&self) -> CGRect;
#[cfg(feature = "NSTextViewportLayoutController")]
#[method_id(@__retain_semantics Other textViewportLayoutController)]
pub unsafe fn textViewportLayoutController(
&self,
) -> Retained<NSTextViewportLayoutController>;
#[method_id(@__retain_semantics Other layoutQueue)]
pub unsafe fn layoutQueue(&self) -> Option<Retained<NSOperationQueue>>;
#[method(setLayoutQueue:)]
pub unsafe fn setLayoutQueue(&self, layout_queue: Option<&NSOperationQueue>);
#[cfg(feature = "NSTextRange")]
#[method(ensureLayoutForRange:)]
pub unsafe fn ensureLayoutForRange(&self, range: &NSTextRange);
#[method(ensureLayoutForBounds:)]
pub unsafe fn ensureLayoutForBounds(&self, bounds: CGRect);
#[cfg(feature = "NSTextRange")]
#[method(invalidateLayoutForRange:)]
pub unsafe fn invalidateLayoutForRange(&self, range: &NSTextRange);
#[cfg(feature = "NSTextLayoutFragment")]
#[method_id(@__retain_semantics Other textLayoutFragmentForPosition:)]
pub unsafe fn textLayoutFragmentForPosition(
&self,
position: CGPoint,
) -> Option<Retained<NSTextLayoutFragment>>;
#[cfg(all(feature = "NSTextLayoutFragment", feature = "NSTextRange"))]
#[method_id(@__retain_semantics Other textLayoutFragmentForLocation:)]
pub unsafe fn textLayoutFragmentForLocation(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Option<Retained<NSTextLayoutFragment>>;
#[cfg(all(
feature = "NSTextLayoutFragment",
feature = "NSTextRange",
feature = "block2"
))]
#[method_id(@__retain_semantics Other enumerateTextLayoutFragmentsFromLocation:options:usingBlock:)]
pub unsafe fn enumerateTextLayoutFragmentsFromLocation_options_usingBlock(
&self,
location: Option<&ProtocolObject<dyn NSTextLocation>>,
options: NSTextLayoutFragmentEnumerationOptions,
block: &block2::Block<dyn Fn(NonNull<NSTextLayoutFragment>) -> Bool + '_>,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(feature = "NSTextSelection")]
#[method_id(@__retain_semantics Other textSelections)]
pub unsafe fn textSelections(&self) -> Retained<NSArray<NSTextSelection>>;
#[cfg(feature = "NSTextSelection")]
#[method(setTextSelections:)]
pub unsafe fn setTextSelections(&self, text_selections: &NSArray<NSTextSelection>);
#[cfg(feature = "NSTextSelectionNavigation")]
#[method_id(@__retain_semantics Other textSelectionNavigation)]
pub unsafe fn textSelectionNavigation(&self) -> Retained<NSTextSelectionNavigation>;
#[cfg(feature = "NSTextSelectionNavigation")]
#[method(setTextSelectionNavigation:)]
pub unsafe fn setTextSelectionNavigation(
&self,
text_selection_navigation: &NSTextSelectionNavigation,
);
#[cfg(all(feature = "NSTextRange", feature = "block2"))]
#[method(enumerateRenderingAttributesFromLocation:reverse:usingBlock:)]
pub unsafe fn enumerateRenderingAttributesFromLocation_reverse_usingBlock(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
reverse: bool,
block: &block2::Block<
dyn Fn(
NonNull<NSTextLayoutManager>,
NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
NonNull<NSTextRange>,
) -> Bool
+ '_,
>,
);
#[cfg(feature = "NSTextRange")]
#[method(setRenderingAttributes:forTextRange:)]
pub unsafe fn setRenderingAttributes_forTextRange(
&self,
rendering_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
text_range: &NSTextRange,
);
#[cfg(feature = "NSTextRange")]
#[method(addRenderingAttribute:value:forTextRange:)]
pub unsafe fn addRenderingAttribute_value_forTextRange(
&self,
rendering_attribute: &NSAttributedStringKey,
value: Option<&AnyObject>,
text_range: &NSTextRange,
);
#[cfg(feature = "NSTextRange")]
#[method(removeRenderingAttribute:forTextRange:)]
pub unsafe fn removeRenderingAttribute_forTextRange(
&self,
rendering_attribute: &NSAttributedStringKey,
text_range: &NSTextRange,
);
#[cfg(feature = "NSTextRange")]
#[method(invalidateRenderingAttributesForTextRange:)]
pub unsafe fn invalidateRenderingAttributesForTextRange(&self, text_range: &NSTextRange);
#[cfg(all(feature = "NSTextLayoutFragment", feature = "block2"))]
#[method(renderingAttributesValidator)]
pub unsafe fn renderingAttributesValidator(
&self,
) -> *mut block2::Block<dyn Fn(NonNull<NSTextLayoutManager>, NonNull<NSTextLayoutFragment>)>;
#[cfg(all(feature = "NSTextLayoutFragment", feature = "block2"))]
#[method(setRenderingAttributesValidator:)]
pub unsafe fn setRenderingAttributesValidator(
&self,
rendering_attributes_validator: Option<
&block2::Block<dyn Fn(NonNull<NSTextLayoutManager>, NonNull<NSTextLayoutFragment>)>,
>,
);
#[method_id(@__retain_semantics Other linkRenderingAttributes)]
pub unsafe fn linkRenderingAttributes(
) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other renderingAttributesForLink:atLocation:)]
pub unsafe fn renderingAttributesForLink_atLocation(
&self,
link: &AnyObject,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
#[cfg(all(
feature = "NSTextContainer",
feature = "NSTextRange",
feature = "block2"
))]
#[method(enumerateTextSegmentsInRange:type:options:usingBlock:)]
pub unsafe fn enumerateTextSegmentsInRange_type_options_usingBlock(
&self,
text_range: &NSTextRange,
r#type: NSTextLayoutManagerSegmentType,
options: NSTextLayoutManagerSegmentOptions,
block: &block2::Block<
dyn Fn(*mut NSTextRange, CGRect, CGFloat, NonNull<NSTextContainer>) -> Bool + '_,
>,
);
#[cfg(all(feature = "NSTextElement", feature = "NSTextRange"))]
#[method(replaceContentsInRange:withTextElements:)]
pub unsafe fn replaceContentsInRange_withTextElements(
&self,
range: &NSTextRange,
text_elements: &NSArray<NSTextElement>,
);
#[cfg(feature = "NSTextRange")]
#[method(replaceContentsInRange:withAttributedString:)]
pub unsafe fn replaceContentsInRange_withAttributedString(
&self,
range: &NSTextRange,
attributed_string: &NSAttributedString,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextLayoutManager {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait NSTextLayoutManagerDelegate: NSObjectProtocol {
#[cfg(all(
feature = "NSTextElement",
feature = "NSTextLayoutFragment",
feature = "NSTextRange"
))]
#[optional]
#[method_id(@__retain_semantics Other textLayoutManager:textLayoutFragmentForLocation:inTextElement:)]
unsafe fn textLayoutManager_textLayoutFragmentForLocation_inTextElement(
&self,
text_layout_manager: &NSTextLayoutManager,
location: &ProtocolObject<dyn NSTextLocation>,
text_element: &NSTextElement,
) -> Retained<NSTextLayoutFragment>;
#[cfg(feature = "NSTextRange")]
#[optional]
#[method(textLayoutManager:shouldBreakLineBeforeLocation:hyphenating:)]
unsafe fn textLayoutManager_shouldBreakLineBeforeLocation_hyphenating(
&self,
text_layout_manager: &NSTextLayoutManager,
location: &ProtocolObject<dyn NSTextLocation>,
hyphenating: bool,
) -> bool;
#[cfg(feature = "NSTextRange")]
#[optional]
#[method_id(@__retain_semantics Other textLayoutManager:renderingAttributesForLink:atLocation:defaultAttributes:)]
unsafe fn textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes(
&self,
text_layout_manager: &NSTextLayoutManager,
link: &AnyObject,
location: &ProtocolObject<dyn NSTextLocation>,
rendering_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
}
unsafe impl ProtocolType for dyn NSTextLayoutManagerDelegate {}
);

View File

@@ -0,0 +1,79 @@
//! 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 NSTextLineFragment;
unsafe impl ClassType for NSTextLineFragment {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextLineFragment {}
unsafe impl NSObjectProtocol for NSTextLineFragment {}
unsafe impl NSSecureCoding for NSTextLineFragment {}
extern_methods!(
unsafe impl NSTextLineFragment {
#[method_id(@__retain_semantics Init initWithAttributedString:range:)]
pub unsafe fn initWithAttributedString_range(
this: Allocated<Self>,
attributed_string: &NSAttributedString,
range: NSRange,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
a_decoder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init initWithString:attributes:range:)]
pub unsafe fn initWithString_attributes_range(
this: Allocated<Self>,
string: &NSString,
attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
range: NSRange,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Other attributedString)]
pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
#[method(characterRange)]
pub unsafe fn characterRange(&self) -> NSRange;
#[method(typographicBounds)]
pub unsafe fn typographicBounds(&self) -> CGRect;
#[method(glyphOrigin)]
pub unsafe fn glyphOrigin(&self) -> CGPoint;
#[method(locationForCharacterAtIndex:)]
pub unsafe fn locationForCharacterAtIndex(&self, index: NSInteger) -> CGPoint;
#[method(characterIndexForPoint:)]
pub unsafe fn characterIndexForPoint(&self, point: CGPoint) -> NSInteger;
#[method(fractionOfDistanceThroughGlyphForPoint:)]
pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: CGPoint) -> CGFloat;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextLineFragment {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,167 @@
//! 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 NSTextListOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextListOptions: NSUInteger {
const NSTextListPrependEnclosingMarker = 1<<0;
}
}
unsafe impl Encode for NSTextListOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextListOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTextListMarkerFormat = NSString;
extern "C" {
pub static NSTextListMarkerBox: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerCheck: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerCircle: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDiamond: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDisc: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerHyphen: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerSquare: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerOctal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDecimal: &'static NSTextListMarkerFormat;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextList;
unsafe impl ClassType for NSTextList {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextList {}
unsafe impl NSCopying for NSTextList {}
unsafe impl NSObjectProtocol for NSTextList {}
unsafe impl NSSecureCoding for NSTextList {}
extern_methods!(
unsafe impl NSTextList {
#[method_id(@__retain_semantics Init initWithMarkerFormat:options:startingItemNumber:)]
pub unsafe fn initWithMarkerFormat_options_startingItemNumber(
this: Allocated<Self>,
marker_format: &NSTextListMarkerFormat,
options: NSTextListOptions,
starting_item_number: NSInteger,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithMarkerFormat:options:)]
pub unsafe fn initWithMarkerFormat_options(
this: Allocated<Self>,
marker_format: &NSTextListMarkerFormat,
options: NSUInteger,
) -> 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 markerFormat)]
pub unsafe fn markerFormat(&self) -> Retained<NSTextListMarkerFormat>;
#[method(listOptions)]
pub unsafe fn listOptions(&self) -> NSTextListOptions;
#[method(startingItemNumber)]
pub unsafe fn startingItemNumber(&self) -> NSInteger;
#[method(setStartingItemNumber:)]
pub unsafe fn setStartingItemNumber(&self, starting_item_number: NSInteger);
#[method(isOrdered)]
pub unsafe fn isOrdered(&self) -> bool;
#[method_id(@__retain_semantics Other markerForItemNumber:)]
pub unsafe fn markerForItemNumber(&self, item_number: NSInteger) -> Retained<NSString>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextList {
#[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>;
}
);

View File

@@ -0,0 +1,107 @@
//! 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)]
#[cfg(feature = "NSTextElement")]
pub struct NSTextListElement;
#[cfg(feature = "NSTextElement")]
unsafe impl ClassType for NSTextListElement {
#[inherits(NSTextElement, NSObject)]
type Super = NSTextParagraph;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "NSTextElement")]
unsafe impl NSObjectProtocol for NSTextListElement {}
extern_methods!(
#[cfg(feature = "NSTextElement")]
unsafe impl NSTextListElement {
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Init initWithParentElement:textList:contents:markerAttributes:childElements:)]
pub unsafe fn initWithParentElement_textList_contents_markerAttributes_childElements(
this: Allocated<Self>,
parent: Option<&NSTextListElement>,
text_list: &NSTextList,
contents: Option<&NSAttributedString>,
marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
children: Option<&NSArray<NSTextListElement>>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithAttributedString:)]
pub unsafe fn initWithAttributedString(
this: Allocated<Self>,
attributed_string: Option<&NSAttributedString>,
) -> Retained<Self>;
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Other textListElementWithContents:markerAttributes:textList:childElements:)]
pub unsafe fn textListElementWithContents_markerAttributes_textList_childElements(
contents: &NSAttributedString,
marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
text_list: &NSTextList,
children: Option<&NSArray<NSTextListElement>>,
) -> Retained<Self>;
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Other textListElementWithChildElements:textList:nestingLevel:)]
pub unsafe fn textListElementWithChildElements_textList_nestingLevel(
children: &NSArray<NSTextListElement>,
text_list: &NSTextList,
nesting_level: NSInteger,
) -> Option<Retained<Self>>;
#[cfg(feature = "NSTextList")]
#[method_id(@__retain_semantics Other textList)]
pub unsafe fn textList(&self) -> Retained<NSTextList>;
#[method_id(@__retain_semantics Other contents)]
pub unsafe fn contents(&self) -> Option<Retained<NSAttributedString>>;
#[method_id(@__retain_semantics Other markerAttributes)]
pub unsafe fn markerAttributes(
&self,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
#[method_id(@__retain_semantics Other attributedString)]
pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
#[method_id(@__retain_semantics Other childElements)]
pub unsafe fn childElements(&self) -> Retained<NSArray<NSTextListElement>>;
#[method_id(@__retain_semantics Other parentElement)]
pub unsafe fn parentElement(&self) -> Option<Retained<NSTextListElement>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSTextElement`
#[cfg(feature = "NSTextElement")]
unsafe impl NSTextListElement {
#[cfg(feature = "NSTextContentManager")]
#[method_id(@__retain_semantics Init initWithTextContentManager:)]
pub unsafe fn initWithTextContentManager(
this: Allocated<Self>,
text_content_manager: Option<&NSTextContentManager>,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "NSTextElement")]
unsafe impl NSTextListElement {
#[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>;
}
);

View File

@@ -0,0 +1,89 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait NSTextLocation: NSObjectProtocol {
#[method(compare:)]
unsafe fn compare(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> NSComparisonResult;
}
unsafe impl ProtocolType for dyn NSTextLocation {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextRange;
unsafe impl ClassType for NSTextRange {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextRange {}
extern_methods!(
unsafe impl NSTextRange {
#[method_id(@__retain_semantics Init initWithLocation:endLocation:)]
pub unsafe fn initWithLocation_endLocation(
this: Allocated<Self>,
location: &ProtocolObject<dyn NSTextLocation>,
end_location: Option<&ProtocolObject<dyn NSTextLocation>>,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init initWithLocation:)]
pub unsafe fn initWithLocation(
this: Allocated<Self>,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Retained<Self>;
#[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>;
#[method(isEmpty)]
pub unsafe fn isEmpty(&self) -> bool;
#[method_id(@__retain_semantics Other location)]
pub unsafe fn location(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
#[method_id(@__retain_semantics Other endLocation)]
pub unsafe fn endLocation(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
#[method(isEqualToTextRange:)]
pub unsafe fn isEqualToTextRange(&self, text_range: &NSTextRange) -> bool;
#[method(containsLocation:)]
pub unsafe fn containsLocation(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> bool;
#[method(containsRange:)]
pub unsafe fn containsRange(&self, text_range: &NSTextRange) -> bool;
#[method(intersectsWithTextRange:)]
pub unsafe fn intersectsWithTextRange(&self, text_range: &NSTextRange) -> bool;
#[method_id(@__retain_semantics Other textRangeByIntersectingWithTextRange:)]
pub unsafe fn textRangeByIntersectingWithTextRange(
&self,
text_range: &NSTextRange,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Other textRangeByFormingUnionWithTextRange:)]
pub unsafe fn textRangeByFormingUnionWithTextRange(
&self,
text_range: &NSTextRange,
) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,169 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionGranularity(pub NSInteger);
impl NSTextSelectionGranularity {
#[doc(alias = "NSTextSelectionGranularityCharacter")]
pub const Character: Self = Self(0);
#[doc(alias = "NSTextSelectionGranularityWord")]
pub const Word: Self = Self(1);
#[doc(alias = "NSTextSelectionGranularityParagraph")]
pub const Paragraph: Self = Self(2);
#[doc(alias = "NSTextSelectionGranularityLine")]
pub const Line: Self = Self(3);
#[doc(alias = "NSTextSelectionGranularitySentence")]
pub const Sentence: Self = Self(4);
}
unsafe impl Encode for NSTextSelectionGranularity {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionGranularity {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionAffinity(pub NSInteger);
impl NSTextSelectionAffinity {
#[doc(alias = "NSTextSelectionAffinityUpstream")]
pub const Upstream: Self = Self(0);
#[doc(alias = "NSTextSelectionAffinityDownstream")]
pub const Downstream: Self = Self(1);
}
unsafe impl Encode for NSTextSelectionAffinity {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionAffinity {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextSelection;
unsafe impl ClassType for NSTextSelection {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for NSTextSelection {}
unsafe impl NSObjectProtocol for NSTextSelection {}
unsafe impl NSSecureCoding for NSTextSelection {}
extern_methods!(
unsafe impl NSTextSelection {
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Init initWithRanges:affinity:granularity:)]
pub unsafe fn initWithRanges_affinity_granularity(
this: Allocated<Self>,
text_ranges: &NSArray<NSTextRange>,
affinity: NSTextSelectionAffinity,
granularity: NSTextSelectionGranularity,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Init initWithRange:affinity:granularity:)]
pub unsafe fn initWithRange_affinity_granularity(
this: Allocated<Self>,
range: &NSTextRange,
affinity: NSTextSelectionAffinity,
granularity: NSTextSelectionGranularity,
) -> Retained<Self>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Init initWithLocation:affinity:)]
pub unsafe fn initWithLocation_affinity(
this: Allocated<Self>,
location: &ProtocolObject<dyn NSTextLocation>,
affinity: NSTextSelectionAffinity,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other textRanges)]
pub unsafe fn textRanges(&self) -> Retained<NSArray<NSTextRange>>;
#[method(granularity)]
pub unsafe fn granularity(&self) -> NSTextSelectionGranularity;
#[method(affinity)]
pub unsafe fn affinity(&self) -> NSTextSelectionAffinity;
#[method(isTransient)]
pub unsafe fn isTransient(&self) -> bool;
#[method(anchorPositionOffset)]
pub unsafe fn anchorPositionOffset(&self) -> CGFloat;
#[method(setAnchorPositionOffset:)]
pub unsafe fn setAnchorPositionOffset(&self, anchor_position_offset: CGFloat);
#[method(isLogical)]
pub unsafe fn isLogical(&self) -> bool;
#[method(setLogical:)]
pub unsafe fn setLogical(&self, logical: bool);
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other secondarySelectionLocation)]
pub unsafe fn secondarySelectionLocation(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(feature = "NSTextRange")]
#[method(setSecondarySelectionLocation:)]
pub unsafe fn setSecondarySelectionLocation(
&self,
secondary_selection_location: Option<&ProtocolObject<dyn NSTextLocation>>,
);
#[method_id(@__retain_semantics Other typingAttributes)]
pub unsafe fn typingAttributes(
&self,
) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
#[method(setTypingAttributes:)]
pub unsafe fn setTypingAttributes(
&self,
typing_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
);
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other textSelectionWithTextRanges:)]
pub unsafe fn textSelectionWithTextRanges(
&self,
text_ranges: &NSArray<NSTextRange>,
) -> Retained<NSTextSelection>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextSelection {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,323 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionNavigationDirection(pub NSInteger);
impl NSTextSelectionNavigationDirection {
#[doc(alias = "NSTextSelectionNavigationDirectionForward")]
pub const Forward: Self = Self(0);
#[doc(alias = "NSTextSelectionNavigationDirectionBackward")]
pub const Backward: Self = Self(1);
#[doc(alias = "NSTextSelectionNavigationDirectionRight")]
pub const Right: Self = Self(2);
#[doc(alias = "NSTextSelectionNavigationDirectionLeft")]
pub const Left: Self = Self(3);
#[doc(alias = "NSTextSelectionNavigationDirectionUp")]
pub const Up: Self = Self(4);
#[doc(alias = "NSTextSelectionNavigationDirectionDown")]
pub const Down: Self = Self(5);
}
unsafe impl Encode for NSTextSelectionNavigationDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionNavigationDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionNavigationDestination(pub NSInteger);
impl NSTextSelectionNavigationDestination {
#[doc(alias = "NSTextSelectionNavigationDestinationCharacter")]
pub const Character: Self = Self(0);
#[doc(alias = "NSTextSelectionNavigationDestinationWord")]
pub const Word: Self = Self(1);
#[doc(alias = "NSTextSelectionNavigationDestinationLine")]
pub const Line: Self = Self(2);
#[doc(alias = "NSTextSelectionNavigationDestinationSentence")]
pub const Sentence: Self = Self(3);
#[doc(alias = "NSTextSelectionNavigationDestinationParagraph")]
pub const Paragraph: Self = Self(4);
#[doc(alias = "NSTextSelectionNavigationDestinationContainer")]
pub const Container: Self = Self(5);
#[doc(alias = "NSTextSelectionNavigationDestinationDocument")]
pub const Document: Self = Self(6);
}
unsafe impl Encode for NSTextSelectionNavigationDestination {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionNavigationDestination {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionNavigationModifier(pub NSUInteger);
bitflags::bitflags! {
impl NSTextSelectionNavigationModifier: NSUInteger {
#[doc(alias = "NSTextSelectionNavigationModifierExtend")]
const Extend = 1<<0;
#[doc(alias = "NSTextSelectionNavigationModifierVisual")]
const Visual = 1<<1;
#[doc(alias = "NSTextSelectionNavigationModifierMultiple")]
const Multiple = 1<<2;
}
}
unsafe impl Encode for NSTextSelectionNavigationModifier {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionNavigationModifier {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionNavigationWritingDirection(pub NSInteger);
impl NSTextSelectionNavigationWritingDirection {
#[doc(alias = "NSTextSelectionNavigationWritingDirectionLeftToRight")]
pub const LeftToRight: Self = Self(0);
#[doc(alias = "NSTextSelectionNavigationWritingDirectionRightToLeft")]
pub const RightToLeft: Self = Self(1);
}
unsafe impl Encode for NSTextSelectionNavigationWritingDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionNavigationWritingDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextSelectionNavigationLayoutOrientation(pub NSInteger);
impl NSTextSelectionNavigationLayoutOrientation {
#[doc(alias = "NSTextSelectionNavigationLayoutOrientationHorizontal")]
pub const Horizontal: Self = Self(0);
#[doc(alias = "NSTextSelectionNavigationLayoutOrientationVertical")]
pub const Vertical: Self = Self(1);
}
unsafe impl Encode for NSTextSelectionNavigationLayoutOrientation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSTextSelectionNavigationLayoutOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextSelectionNavigation;
unsafe impl ClassType for NSTextSelectionNavigation {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextSelectionNavigation {}
extern_methods!(
unsafe impl NSTextSelectionNavigation {
#[method_id(@__retain_semantics Init initWithDataSource:)]
pub unsafe fn initWithDataSource(
this: Allocated<Self>,
data_source: &ProtocolObject<dyn NSTextSelectionDataSource>,
) -> Retained<Self>;
#[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 textSelectionDataSource)]
pub unsafe fn textSelectionDataSource(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextSelectionDataSource>>>;
#[method(allowsNonContiguousRanges)]
pub unsafe fn allowsNonContiguousRanges(&self) -> bool;
#[method(setAllowsNonContiguousRanges:)]
pub unsafe fn setAllowsNonContiguousRanges(&self, allows_non_contiguous_ranges: bool);
#[method(rotatesCoordinateSystemForLayoutOrientation)]
pub unsafe fn rotatesCoordinateSystemForLayoutOrientation(&self) -> bool;
#[method(setRotatesCoordinateSystemForLayoutOrientation:)]
pub unsafe fn setRotatesCoordinateSystemForLayoutOrientation(
&self,
rotates_coordinate_system_for_layout_orientation: bool,
);
#[method(flushLayoutCache)]
pub unsafe fn flushLayoutCache(&self);
#[cfg(feature = "NSTextSelection")]
#[method_id(@__retain_semantics Other destinationSelectionForTextSelection:direction:destination:extending:confined:)]
pub unsafe fn destinationSelectionForTextSelection_direction_destination_extending_confined(
&self,
text_selection: &NSTextSelection,
direction: NSTextSelectionNavigationDirection,
destination: NSTextSelectionNavigationDestination,
extending: bool,
confined: bool,
) -> Option<Retained<NSTextSelection>>;
#[cfg(all(feature = "NSTextRange", feature = "NSTextSelection"))]
#[method_id(@__retain_semantics Other textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds:)]
pub unsafe fn textSelectionsInteractingAtPoint_inContainerAtLocation_anchors_modifiers_selecting_bounds(
&self,
point: CGPoint,
container_location: &ProtocolObject<dyn NSTextLocation>,
anchors: &NSArray<NSTextSelection>,
modifiers: NSTextSelectionNavigationModifier,
selecting: bool,
bounds: CGRect,
) -> Retained<NSArray<NSTextSelection>>;
#[cfg(feature = "NSTextSelection")]
#[method_id(@__retain_semantics Other textSelectionForSelectionGranularity:enclosingTextSelection:)]
pub unsafe fn textSelectionForSelectionGranularity_enclosingTextSelection(
&self,
selection_granularity: NSTextSelectionGranularity,
text_selection: &NSTextSelection,
) -> Retained<NSTextSelection>;
#[cfg(all(feature = "NSTextRange", feature = "NSTextSelection"))]
#[method_id(@__retain_semantics Other textSelectionForSelectionGranularity:enclosingPoint:inContainerAtLocation:)]
pub unsafe fn textSelectionForSelectionGranularity_enclosingPoint_inContainerAtLocation(
&self,
selection_granularity: NSTextSelectionGranularity,
point: CGPoint,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Option<Retained<NSTextSelection>>;
#[cfg(all(feature = "NSTextRange", feature = "NSTextSelection"))]
#[method_id(@__retain_semantics Other resolvedInsertionLocationForTextSelection:writingDirection:)]
pub unsafe fn resolvedInsertionLocationForTextSelection_writingDirection(
&self,
text_selection: &NSTextSelection,
writing_direction: NSTextSelectionNavigationWritingDirection,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(all(feature = "NSTextRange", feature = "NSTextSelection"))]
#[method_id(@__retain_semantics Other deletionRangesForTextSelection:direction:destination:allowsDecomposition:)]
pub unsafe fn deletionRangesForTextSelection_direction_destination_allowsDecomposition(
&self,
text_selection: &NSTextSelection,
direction: NSTextSelectionNavigationDirection,
destination: NSTextSelectionNavigationDestination,
allows_decomposition: bool,
) -> Retained<NSArray<NSTextRange>>;
}
);
extern_protocol!(
pub unsafe trait NSTextSelectionDataSource: NSObjectProtocol {
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other documentRange)]
unsafe fn documentRange(&self) -> Retained<NSTextRange>;
#[cfg(all(feature = "NSTextRange", feature = "block2"))]
#[method(enumerateSubstringsFromLocation:options:usingBlock:)]
unsafe fn enumerateSubstringsFromLocation_options_usingBlock(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
options: NSStringEnumerationOptions,
block: &block2::Block<
dyn Fn(*mut NSString, NonNull<NSTextRange>, *mut NSTextRange, NonNull<Bool>) + '_,
>,
);
#[cfg(all(feature = "NSTextRange", feature = "NSTextSelection"))]
#[method_id(@__retain_semantics Other textRangeForSelectionGranularity:enclosingLocation:)]
unsafe fn textRangeForSelectionGranularity_enclosingLocation(
&self,
selection_granularity: NSTextSelectionGranularity,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Option<Retained<NSTextRange>>;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other locationFromLocation:withOffset:)]
unsafe fn locationFromLocation_withOffset(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
offset: NSInteger,
) -> Option<Retained<ProtocolObject<dyn NSTextLocation>>>;
#[cfg(feature = "NSTextRange")]
#[method(offsetFromLocation:toLocation:)]
unsafe fn offsetFromLocation_toLocation(
&self,
from: &ProtocolObject<dyn NSTextLocation>,
to: &ProtocolObject<dyn NSTextLocation>,
) -> NSInteger;
#[cfg(feature = "NSTextRange")]
#[method(baseWritingDirectionAtLocation:)]
unsafe fn baseWritingDirectionAtLocation(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> NSTextSelectionNavigationWritingDirection;
#[cfg(all(feature = "NSTextRange", feature = "block2"))]
#[method(enumerateCaretOffsetsInLineFragmentAtLocation:usingBlock:)]
unsafe fn enumerateCaretOffsetsInLineFragmentAtLocation_usingBlock(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
block: &block2::Block<
dyn Fn(CGFloat, NonNull<ProtocolObject<dyn NSTextLocation>>, Bool, NonNull<Bool>)
+ '_,
>,
);
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other lineFragmentRangeForPoint:inContainerAtLocation:)]
unsafe fn lineFragmentRangeForPoint_inContainerAtLocation(
&self,
point: CGPoint,
location: &ProtocolObject<dyn NSTextLocation>,
) -> Option<Retained<NSTextRange>>;
#[cfg(all(feature = "NSTextRange", feature = "block2"))]
#[optional]
#[method(enumerateContainerBoundariesFromLocation:reverse:usingBlock:)]
unsafe fn enumerateContainerBoundariesFromLocation_reverse_usingBlock(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
reverse: bool,
block: &block2::Block<
dyn Fn(NonNull<ProtocolObject<dyn NSTextLocation>>, NonNull<Bool>) + '_,
>,
);
#[cfg(feature = "NSTextRange")]
#[optional]
#[method(textLayoutOrientationAtLocation:)]
unsafe fn textLayoutOrientationAtLocation(
&self,
location: &ProtocolObject<dyn NSTextLocation>,
) -> NSTextSelectionNavigationLayoutOrientation;
}
unsafe impl ProtocolType for dyn NSTextSelectionDataSource {}
);

View File

@@ -0,0 +1,184 @@
//! 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 NSTextStorageEditActions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextStorageEditActions: NSUInteger {
const NSTextStorageEditedAttributes = 1<<0;
const NSTextStorageEditedCharacters = 1<<1;
}
}
unsafe impl Encode for NSTextStorageEditActions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextStorageEditActions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextStorage;
unsafe impl ClassType for NSTextStorage {
#[inherits(NSAttributedString, NSObject)]
type Super = NSMutableAttributedString;
type Mutability = Mutable;
}
);
unsafe impl NSCoding for NSTextStorage {}
unsafe impl NSObjectProtocol for NSTextStorage {}
unsafe impl NSSecureCoding for NSTextStorage {}
extern_methods!(
unsafe impl NSTextStorage {
#[cfg(feature = "NSLayoutManager")]
#[method_id(@__retain_semantics Other layoutManagers)]
pub unsafe fn layoutManagers(&self) -> Retained<NSArray<NSLayoutManager>>;
#[cfg(feature = "NSLayoutManager")]
#[method(addLayoutManager:)]
pub unsafe fn addLayoutManager(&mut self, a_layout_manager: &NSLayoutManager);
#[cfg(feature = "NSLayoutManager")]
#[method(removeLayoutManager:)]
pub unsafe fn removeLayoutManager(&mut self, a_layout_manager: &NSLayoutManager);
#[method(editedMask)]
pub unsafe fn editedMask(&self) -> NSTextStorageEditActions;
#[method(editedRange)]
pub unsafe fn editedRange(&self) -> NSRange;
#[method(changeInLength)]
pub unsafe fn changeInLength(&self) -> NSInteger;
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextStorageDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&mut self,
delegate: Option<&ProtocolObject<dyn NSTextStorageDelegate>>,
);
#[method(edited:range:changeInLength:)]
pub unsafe fn edited_range_changeInLength(
&mut self,
edited_mask: NSTextStorageEditActions,
edited_range: NSRange,
delta: NSInteger,
);
#[method(processEditing)]
pub unsafe fn processEditing(&mut self);
#[method(fixesAttributesLazily)]
pub unsafe fn fixesAttributesLazily(&self) -> bool;
#[method(invalidateAttributesInRange:)]
pub unsafe fn invalidateAttributesInRange(&mut self, range: NSRange);
#[method(ensureAttributesAreFixedInRange:)]
pub unsafe fn ensureAttributesAreFixedInRange(&mut self, range: NSRange);
#[method_id(@__retain_semantics Other textStorageObserver)]
pub unsafe fn textStorageObserver(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextStorageObserving>>>;
#[method(setTextStorageObserver:)]
pub unsafe fn setTextStorageObserver(
&mut self,
text_storage_observer: Option<&ProtocolObject<dyn NSTextStorageObserving>>,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl NSTextStorage {
#[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_protocol!(
pub unsafe trait NSTextStorageDelegate: NSObjectProtocol {
#[optional]
#[method(textStorage:willProcessEditing:range:changeInLength:)]
unsafe fn textStorage_willProcessEditing_range_changeInLength(
&self,
text_storage: &NSTextStorage,
edited_mask: NSTextStorageEditActions,
edited_range: NSRange,
delta: NSInteger,
);
#[optional]
#[method(textStorage:didProcessEditing:range:changeInLength:)]
unsafe fn textStorage_didProcessEditing_range_changeInLength(
&self,
text_storage: &NSTextStorage,
edited_mask: NSTextStorageEditActions,
edited_range: NSRange,
delta: NSInteger,
);
}
unsafe impl ProtocolType for dyn NSTextStorageDelegate {}
);
extern "C" {
pub static NSTextStorageWillProcessEditingNotification: &'static NSNotificationName;
}
extern "C" {
pub static NSTextStorageDidProcessEditingNotification: &'static NSNotificationName;
}
extern_protocol!(
pub unsafe trait NSTextStorageObserving: NSObjectProtocol {
#[method_id(@__retain_semantics Other textStorage)]
unsafe fn textStorage(&self) -> Option<Retained<NSTextStorage>>;
#[method(setTextStorage:)]
unsafe fn setTextStorage(&self, text_storage: Option<&NSTextStorage>);
#[method(processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:)]
unsafe fn processEditingForTextStorage_edited_range_changeInLength_invalidatedRange(
&self,
text_storage: &NSTextStorage,
edit_mask: NSTextStorageEditActions,
new_char_range: NSRange,
delta: NSInteger,
invalidated_char_range: NSRange,
);
#[cfg(feature = "block2")]
#[method(performEditingTransactionForTextStorage:usingBlock:)]
unsafe fn performEditingTransactionForTextStorage_usingBlock(
&self,
text_storage: &NSTextStorage,
transaction: &block2::Block<dyn Fn() + '_>,
);
}
unsafe impl ProtocolType for dyn NSTextStorageObserving {}
);

View File

@@ -0,0 +1,104 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait NSTextViewportLayoutControllerDelegate: NSObjectProtocol {
#[method(viewportBoundsForTextViewportLayoutController:)]
unsafe fn viewportBoundsForTextViewportLayoutController(
&self,
text_viewport_layout_controller: &NSTextViewportLayoutController,
) -> CGRect;
#[cfg(feature = "NSTextLayoutFragment")]
#[method(textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:)]
unsafe fn textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment(
&self,
text_viewport_layout_controller: &NSTextViewportLayoutController,
text_layout_fragment: &NSTextLayoutFragment,
);
#[optional]
#[method(textViewportLayoutControllerWillLayout:)]
unsafe fn textViewportLayoutControllerWillLayout(
&self,
text_viewport_layout_controller: &NSTextViewportLayoutController,
);
#[optional]
#[method(textViewportLayoutControllerDidLayout:)]
unsafe fn textViewportLayoutControllerDidLayout(
&self,
text_viewport_layout_controller: &NSTextViewportLayoutController,
);
}
unsafe impl ProtocolType for dyn NSTextViewportLayoutControllerDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextViewportLayoutController;
unsafe impl ClassType for NSTextViewportLayoutController {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for NSTextViewportLayoutController {}
extern_methods!(
unsafe impl NSTextViewportLayoutController {
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Init initWithTextLayoutManager:)]
pub unsafe fn initWithTextLayoutManager(
this: Allocated<Self>,
text_layout_manager: &NSTextLayoutManager,
) -> Retained<Self>;
#[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 delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NSTextViewportLayoutControllerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NSTextViewportLayoutControllerDelegate>>,
);
#[cfg(feature = "NSTextLayoutManager")]
#[method_id(@__retain_semantics Other textLayoutManager)]
pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
#[method(viewportBounds)]
pub unsafe fn viewportBounds(&self) -> CGRect;
#[cfg(feature = "NSTextRange")]
#[method_id(@__retain_semantics Other viewportRange)]
pub unsafe fn viewportRange(&self) -> Option<Retained<NSTextRange>>;
#[method(layoutViewport)]
pub unsafe fn layoutViewport(&self);
#[cfg(feature = "NSTextRange")]
#[method(relocateViewportToTextLocation:)]
pub unsafe fn relocateViewportToTextLocation(
&self,
text_location: &ProtocolObject<dyn NSTextLocation>,
) -> CGFloat;
#[method(adjustViewportByVerticalOffset:)]
pub unsafe fn adjustViewportByVerticalOffset(&self, vertical_offset: CGFloat);
}
);

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,121 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type UIAccelerationValue = c_double;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
pub struct UIAcceleration;
unsafe impl ClassType for UIAcceleration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UIAcceleration {}
extern_methods!(
unsafe impl UIAcceleration {
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
#[method(timestamp)]
pub unsafe fn timestamp(&self) -> NSTimeInterval;
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
#[method(x)]
pub unsafe fn x(&self) -> UIAccelerationValue;
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
#[method(y)]
pub unsafe fn y(&self) -> UIAccelerationValue;
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
#[method(z)]
pub unsafe fn z(&self) -> UIAccelerationValue;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAcceleration {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
pub struct UIAccelerometer;
unsafe impl ClassType for UIAccelerometer {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UIAccelerometer {}
extern_methods!(
unsafe impl UIAccelerometer {
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
#[method_id(@__retain_semantics Other sharedAccelerometer)]
pub unsafe fn sharedAccelerometer(mtm: MainThreadMarker) -> Retained<UIAccelerometer>;
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
#[method(updateInterval)]
pub unsafe fn updateInterval(&self) -> NSTimeInterval;
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
#[method(setUpdateInterval:)]
pub unsafe fn setUpdateInterval(&self, update_interval: NSTimeInterval);
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UIAccelerometerDelegate>>>;
#[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UIAccelerometerDelegate>>,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAccelerometer {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
pub unsafe trait UIAccelerometerDelegate: NSObjectProtocol + IsMainThreadOnly {
#[deprecated]
#[optional]
#[method(accelerometer:didAccelerate:)]
unsafe fn accelerometer_didAccelerate(
&self,
accelerometer: &UIAccelerometer,
acceleration: &UIAcceleration,
);
}
unsafe impl ProtocolType for dyn UIAccelerometerDelegate {}
);

View File

@@ -0,0 +1,978 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub fn UIAccessibilityConvertFrameToScreenCoordinates(rect: CGRect, view: &UIView) -> CGRect;
}
extern "C" {
#[cfg(all(feature = "UIBezierPath", feature = "UIResponder", feature = "UIView"))]
pub fn UIAccessibilityConvertPathToScreenCoordinates(
path: &UIBezierPath,
view: &UIView,
) -> NonNull<UIBezierPath>;
}
#[cfg(feature = "block2")]
pub type AXBoolReturnBlock = *mut block2::Block<dyn Fn() -> Bool>;
#[cfg(feature = "block2")]
pub type AXStringReturnBlock = *mut block2::Block<dyn Fn() -> *mut NSString>;
#[cfg(feature = "block2")]
pub type AXStringArrayReturnBlock = *mut block2::Block<dyn Fn() -> *mut NSArray<NSString>>;
#[cfg(feature = "block2")]
pub type AXAttributedStringReturnBlock = *mut block2::Block<dyn Fn() -> *mut NSAttributedString>;
#[cfg(feature = "block2")]
pub type AXAttributedStringArrayReturnBlock =
*mut block2::Block<dyn Fn() -> *mut NSArray<NSAttributedString>>;
#[cfg(feature = "block2")]
pub type AXRectReturnBlock = *mut block2::Block<dyn Fn() -> CGRect>;
#[cfg(all(feature = "UIBezierPath", feature = "block2"))]
pub type AXPathReturnBlock = *mut block2::Block<dyn Fn() -> *mut UIBezierPath>;
#[cfg(feature = "block2")]
pub type AXPointReturnBlock = *mut block2::Block<dyn Fn() -> CGPoint>;
#[cfg(feature = "block2")]
pub type AXObjectReturnBlock = *mut block2::Block<dyn Fn() -> *mut AnyObject>;
#[cfg(feature = "block2")]
pub type AXArrayReturnBlock = *mut block2::Block<dyn Fn() -> *mut NSArray>;
#[cfg(feature = "block2")]
pub type AXVoidReturnBlock = *mut block2::Block<dyn Fn()>;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
pub type AXTraitsReturnBlock = *mut block2::Block<dyn Fn() -> UIAccessibilityTraits>;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
pub type AXNavigationStyleReturnBlock =
*mut block2::Block<dyn Fn() -> UIAccessibilityNavigationStyle>;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
pub type AXContainerTypeReturnBlock = *mut block2::Block<dyn Fn() -> UIAccessibilityContainerType>;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
pub type AXTextualContextReturnBlock =
*mut block2::Block<dyn Fn() -> *mut UIAccessibilityTextualContext>;
#[cfg(all(feature = "UIAccessibilityCustomAction", feature = "block2"))]
pub type AXCustomActionsReturnBlock =
*mut block2::Block<dyn Fn() -> *mut NSArray<UIAccessibilityCustomAction>>;
extern_category!(
/// Category "UIAccessibility" on [`NSObject`].
#[doc(alias = "UIAccessibility")]
pub unsafe trait NSObjectUIAccessibility {
#[method(isAccessibilityElement)]
unsafe fn isAccessibilityElement(&self) -> bool;
#[method(setIsAccessibilityElement:)]
unsafe fn setIsAccessibilityElement(&self, is_accessibility_element: bool);
#[method_id(@__retain_semantics Other accessibilityLabel)]
unsafe fn accessibilityLabel(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityLabel:)]
unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);
#[method_id(@__retain_semantics Other accessibilityAttributedLabel)]
unsafe fn accessibilityAttributedLabel(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAccessibilityAttributedLabel:)]
unsafe fn setAccessibilityAttributedLabel(
&self,
accessibility_attributed_label: Option<&NSAttributedString>,
);
#[method_id(@__retain_semantics Other accessibilityHint)]
unsafe fn accessibilityHint(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityHint:)]
unsafe fn setAccessibilityHint(&self, accessibility_hint: Option<&NSString>);
#[method_id(@__retain_semantics Other accessibilityAttributedHint)]
unsafe fn accessibilityAttributedHint(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAccessibilityAttributedHint:)]
unsafe fn setAccessibilityAttributedHint(
&self,
accessibility_attributed_hint: Option<&NSAttributedString>,
);
#[method_id(@__retain_semantics Other accessibilityValue)]
unsafe fn accessibilityValue(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityValue:)]
unsafe fn setAccessibilityValue(&self, accessibility_value: Option<&NSString>);
#[method_id(@__retain_semantics Other accessibilityAttributedValue)]
unsafe fn accessibilityAttributedValue(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAccessibilityAttributedValue:)]
unsafe fn setAccessibilityAttributedValue(
&self,
accessibility_attributed_value: Option<&NSAttributedString>,
);
#[cfg(feature = "UIAccessibilityConstants")]
#[method(accessibilityTraits)]
unsafe fn accessibilityTraits(&self) -> UIAccessibilityTraits;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityTraits:)]
unsafe fn setAccessibilityTraits(&self, accessibility_traits: UIAccessibilityTraits);
#[method(accessibilityFrame)]
unsafe fn accessibilityFrame(&self) -> CGRect;
#[method(setAccessibilityFrame:)]
unsafe fn setAccessibilityFrame(&self, accessibility_frame: CGRect);
#[cfg(feature = "UIBezierPath")]
#[method_id(@__retain_semantics Other accessibilityPath)]
unsafe fn accessibilityPath(&self) -> Option<Retained<UIBezierPath>>;
#[cfg(feature = "UIBezierPath")]
#[method(setAccessibilityPath:)]
unsafe fn setAccessibilityPath(&self, accessibility_path: Option<&UIBezierPath>);
#[method(accessibilityActivationPoint)]
unsafe fn accessibilityActivationPoint(&self) -> CGPoint;
#[method(setAccessibilityActivationPoint:)]
unsafe fn setAccessibilityActivationPoint(&self, accessibility_activation_point: CGPoint);
#[method_id(@__retain_semantics Other accessibilityLanguage)]
unsafe fn accessibilityLanguage(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityLanguage:)]
unsafe fn setAccessibilityLanguage(&self, accessibility_language: Option<&NSString>);
#[method(accessibilityElementsHidden)]
unsafe fn accessibilityElementsHidden(&self) -> bool;
#[method(setAccessibilityElementsHidden:)]
unsafe fn setAccessibilityElementsHidden(&self, accessibility_elements_hidden: bool);
#[method(accessibilityViewIsModal)]
unsafe fn accessibilityViewIsModal(&self) -> bool;
#[method(setAccessibilityViewIsModal:)]
unsafe fn setAccessibilityViewIsModal(&self, accessibility_view_is_modal: bool);
#[method(shouldGroupAccessibilityChildren)]
unsafe fn shouldGroupAccessibilityChildren(&self) -> bool;
#[method(setShouldGroupAccessibilityChildren:)]
unsafe fn setShouldGroupAccessibilityChildren(
&self,
should_group_accessibility_children: bool,
);
#[cfg(feature = "UIAccessibilityConstants")]
#[method(accessibilityNavigationStyle)]
unsafe fn accessibilityNavigationStyle(&self) -> UIAccessibilityNavigationStyle;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityNavigationStyle:)]
unsafe fn setAccessibilityNavigationStyle(
&self,
accessibility_navigation_style: UIAccessibilityNavigationStyle,
);
#[method(accessibilityRespondsToUserInteraction)]
unsafe fn accessibilityRespondsToUserInteraction(&self) -> bool;
#[method(setAccessibilityRespondsToUserInteraction:)]
unsafe fn setAccessibilityRespondsToUserInteraction(
&self,
accessibility_responds_to_user_interaction: bool,
);
#[method_id(@__retain_semantics Other accessibilityUserInputLabels)]
unsafe fn accessibilityUserInputLabels(&self) -> Option<Retained<NSArray<NSString>>>;
#[method(setAccessibilityUserInputLabels:)]
unsafe fn setAccessibilityUserInputLabels(
&self,
accessibility_user_input_labels: Option<&NSArray<NSString>>,
);
#[method_id(@__retain_semantics Other accessibilityAttributedUserInputLabels)]
unsafe fn accessibilityAttributedUserInputLabels(
&self,
) -> Retained<NSArray<NSAttributedString>>;
#[method(setAccessibilityAttributedUserInputLabels:)]
unsafe fn setAccessibilityAttributedUserInputLabels(
&self,
accessibility_attributed_user_input_labels: Option<&NSArray<NSAttributedString>>,
);
#[method_id(@__retain_semantics Other accessibilityHeaderElements)]
unsafe fn accessibilityHeaderElements(&self) -> Option<Retained<NSArray>>;
#[method(setAccessibilityHeaderElements:)]
unsafe fn setAccessibilityHeaderElements(
&self,
accessibility_header_elements: Option<&NSArray>,
);
#[cfg(feature = "UIAccessibilityConstants")]
#[method_id(@__retain_semantics Other accessibilityTextualContext)]
unsafe fn accessibilityTextualContext(
&self,
) -> Option<Retained<UIAccessibilityTextualContext>>;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityTextualContext:)]
unsafe fn setAccessibilityTextualContext(
&self,
accessibility_textual_context: Option<&UIAccessibilityTextualContext>,
);
#[cfg(feature = "UIAccessibilityConstants")]
#[method(accessibilityDirectTouchOptions)]
unsafe fn accessibilityDirectTouchOptions(&self) -> UIAccessibilityDirectTouchOptions;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityDirectTouchOptions:)]
unsafe fn setAccessibilityDirectTouchOptions(
&self,
accessibility_direct_touch_options: UIAccessibilityDirectTouchOptions,
);
#[cfg(feature = "block2")]
#[method(isAccessibilityElementBlock)]
unsafe fn isAccessibilityElementBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setIsAccessibilityElementBlock:)]
unsafe fn setIsAccessibilityElementBlock(
&self,
is_accessibility_element_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityLabelBlock)]
unsafe fn accessibilityLabelBlock(&self) -> AXStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityLabelBlock:)]
unsafe fn setAccessibilityLabelBlock(&self, accessibility_label_block: AXStringReturnBlock);
#[cfg(feature = "block2")]
#[method(accessibilityValueBlock)]
unsafe fn accessibilityValueBlock(&self) -> AXStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityValueBlock:)]
unsafe fn setAccessibilityValueBlock(&self, accessibility_value_block: AXStringReturnBlock);
#[cfg(feature = "block2")]
#[method(accessibilityHintBlock)]
unsafe fn accessibilityHintBlock(&self) -> AXStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityHintBlock:)]
unsafe fn setAccessibilityHintBlock(&self, accessibility_hint_block: AXStringReturnBlock);
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(accessibilityTraitsBlock)]
unsafe fn accessibilityTraitsBlock(&self) -> AXTraitsReturnBlock;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(setAccessibilityTraitsBlock:)]
unsafe fn setAccessibilityTraitsBlock(
&self,
accessibility_traits_block: AXTraitsReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityIdentifierBlock)]
unsafe fn accessibilityIdentifierBlock(&self) -> AXStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityIdentifierBlock:)]
unsafe fn setAccessibilityIdentifierBlock(
&self,
accessibility_identifier_block: AXStringReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityHeaderElementsBlock)]
unsafe fn accessibilityHeaderElementsBlock(&self) -> AXArrayReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityHeaderElementsBlock:)]
unsafe fn setAccessibilityHeaderElementsBlock(
&self,
accessibility_header_elements_block: AXArrayReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityAttributedLabelBlock)]
unsafe fn accessibilityAttributedLabelBlock(&self) -> AXAttributedStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityAttributedLabelBlock:)]
unsafe fn setAccessibilityAttributedLabelBlock(
&self,
accessibility_attributed_label_block: AXAttributedStringReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityAttributedHintBlock)]
unsafe fn accessibilityAttributedHintBlock(&self) -> AXAttributedStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityAttributedHintBlock:)]
unsafe fn setAccessibilityAttributedHintBlock(
&self,
accessibility_attributed_hint_block: AXAttributedStringReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityLanguageBlock)]
unsafe fn accessibilityLanguageBlock(&self) -> AXStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityLanguageBlock:)]
unsafe fn setAccessibilityLanguageBlock(
&self,
accessibility_language_block: AXStringReturnBlock,
);
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(accessibilityTextualContextBlock)]
unsafe fn accessibilityTextualContextBlock(&self) -> AXTextualContextReturnBlock;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(setAccessibilityTextualContextBlock:)]
unsafe fn setAccessibilityTextualContextBlock(
&self,
accessibility_textual_context_block: AXTextualContextReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityUserInputLabelsBlock)]
unsafe fn accessibilityUserInputLabelsBlock(&self) -> AXStringArrayReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityUserInputLabelsBlock:)]
unsafe fn setAccessibilityUserInputLabelsBlock(
&self,
accessibility_user_input_labels_block: AXStringArrayReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityAttributedUserInputLabelsBlock)]
unsafe fn accessibilityAttributedUserInputLabelsBlock(
&self,
) -> AXAttributedStringArrayReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityAttributedUserInputLabelsBlock:)]
unsafe fn setAccessibilityAttributedUserInputLabelsBlock(
&self,
accessibility_attributed_user_input_labels_block: AXAttributedStringArrayReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityAttributedValueBlock)]
unsafe fn accessibilityAttributedValueBlock(&self) -> AXAttributedStringReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityAttributedValueBlock:)]
unsafe fn setAccessibilityAttributedValueBlock(
&self,
accessibility_attributed_value_block: AXAttributedStringReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityElementsHiddenBlock)]
unsafe fn accessibilityElementsHiddenBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityElementsHiddenBlock:)]
unsafe fn setAccessibilityElementsHiddenBlock(
&self,
accessibility_elements_hidden_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityRespondsToUserInteractionBlock)]
unsafe fn accessibilityRespondsToUserInteractionBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityRespondsToUserInteractionBlock:)]
unsafe fn setAccessibilityRespondsToUserInteractionBlock(
&self,
accessibility_responds_to_user_interaction_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityViewIsModalBlock)]
unsafe fn accessibilityViewIsModalBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityViewIsModalBlock:)]
unsafe fn setAccessibilityViewIsModalBlock(
&self,
accessibility_view_is_modal_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityShouldGroupAccessibilityChildrenBlock)]
unsafe fn accessibilityShouldGroupAccessibilityChildrenBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityShouldGroupAccessibilityChildrenBlock:)]
unsafe fn setAccessibilityShouldGroupAccessibilityChildrenBlock(
&self,
accessibility_should_group_accessibility_children_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityElementsBlock)]
unsafe fn accessibilityElementsBlock(&self) -> AXArrayReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityElementsBlock:)]
unsafe fn setAccessibilityElementsBlock(
&self,
accessibility_elements_block: AXArrayReturnBlock,
);
#[cfg(feature = "block2")]
#[method(automationElementsBlock)]
unsafe fn automationElementsBlock(&self) -> AXArrayReturnBlock;
#[cfg(feature = "block2")]
#[method(setAutomationElementsBlock:)]
unsafe fn setAutomationElementsBlock(&self, automation_elements_block: AXArrayReturnBlock);
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(accessibilityContainerTypeBlock)]
unsafe fn accessibilityContainerTypeBlock(&self) -> AXContainerTypeReturnBlock;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(setAccessibilityContainerTypeBlock:)]
unsafe fn setAccessibilityContainerTypeBlock(
&self,
accessibility_container_type_block: AXContainerTypeReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityActivationPointBlock)]
unsafe fn accessibilityActivationPointBlock(&self) -> AXPointReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityActivationPointBlock:)]
unsafe fn setAccessibilityActivationPointBlock(
&self,
accessibility_activation_point_block: AXPointReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityFrameBlock)]
unsafe fn accessibilityFrameBlock(&self) -> AXRectReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityFrameBlock:)]
unsafe fn setAccessibilityFrameBlock(&self, accessibility_frame_block: AXRectReturnBlock);
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(accessibilityNavigationStyleBlock)]
unsafe fn accessibilityNavigationStyleBlock(&self) -> AXNavigationStyleReturnBlock;
#[cfg(all(feature = "UIAccessibilityConstants", feature = "block2"))]
#[method(setAccessibilityNavigationStyleBlock:)]
unsafe fn setAccessibilityNavigationStyleBlock(
&self,
accessibility_navigation_style_block: AXNavigationStyleReturnBlock,
);
#[cfg(all(feature = "UIBezierPath", feature = "block2"))]
#[method(accessibilityPathBlock)]
unsafe fn accessibilityPathBlock(&self) -> AXPathReturnBlock;
#[cfg(all(feature = "UIBezierPath", feature = "block2"))]
#[method(setAccessibilityPathBlock:)]
unsafe fn setAccessibilityPathBlock(&self, accessibility_path_block: AXPathReturnBlock);
#[cfg(feature = "block2")]
#[method(accessibilityActivateBlock)]
unsafe fn accessibilityActivateBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityActivateBlock:)]
unsafe fn setAccessibilityActivateBlock(
&self,
accessibility_activate_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityIncrementBlock)]
unsafe fn accessibilityIncrementBlock(&self) -> AXVoidReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityIncrementBlock:)]
unsafe fn setAccessibilityIncrementBlock(
&self,
accessibility_increment_block: AXVoidReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityDecrementBlock)]
unsafe fn accessibilityDecrementBlock(&self) -> AXVoidReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityDecrementBlock:)]
unsafe fn setAccessibilityDecrementBlock(
&self,
accessibility_decrement_block: AXVoidReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityPerformEscapeBlock)]
unsafe fn accessibilityPerformEscapeBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityPerformEscapeBlock:)]
unsafe fn setAccessibilityPerformEscapeBlock(
&self,
accessibility_perform_escape_block: AXBoolReturnBlock,
);
#[cfg(feature = "block2")]
#[method(accessibilityMagicTapBlock)]
unsafe fn accessibilityMagicTapBlock(&self) -> AXBoolReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityMagicTapBlock:)]
unsafe fn setAccessibilityMagicTapBlock(
&self,
accessibility_magic_tap_block: AXBoolReturnBlock,
);
#[cfg(all(feature = "UIAccessibilityCustomAction", feature = "block2"))]
#[method(accessibilityCustomActionsBlock)]
unsafe fn accessibilityCustomActionsBlock(&self) -> AXCustomActionsReturnBlock;
#[cfg(all(feature = "UIAccessibilityCustomAction", feature = "block2"))]
#[method(setAccessibilityCustomActionsBlock:)]
unsafe fn setAccessibilityCustomActionsBlock(
&self,
accessibility_custom_actions_block: AXCustomActionsReturnBlock,
);
}
unsafe impl NSObjectUIAccessibility for NSObject {}
);
extern "C" {
#[cfg(feature = "UIAccessibilityConstants")]
pub fn UIAccessibilityFocusedElement(
assistive_technology_identifier: Option<&UIAccessibilityAssistiveTechnologyIdentifier>,
) -> *mut AnyObject;
}
extern_category!(
/// Category "UIAccessibilityFocus" on [`NSObject`].
#[doc(alias = "UIAccessibilityFocus")]
pub unsafe trait NSObjectUIAccessibilityFocus {
#[method(accessibilityElementDidBecomeFocused)]
unsafe fn accessibilityElementDidBecomeFocused(&self);
#[method(accessibilityElementDidLoseFocus)]
unsafe fn accessibilityElementDidLoseFocus(&self);
#[method(accessibilityElementIsFocused)]
unsafe fn accessibilityElementIsFocused(&self) -> bool;
#[cfg(feature = "UIAccessibilityConstants")]
#[method_id(@__retain_semantics Other accessibilityAssistiveTechnologyFocusedIdentifiers)]
unsafe fn accessibilityAssistiveTechnologyFocusedIdentifiers(
&self,
) -> Option<Retained<NSSet<UIAccessibilityAssistiveTechnologyIdentifier>>>;
}
unsafe impl NSObjectUIAccessibilityFocus for NSObject {}
);
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityScrollDirection(pub NSInteger);
impl UIAccessibilityScrollDirection {
#[doc(alias = "UIAccessibilityScrollDirectionRight")]
pub const Right: Self = Self(1);
#[doc(alias = "UIAccessibilityScrollDirectionLeft")]
pub const Left: Self = Self(2);
#[doc(alias = "UIAccessibilityScrollDirectionUp")]
pub const Up: Self = Self(3);
#[doc(alias = "UIAccessibilityScrollDirectionDown")]
pub const Down: Self = Self(4);
#[doc(alias = "UIAccessibilityScrollDirectionNext")]
pub const Next: Self = Self(5);
#[doc(alias = "UIAccessibilityScrollDirectionPrevious")]
pub const Previous: Self = Self(6);
}
unsafe impl Encode for UIAccessibilityScrollDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityScrollDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_category!(
/// Category "UIAccessibilityAction" on [`NSObject`].
#[doc(alias = "UIAccessibilityAction")]
pub unsafe trait NSObjectUIAccessibilityAction {
#[method(accessibilityActivate)]
unsafe fn accessibilityActivate(&self) -> bool;
#[method(accessibilityIncrement)]
unsafe fn accessibilityIncrement(&self);
#[method(accessibilityDecrement)]
unsafe fn accessibilityDecrement(&self);
#[method(accessibilityZoomInAtPoint:)]
unsafe fn accessibilityZoomInAtPoint(&self, point: CGPoint) -> bool;
#[method(accessibilityZoomOutAtPoint:)]
unsafe fn accessibilityZoomOutAtPoint(&self, point: CGPoint) -> bool;
#[method(accessibilityScroll:)]
unsafe fn accessibilityScroll(&self, direction: UIAccessibilityScrollDirection) -> bool;
#[method(accessibilityPerformEscape)]
unsafe fn accessibilityPerformEscape(&self) -> bool;
#[method(accessibilityPerformMagicTap)]
unsafe fn accessibilityPerformMagicTap(&self) -> bool;
#[cfg(feature = "UIAccessibilityCustomAction")]
#[method_id(@__retain_semantics Other accessibilityCustomActions)]
unsafe fn accessibilityCustomActions(
&self,
) -> Option<Retained<NSArray<UIAccessibilityCustomAction>>>;
#[cfg(feature = "UIAccessibilityCustomAction")]
#[method(setAccessibilityCustomActions:)]
unsafe fn setAccessibilityCustomActions(
&self,
accessibility_custom_actions: Option<&NSArray<UIAccessibilityCustomAction>>,
);
}
unsafe impl NSObjectUIAccessibilityAction for NSObject {}
);
extern_protocol!(
pub unsafe trait UIAccessibilityReadingContent {
#[method(accessibilityLineNumberForPoint:)]
unsafe fn accessibilityLineNumberForPoint(&self, point: CGPoint) -> NSInteger;
#[method_id(@__retain_semantics Other accessibilityContentForLineNumber:)]
unsafe fn accessibilityContentForLineNumber(
&self,
line_number: NSInteger,
) -> Option<Retained<NSString>>;
#[method(accessibilityFrameForLineNumber:)]
unsafe fn accessibilityFrameForLineNumber(&self, line_number: NSInteger) -> CGRect;
#[method_id(@__retain_semantics Other accessibilityPageContent)]
unsafe fn accessibilityPageContent(&self) -> Option<Retained<NSString>>;
#[optional]
#[method_id(@__retain_semantics Other accessibilityAttributedContentForLineNumber:)]
unsafe fn accessibilityAttributedContentForLineNumber(
&self,
line_number: NSInteger,
) -> Option<Retained<NSAttributedString>>;
#[optional]
#[method_id(@__retain_semantics Other accessibilityAttributedPageContent)]
unsafe fn accessibilityAttributedPageContent(&self)
-> Option<Retained<NSAttributedString>>;
}
unsafe impl ProtocolType for dyn UIAccessibilityReadingContent {}
);
extern_category!(
/// Category "UIAccessibilityDragging" on [`NSObject`].
#[doc(alias = "UIAccessibilityDragging")]
pub unsafe trait NSObjectUIAccessibilityDragging {
#[cfg(feature = "UIAccessibilityLocationDescriptor")]
#[method_id(@__retain_semantics Other accessibilityDragSourceDescriptors)]
unsafe fn accessibilityDragSourceDescriptors(
&self,
) -> Option<Retained<NSArray<UIAccessibilityLocationDescriptor>>>;
#[cfg(feature = "UIAccessibilityLocationDescriptor")]
#[method(setAccessibilityDragSourceDescriptors:)]
unsafe fn setAccessibilityDragSourceDescriptors(
&self,
accessibility_drag_source_descriptors: Option<
&NSArray<UIAccessibilityLocationDescriptor>,
>,
);
#[cfg(feature = "UIAccessibilityLocationDescriptor")]
#[method_id(@__retain_semantics Other accessibilityDropPointDescriptors)]
unsafe fn accessibilityDropPointDescriptors(
&self,
) -> Option<Retained<NSArray<UIAccessibilityLocationDescriptor>>>;
#[cfg(feature = "UIAccessibilityLocationDescriptor")]
#[method(setAccessibilityDropPointDescriptors:)]
unsafe fn setAccessibilityDropPointDescriptors(
&self,
accessibility_drop_point_descriptors: Option<
&NSArray<UIAccessibilityLocationDescriptor>,
>,
);
}
unsafe impl NSObjectUIAccessibilityDragging for NSObject {}
);
extern "C" {
#[cfg(feature = "UIAccessibilityConstants")]
pub fn UIAccessibilityPostNotification(
notification: UIAccessibilityNotifications,
argument: Option<&AnyObject>,
);
}
extern "C" {
pub fn UIAccessibilityIsVoiceOverRunning() -> Bool;
}
extern "C" {
pub static UIAccessibilityVoiceOverStatusChanged: &'static NSString;
}
extern "C" {
pub static UIAccessibilityVoiceOverStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsMonoAudioEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityMonoAudioStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsClosedCaptioningEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityClosedCaptioningStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsInvertColorsEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityInvertColorsStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsGuidedAccessEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityGuidedAccessStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsBoldTextEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityBoldTextStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityButtonShapesEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityButtonShapesEnabledStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsGrayscaleEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityGrayscaleStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsReduceTransparencyEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityReduceTransparencyStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsReduceMotionEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityReduceMotionStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityPrefersCrossFadeTransitions() -> Bool;
}
extern "C" {
pub static UIAccessibilityPrefersCrossFadeTransitionsStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsVideoAutoplayEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityVideoAutoplayStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityDarkerSystemColorsEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityDarkerSystemColorsStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsSwitchControlRunning() -> Bool;
}
extern "C" {
pub static UIAccessibilitySwitchControlStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsSpeakSelectionEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilitySpeakSelectionStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsSpeakScreenEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilitySpeakScreenStatusDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsShakeToUndoEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityShakeToUndoDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsAssistiveTouchRunning() -> Bool;
}
extern "C" {
pub static UIAccessibilityAssistiveTouchStatusDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityShouldDifferentiateWithoutColor() -> Bool;
}
extern "C" {
pub static UIAccessibilityShouldDifferentiateWithoutColorDidChangeNotification:
&'static NSNotificationName;
}
extern "C" {
pub fn UIAccessibilityIsOnOffSwitchLabelsEnabled() -> Bool;
}
extern "C" {
pub static UIAccessibilityOnOffSwitchLabelsDidChangeNotification: &'static NSNotificationName;
}
extern "C" {
#[cfg(feature = "block2")]
pub fn UIAccessibilityRequestGuidedAccessSession(
enable: Bool,
completion_handler: &block2::Block<dyn Fn(Bool)>,
);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityHearingDeviceEar(pub NSUInteger);
bitflags::bitflags! {
impl UIAccessibilityHearingDeviceEar: NSUInteger {
#[doc(alias = "UIAccessibilityHearingDeviceEarNone")]
const None = 0;
#[doc(alias = "UIAccessibilityHearingDeviceEarLeft")]
const Left = 1<<1;
#[doc(alias = "UIAccessibilityHearingDeviceEarRight")]
const Right = 1<<2;
#[doc(alias = "UIAccessibilityHearingDeviceEarBoth")]
const Both = UIAccessibilityHearingDeviceEar::Left.0|UIAccessibilityHearingDeviceEar::Right.0;
}
}
unsafe impl Encode for UIAccessibilityHearingDeviceEar {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityHearingDeviceEar {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub fn UIAccessibilityHearingDevicePairedEar() -> UIAccessibilityHearingDeviceEar;
}
extern "C" {
pub static UIAccessibilityHearingDevicePairedEarDidChangeNotification:
&'static NSNotificationName;
}

View File

@@ -0,0 +1,120 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
#[cfg(feature = "UIPickerView")]
pub unsafe trait UIPickerViewAccessibilityDelegate:
UIPickerViewDelegate + IsMainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityLabelForComponent:)]
unsafe fn pickerView_accessibilityLabelForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityHintForComponent:)]
unsafe fn pickerView_accessibilityHintForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityUserInputLabelsForComponent:)]
unsafe fn pickerView_accessibilityUserInputLabelsForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Retained<NSArray<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityAttributedLabelForComponent:)]
unsafe fn pickerView_accessibilityAttributedLabelForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Option<Retained<NSAttributedString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityAttributedHintForComponent:)]
unsafe fn pickerView_accessibilityAttributedHintForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Option<Retained<NSAttributedString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other pickerView:accessibilityAttributedUserInputLabelsForComponent:)]
unsafe fn pickerView_accessibilityAttributedUserInputLabelsForComponent(
&self,
picker_view: &UIPickerView,
component: NSInteger,
) -> Retained<NSArray<NSAttributedString>>;
}
#[cfg(feature = "UIPickerView")]
unsafe impl ProtocolType for dyn UIPickerViewAccessibilityDelegate {}
);
extern_protocol!(
#[cfg(feature = "UIScrollView")]
pub unsafe trait UIScrollViewAccessibilityDelegate:
UIScrollViewDelegate + IsMainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other accessibilityScrollStatusForScrollView:)]
unsafe fn accessibilityScrollStatusForScrollView(
&self,
scroll_view: &UIScrollView,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other accessibilityAttributedScrollStatusForScrollView:)]
unsafe fn accessibilityAttributedScrollStatusForScrollView(
&self,
scroll_view: &UIScrollView,
) -> Option<Retained<NSAttributedString>>;
}
#[cfg(feature = "UIScrollView")]
unsafe impl ProtocolType for dyn UIScrollViewAccessibilityDelegate {}
);
extern_methods!(
/// UIAccessibilityInvertColors
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIView {
#[method(accessibilityIgnoresInvertColors)]
pub unsafe fn accessibilityIgnoresInvertColors(&self) -> bool;
#[method(setAccessibilityIgnoresInvertColors:)]
pub unsafe fn setAccessibilityIgnoresInvertColors(
&self,
accessibility_ignores_invert_colors: bool,
);
}
);
extern_methods!(
/// UIAccessibility
#[cfg(feature = "UIColor")]
unsafe impl UIColor {
#[method_id(@__retain_semantics Other accessibilityName)]
pub unsafe fn accessibilityName(&self) -> Retained<NSString>;
}
);

View File

@@ -0,0 +1,309 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_ENUM
pub type UIAccessibilityTraits = u64;
extern "C" {
pub static UIAccessibilityTraitNone: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitButton: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitLink: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitHeader: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitSearchField: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitImage: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitSelected: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitPlaysSound: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitKeyboardKey: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitStaticText: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitSummaryElement: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitNotEnabled: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitUpdatesFrequently: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitStartsMediaSession: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitAdjustable: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitAllowsDirectInteraction: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitCausesPageTurn: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitTabBar: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitToggleButton: UIAccessibilityTraits;
}
extern "C" {
pub static UIAccessibilityTraitSupportsZoom: UIAccessibilityTraits;
}
// NS_TYPED_ENUM
pub type UIAccessibilityNotifications = u32;
extern "C" {
pub static UIAccessibilityScreenChangedNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityLayoutChangedNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityAnnouncementNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityPageScrolledNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityPauseAssistiveTechnologyNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityResumeAssistiveTechnologyNotification: UIAccessibilityNotifications;
}
extern "C" {
pub static UIAccessibilityAnnouncementDidFinishNotification: &'static NSNotificationName;
}
extern "C" {
pub static UIAccessibilityAnnouncementKeyStringValue: &'static NSString;
}
extern "C" {
pub static UIAccessibilityAnnouncementKeyWasSuccessful: &'static NSString;
}
extern "C" {
pub static UIAccessibilityElementFocusedNotification: &'static NSNotificationName;
}
extern "C" {
pub static UIAccessibilityFocusedElementKey: &'static NSString;
}
extern "C" {
pub static UIAccessibilityUnfocusedElementKey: &'static NSString;
}
extern "C" {
pub static UIAccessibilityAssistiveTechnologyKey: &'static NSString;
}
// NS_TYPED_ENUM
pub type UIAccessibilityAssistiveTechnologyIdentifier = NSString;
extern "C" {
pub static UIAccessibilityNotificationSwitchControlIdentifier:
&'static UIAccessibilityAssistiveTechnologyIdentifier;
}
extern "C" {
pub static UIAccessibilityNotificationVoiceOverIdentifier:
&'static UIAccessibilityAssistiveTechnologyIdentifier;
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityNavigationStyle(pub NSInteger);
impl UIAccessibilityNavigationStyle {
#[doc(alias = "UIAccessibilityNavigationStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIAccessibilityNavigationStyleSeparate")]
pub const Separate: Self = Self(1);
#[doc(alias = "UIAccessibilityNavigationStyleCombined")]
pub const Combined: Self = Self(2);
}
unsafe impl Encode for UIAccessibilityNavigationStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityNavigationStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityContainerType(pub NSInteger);
impl UIAccessibilityContainerType {
#[doc(alias = "UIAccessibilityContainerTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "UIAccessibilityContainerTypeDataTable")]
pub const DataTable: Self = Self(1);
#[doc(alias = "UIAccessibilityContainerTypeList")]
pub const List: Self = Self(2);
#[doc(alias = "UIAccessibilityContainerTypeLandmark")]
pub const Landmark: Self = Self(3);
#[doc(alias = "UIAccessibilityContainerTypeSemanticGroup")]
pub const SemanticGroup: Self = Self(4);
}
unsafe impl Encode for UIAccessibilityContainerType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityContainerType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityDirectTouchOptions(pub NSUInteger);
bitflags::bitflags! {
impl UIAccessibilityDirectTouchOptions: NSUInteger {
const UIAccessibilityDirectTouchOptionNone = 0;
const UIAccessibilityDirectTouchOptionSilentOnTouch = 1<<0;
const UIAccessibilityDirectTouchOptionRequiresActivation = 1<<1;
}
}
unsafe impl Encode for UIAccessibilityDirectTouchOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityDirectTouchOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIAccessibilityTextualContext = NSString;
extern "C" {
pub static UIAccessibilityTextualContextWordProcessing: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextNarrative: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextMessaging: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextSpreadsheet: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextFileSystem: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextSourceCode: &'static UIAccessibilityTextualContext;
}
extern "C" {
pub static UIAccessibilityTextualContextConsole: &'static UIAccessibilityTextualContext;
}
// NS_TYPED_ENUM
pub type UIAccessibilityPriority = NSString;
extern "C" {
pub static UIAccessibilityPriorityHigh: &'static UIAccessibilityPriority;
}
extern "C" {
pub static UIAccessibilityPriorityDefault: &'static UIAccessibilityPriority;
}
extern "C" {
pub static UIAccessibilityPriorityLow: &'static UIAccessibilityPriority;
}
extern "C" {
pub static UIAccessibilitySpeechAttributePunctuation: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributeLanguage: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributePitch: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributeQueueAnnouncement: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributeAnnouncementPriority: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributeIPANotation: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilitySpeechAttributeSpellOut: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilityTextAttributeHeadingLevel: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilityTextAttributeCustom: &'static NSAttributedStringKey;
}
extern "C" {
pub static UIAccessibilityTextAttributeContext: &'static NSAttributedStringKey;
}

View File

@@ -0,0 +1,115 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_category!(
/// Category "UIAccessibilityContainer" on [`NSObject`].
#[doc(alias = "UIAccessibilityContainer")]
pub unsafe trait NSObjectUIAccessibilityContainer {
#[method(accessibilityElementCount)]
unsafe fn accessibilityElementCount(&self, mtm: MainThreadMarker) -> NSInteger;
#[method_id(@__retain_semantics Other accessibilityElementAtIndex:)]
unsafe fn accessibilityElementAtIndex(
&self,
index: NSInteger,
mtm: MainThreadMarker,
) -> Option<Retained<AnyObject>>;
#[method(indexOfAccessibilityElement:)]
unsafe fn indexOfAccessibilityElement(
&self,
element: &AnyObject,
mtm: MainThreadMarker,
) -> NSInteger;
#[method_id(@__retain_semantics Other accessibilityElements)]
unsafe fn accessibilityElements(&self, mtm: MainThreadMarker) -> Option<Retained<NSArray>>;
#[method(setAccessibilityElements:)]
unsafe fn setAccessibilityElements(
&self,
accessibility_elements: Option<&NSArray>,
mtm: MainThreadMarker,
);
#[cfg(feature = "UIAccessibilityConstants")]
#[method(accessibilityContainerType)]
unsafe fn accessibilityContainerType(
&self,
mtm: MainThreadMarker,
) -> UIAccessibilityContainerType;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityContainerType:)]
unsafe fn setAccessibilityContainerType(
&self,
accessibility_container_type: UIAccessibilityContainerType,
mtm: MainThreadMarker,
);
#[method_id(@__retain_semantics Other automationElements)]
unsafe fn automationElements(&self, mtm: MainThreadMarker) -> Option<Retained<NSArray>>;
#[method(setAutomationElements:)]
unsafe fn setAutomationElements(
&self,
automation_elements: Option<&NSArray>,
mtm: MainThreadMarker,
);
}
unsafe impl NSObjectUIAccessibilityContainer for NSObject {}
);
extern_protocol!(
pub unsafe trait UIAccessibilityContainerDataTableCell:
NSObjectProtocol + IsMainThreadOnly
{
#[method(accessibilityRowRange)]
unsafe fn accessibilityRowRange(&self) -> NSRange;
#[method(accessibilityColumnRange)]
unsafe fn accessibilityColumnRange(&self) -> NSRange;
}
unsafe impl ProtocolType for dyn UIAccessibilityContainerDataTableCell {}
);
extern_protocol!(
pub unsafe trait UIAccessibilityContainerDataTable:
NSObjectProtocol + IsMainThreadOnly
{
#[method_id(@__retain_semantics Other accessibilityDataTableCellElementForRow:column:)]
unsafe fn accessibilityDataTableCellElementForRow_column(
&self,
row: NSUInteger,
column: NSUInteger,
) -> Option<Retained<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>;
#[method(accessibilityRowCount)]
unsafe fn accessibilityRowCount(&self) -> NSUInteger;
#[method(accessibilityColumnCount)]
unsafe fn accessibilityColumnCount(&self) -> NSUInteger;
#[optional]
#[method_id(@__retain_semantics Other accessibilityHeaderElementsForRow:)]
unsafe fn accessibilityHeaderElementsForRow(
&self,
row: NSUInteger,
) -> Option<Retained<NSArray<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>>;
#[optional]
#[method_id(@__retain_semantics Other accessibilityHeaderElementsForColumn:)]
unsafe fn accessibilityHeaderElementsForColumn(
&self,
column: NSUInteger,
) -> Option<Retained<NSArray<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>>;
}
unsafe impl ProtocolType for dyn UIAccessibilityContainerDataTable {}
);

View File

@@ -0,0 +1,59 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIAccessibilityContentSizeCategoryImageAdjusting:
NSObjectProtocol
{
#[method(adjustsImageSizeForAccessibilityContentSizeCategory)]
unsafe fn adjustsImageSizeForAccessibilityContentSizeCategory(&self) -> bool;
#[method(setAdjustsImageSizeForAccessibilityContentSizeCategory:)]
unsafe fn setAdjustsImageSizeForAccessibilityContentSizeCategory(
&self,
adjusts_image_size_for_accessibility_content_size_category: bool,
);
}
unsafe impl ProtocolType for dyn UIAccessibilityContentSizeCategoryImageAdjusting {}
);
extern_methods!(
/// UIAccessibilityContentSizeCategoryImageAdjusting
#[cfg(all(feature = "UIImageView", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIImageView {}
);
#[cfg(all(feature = "UIImageView", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAccessibilityContentSizeCategoryImageAdjusting for UIImageView {}
extern_methods!(
/// UIAccessibilityContentSizeCategoryImageAdjusting
#[cfg(all(
feature = "UIButton",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIButton {}
);
#[cfg(all(
feature = "UIButton",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAccessibilityContentSizeCategoryImageAdjusting for UIButton {}
extern_methods!(
/// UIAccessibilityContentSizeCategoryImageAdjusting
#[cfg(feature = "NSTextAttachment")]
unsafe impl NSTextAttachment {}
);
#[cfg(feature = "NSTextAttachment")]
unsafe impl UIAccessibilityContentSizeCategoryImageAdjusting for NSTextAttachment {}

View File

@@ -0,0 +1,147 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(feature = "block2")]
pub type UIAccessibilityCustomActionHandler =
*mut block2::Block<dyn Fn(NonNull<UIAccessibilityCustomAction>) -> Bool>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIAccessibilityCustomAction;
unsafe impl ClassType for UIAccessibilityCustomAction {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIAccessibilityCustomAction {}
extern_methods!(
unsafe impl UIAccessibilityCustomAction {
#[method_id(@__retain_semantics Init initWithName:target:selector:)]
pub unsafe fn initWithName_target_selector(
this: Allocated<Self>,
name: &NSString,
target: Option<&AnyObject>,
selector: Sel,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithAttributedName:target:selector:)]
pub unsafe fn initWithAttributedName_target_selector(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
target: Option<&AnyObject>,
selector: Sel,
) -> Retained<Self>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Init initWithName:image:target:selector:)]
pub unsafe fn initWithName_image_target_selector(
this: Allocated<Self>,
name: &NSString,
image: Option<&UIImage>,
target: Option<&AnyObject>,
selector: Sel,
) -> Retained<Self>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Init initWithAttributedName:image:target:selector:)]
pub unsafe fn initWithAttributedName_image_target_selector(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
image: Option<&UIImage>,
target: Option<&AnyObject>,
selector: Sel,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithName:actionHandler:)]
pub unsafe fn initWithName_actionHandler(
this: Allocated<Self>,
name: &NSString,
action_handler: UIAccessibilityCustomActionHandler,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithAttributedName:actionHandler:)]
pub unsafe fn initWithAttributedName_actionHandler(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
action_handler: UIAccessibilityCustomActionHandler,
) -> Retained<Self>;
#[cfg(all(feature = "UIImage", feature = "block2"))]
#[method_id(@__retain_semantics Init initWithName:image:actionHandler:)]
pub unsafe fn initWithName_image_actionHandler(
this: Allocated<Self>,
name: &NSString,
image: Option<&UIImage>,
action_handler: UIAccessibilityCustomActionHandler,
) -> Retained<Self>;
#[cfg(all(feature = "UIImage", feature = "block2"))]
#[method_id(@__retain_semantics Init initWithAttributedName:image:actionHandler:)]
pub unsafe fn initWithAttributedName_image_actionHandler(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
image: Option<&UIImage>,
action_handler: UIAccessibilityCustomActionHandler,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[method(setName:)]
pub unsafe fn setName(&self, name: &NSString);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[method_id(@__retain_semantics Other attributedName)]
pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;
#[method(setAttributedName:)]
pub unsafe fn setAttributedName(&self, attributed_name: &NSAttributedString);
#[method_id(@__retain_semantics Other target)]
pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
#[method(setTarget:)]
pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
#[method(selector)]
pub unsafe fn selector(&self) -> Sel;
#[method(setSelector:)]
pub unsafe fn setSelector(&self, selector: Sel);
#[cfg(feature = "block2")]
#[method(actionHandler)]
pub unsafe fn actionHandler(&self) -> UIAccessibilityCustomActionHandler;
#[cfg(feature = "block2")]
#[method(setActionHandler:)]
pub unsafe fn setActionHandler(&self, action_handler: UIAccessibilityCustomActionHandler);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAccessibilityCustomAction {
#[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>;
}
);

View File

@@ -0,0 +1,287 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityCustomRotorDirection(pub NSInteger);
impl UIAccessibilityCustomRotorDirection {
#[doc(alias = "UIAccessibilityCustomRotorDirectionPrevious")]
pub const Previous: Self = Self(0);
#[doc(alias = "UIAccessibilityCustomRotorDirectionNext")]
pub const Next: Self = Self(1);
}
unsafe impl Encode for UIAccessibilityCustomRotorDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityCustomRotorDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityCustomSystemRotorType(pub NSInteger);
impl UIAccessibilityCustomSystemRotorType {
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeLink")]
pub const Link: Self = Self(1);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeVisitedLink")]
pub const VisitedLink: Self = Self(2);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeading")]
pub const Heading: Self = Self(3);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel1")]
pub const HeadingLevel1: Self = Self(4);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel2")]
pub const HeadingLevel2: Self = Self(5);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel3")]
pub const HeadingLevel3: Self = Self(6);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel4")]
pub const HeadingLevel4: Self = Self(7);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel5")]
pub const HeadingLevel5: Self = Self(8);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeHeadingLevel6")]
pub const HeadingLevel6: Self = Self(9);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeBoldText")]
pub const BoldText: Self = Self(10);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeItalicText")]
pub const ItalicText: Self = Self(11);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeUnderlineText")]
pub const UnderlineText: Self = Self(12);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeMisspelledWord")]
pub const MisspelledWord: Self = Self(13);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeImage")]
pub const Image: Self = Self(14);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeTextField")]
pub const TextField: Self = Self(15);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeTable")]
pub const Table: Self = Self(16);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeList")]
pub const List: Self = Self(17);
#[doc(alias = "UIAccessibilityCustomSystemRotorTypeLandmark")]
pub const Landmark: Self = Self(18);
}
unsafe impl Encode for UIAccessibilityCustomSystemRotorType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityCustomSystemRotorType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "block2")]
pub type UIAccessibilityCustomRotorSearch = *mut block2::Block<
dyn Fn(
NonNull<UIAccessibilityCustomRotorSearchPredicate>,
) -> *mut UIAccessibilityCustomRotorItemResult,
>;
#[cfg(feature = "block2")]
pub type AXCustomRotorsReturnBlock =
*mut block2::Block<dyn Fn() -> *mut NSArray<UIAccessibilityCustomRotor>>;
extern_category!(
/// Category "UIAccessibilityCustomRotor" on [`NSObject`].
#[doc(alias = "UIAccessibilityCustomRotor")]
pub unsafe trait NSObjectUIAccessibilityCustomRotor {
#[method_id(@__retain_semantics Other accessibilityCustomRotors)]
unsafe fn accessibilityCustomRotors(
&self,
) -> Option<Retained<NSArray<UIAccessibilityCustomRotor>>>;
#[method(setAccessibilityCustomRotors:)]
unsafe fn setAccessibilityCustomRotors(
&self,
accessibility_custom_rotors: Option<&NSArray<UIAccessibilityCustomRotor>>,
);
#[cfg(feature = "block2")]
#[method(accessibilityCustomRotorsBlock)]
unsafe fn accessibilityCustomRotorsBlock(&self) -> AXCustomRotorsReturnBlock;
#[cfg(feature = "block2")]
#[method(setAccessibilityCustomRotorsBlock:)]
unsafe fn setAccessibilityCustomRotorsBlock(
&self,
accessibility_custom_rotors_block: AXCustomRotorsReturnBlock,
);
}
unsafe impl NSObjectUIAccessibilityCustomRotor for NSObject {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIAccessibilityCustomRotorSearchPredicate;
unsafe impl ClassType for UIAccessibilityCustomRotorSearchPredicate {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorSearchPredicate {}
extern_methods!(
unsafe impl UIAccessibilityCustomRotorSearchPredicate {
#[method_id(@__retain_semantics Other currentItem)]
pub unsafe fn currentItem(&self) -> Retained<UIAccessibilityCustomRotorItemResult>;
#[method(setCurrentItem:)]
pub unsafe fn setCurrentItem(&self, current_item: &UIAccessibilityCustomRotorItemResult);
#[method(searchDirection)]
pub unsafe fn searchDirection(&self) -> UIAccessibilityCustomRotorDirection;
#[method(setSearchDirection:)]
pub unsafe fn setSearchDirection(
&self,
search_direction: UIAccessibilityCustomRotorDirection,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAccessibilityCustomRotorSearchPredicate {
#[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 UIAccessibilityCustomRotor;
unsafe impl ClassType for UIAccessibilityCustomRotor {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIAccessibilityCustomRotor {}
extern_methods!(
unsafe impl UIAccessibilityCustomRotor {
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithName:itemSearchBlock:)]
pub unsafe fn initWithName_itemSearchBlock(
this: Allocated<Self>,
name: &NSString,
item_search_block: UIAccessibilityCustomRotorSearch,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithAttributedName:itemSearchBlock:)]
pub unsafe fn initWithAttributedName_itemSearchBlock(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
item_search_block: UIAccessibilityCustomRotorSearch,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithSystemType:itemSearchBlock:)]
pub unsafe fn initWithSystemType_itemSearchBlock(
this: Allocated<Self>,
r#type: UIAccessibilityCustomSystemRotorType,
item_search_block: UIAccessibilityCustomRotorSearch,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[method(setName:)]
pub unsafe fn setName(&self, name: &NSString);
#[method_id(@__retain_semantics Other attributedName)]
pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;
#[method(setAttributedName:)]
pub unsafe fn setAttributedName(&self, attributed_name: &NSAttributedString);
#[cfg(feature = "block2")]
#[method(itemSearchBlock)]
pub unsafe fn itemSearchBlock(&self) -> UIAccessibilityCustomRotorSearch;
#[cfg(feature = "block2")]
#[method(setItemSearchBlock:)]
pub unsafe fn setItemSearchBlock(
&self,
item_search_block: UIAccessibilityCustomRotorSearch,
);
#[method(systemRotorType)]
pub unsafe fn systemRotorType(&self) -> UIAccessibilityCustomSystemRotorType;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAccessibilityCustomRotor {
#[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 UIAccessibilityCustomRotorItemResult;
unsafe impl ClassType for UIAccessibilityCustomRotorItemResult {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIAccessibilityCustomRotorItemResult {}
extern_methods!(
unsafe impl UIAccessibilityCustomRotorItemResult {
#[cfg(feature = "UITextInput")]
#[method_id(@__retain_semantics Init initWithTargetElement:targetRange:)]
pub unsafe fn initWithTargetElement_targetRange(
this: Allocated<Self>,
target_element: &NSObject,
target_range: Option<&UITextRange>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other targetElement)]
pub unsafe fn targetElement(&self) -> Option<Retained<NSObject>>;
#[method(setTargetElement:)]
pub unsafe fn setTargetElement(&self, target_element: Option<&NSObject>);
#[cfg(feature = "UITextInput")]
#[method_id(@__retain_semantics Other targetRange)]
pub unsafe fn targetRange(&self, mtm: MainThreadMarker) -> Option<Retained<UITextRange>>;
#[cfg(feature = "UITextInput")]
#[method(setTargetRange:)]
pub unsafe fn setTargetRange(&self, target_range: Option<&UITextRange>);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAccessibilityCustomRotorItemResult {
#[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>;
}
);

View File

@@ -0,0 +1,104 @@
//! 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)]
#[cfg(feature = "UIResponder")]
pub struct UIAccessibilityElement;
#[cfg(feature = "UIResponder")]
unsafe impl ClassType for UIAccessibilityElement {
#[inherits(NSObject)]
type Super = UIResponder;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIResponder")]
unsafe impl NSObjectProtocol for UIAccessibilityElement {}
#[cfg(all(feature = "UIAccessibilityIdentification", feature = "UIResponder"))]
unsafe impl UIAccessibilityIdentification for UIAccessibilityElement {}
#[cfg(feature = "UIResponder")]
unsafe impl UIResponderStandardEditActions for UIAccessibilityElement {}
extern_methods!(
#[cfg(feature = "UIResponder")]
unsafe impl UIAccessibilityElement {
#[method_id(@__retain_semantics Init initWithAccessibilityContainer:)]
pub unsafe fn initWithAccessibilityContainer(
this: Allocated<Self>,
container: &AnyObject,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other accessibilityContainer)]
pub unsafe fn accessibilityContainer(&self) -> Option<Retained<AnyObject>>;
#[method(setAccessibilityContainer:)]
pub unsafe fn setAccessibilityContainer(&self, accessibility_container: Option<&AnyObject>);
#[method(isAccessibilityElement)]
pub unsafe fn isAccessibilityElement(&self) -> bool;
#[method(setIsAccessibilityElement:)]
pub unsafe fn setIsAccessibilityElement(&self, is_accessibility_element: bool);
#[method_id(@__retain_semantics Other accessibilityLabel)]
pub unsafe fn accessibilityLabel(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityLabel:)]
pub unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);
#[method_id(@__retain_semantics Other accessibilityHint)]
pub unsafe fn accessibilityHint(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityHint:)]
pub unsafe fn setAccessibilityHint(&self, accessibility_hint: Option<&NSString>);
#[method_id(@__retain_semantics Other accessibilityValue)]
pub unsafe fn accessibilityValue(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityValue:)]
pub unsafe fn setAccessibilityValue(&self, accessibility_value: Option<&NSString>);
#[method(accessibilityFrame)]
pub unsafe fn accessibilityFrame(&self) -> CGRect;
#[method(setAccessibilityFrame:)]
pub unsafe fn setAccessibilityFrame(&self, accessibility_frame: CGRect);
#[cfg(feature = "UIAccessibilityConstants")]
#[method(accessibilityTraits)]
pub unsafe fn accessibilityTraits(&self) -> UIAccessibilityTraits;
#[cfg(feature = "UIAccessibilityConstants")]
#[method(setAccessibilityTraits:)]
pub unsafe fn setAccessibilityTraits(&self, accessibility_traits: UIAccessibilityTraits);
#[method(accessibilityFrameInContainerSpace)]
pub unsafe fn accessibilityFrameInContainerSpace(&self) -> CGRect;
#[method(setAccessibilityFrameInContainerSpace:)]
pub unsafe fn setAccessibilityFrameInContainerSpace(
&self,
accessibility_frame_in_container_space: CGRect,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIResponder")]
unsafe impl UIAccessibilityElement {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,63 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIAccessibilityIdentification: NSObjectProtocol {
#[method_id(@__retain_semantics Other accessibilityIdentifier)]
unsafe fn accessibilityIdentifier(&self) -> Option<Retained<NSString>>;
#[method(setAccessibilityIdentifier:)]
unsafe fn setAccessibilityIdentifier(&self, accessibility_identifier: Option<&NSString>);
}
unsafe impl ProtocolType for dyn UIAccessibilityIdentification {}
);
extern_methods!(
/// UIAccessibility
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIView {}
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAccessibilityIdentification for UIView {}
extern_methods!(
/// UIAccessibility
#[cfg(feature = "UIBarItem")]
unsafe impl UIBarItem {}
);
#[cfg(feature = "UIBarItem")]
unsafe impl UIAccessibilityIdentification for UIBarItem {}
extern_methods!(
/// UIAccessibility
#[cfg(feature = "UIAlertController")]
unsafe impl UIAlertAction {}
);
#[cfg(feature = "UIAlertController")]
unsafe impl UIAccessibilityIdentification for UIAlertAction {}
extern_methods!(
/// UIAccessibility
#[cfg(feature = "UIMenuElement")]
unsafe impl UIMenuElement {}
);
#[cfg(feature = "UIMenuElement")]
unsafe impl UIAccessibilityIdentification for UIMenuElement {}
extern_methods!(
/// UIAccessibility
#[cfg(feature = "UIImage")]
unsafe impl UIImage {}
);
#[cfg(feature = "UIImage")]
unsafe impl UIAccessibilityIdentification for UIImage {}

View File

@@ -0,0 +1,67 @@
//! 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 UIAccessibilityLocationDescriptor;
unsafe impl ClassType for UIAccessibilityLocationDescriptor {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIAccessibilityLocationDescriptor {}
extern_methods!(
unsafe impl UIAccessibilityLocationDescriptor {
#[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>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Init initWithName:view:)]
pub unsafe fn initWithName_view(
this: Allocated<Self>,
name: &NSString,
view: &UIView,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Init initWithName:point:inView:)]
pub unsafe fn initWithName_point_inView(
this: Allocated<Self>,
name: &NSString,
point: CGPoint,
view: &UIView,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Init initWithAttributedName:point:inView:)]
pub unsafe fn initWithAttributedName_point_inView(
this: Allocated<Self>,
attributed_name: &NSAttributedString,
point: CGPoint,
view: &UIView,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other view)]
pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<UIView>>;
#[method(point)]
pub unsafe fn point(&self) -> CGPoint;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[method_id(@__retain_semantics Other attributedName)]
pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;
}
);

View File

@@ -0,0 +1,36 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAccessibilityZoomType(pub NSInteger);
impl UIAccessibilityZoomType {
#[doc(alias = "UIAccessibilityZoomTypeInsertionPoint")]
pub const InsertionPoint: Self = Self(0);
}
unsafe impl Encode for UIAccessibilityZoomType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAccessibilityZoomType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub fn UIAccessibilityZoomFocusChanged(
r#type: UIAccessibilityZoomType,
frame: CGRect,
view: &UIView,
);
}
extern "C" {
pub fn UIAccessibilityRegisterGestureConflictWithZoom();
}

View File

@@ -0,0 +1,151 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActionIdentifier = NSString;
extern "C" {
pub static UIActionPaste: &'static UIActionIdentifier;
}
extern "C" {
pub static UIActionPasteAndMatchStyle: &'static UIActionIdentifier;
}
extern "C" {
pub static UIActionPasteAndGo: &'static UIActionIdentifier;
}
extern "C" {
pub static UIActionPasteAndSearch: &'static UIActionIdentifier;
}
#[cfg(all(feature = "UIMenuElement", feature = "block2"))]
pub type UIActionHandler = *mut block2::Block<dyn Fn(NonNull<UIAction>)>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIMenuElement")]
pub struct UIAction;
#[cfg(feature = "UIMenuElement")]
unsafe impl ClassType for UIAction {
#[inherits(NSObject)]
type Super = UIMenuElement;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIMenuElement")]
unsafe impl NSCoding for UIAction {}
#[cfg(feature = "UIMenuElement")]
unsafe impl NSCopying for UIAction {}
#[cfg(feature = "UIMenuElement")]
unsafe impl NSObjectProtocol for UIAction {}
#[cfg(feature = "UIMenuElement")]
unsafe impl NSSecureCoding for UIAction {}
#[cfg(all(feature = "UIMenuElement", feature = "UIMenuLeaf"))]
unsafe impl UIMenuLeaf for UIAction {}
extern_methods!(
#[cfg(feature = "UIMenuElement")]
unsafe impl UIAction {
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Retained<NSString>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: &NSString);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[method_id(@__retain_semantics Other discoverabilityTitle)]
pub unsafe fn discoverabilityTitle(&self) -> Option<Retained<NSString>>;
#[method(setDiscoverabilityTitle:)]
pub unsafe fn setDiscoverabilityTitle(&self, discoverability_title: Option<&NSString>);
#[method_id(@__retain_semantics Other identifier)]
pub unsafe fn identifier(&self) -> Retained<UIActionIdentifier>;
#[method(attributes)]
pub unsafe fn attributes(&self) -> UIMenuElementAttributes;
#[method(setAttributes:)]
pub unsafe fn setAttributes(&self, attributes: UIMenuElementAttributes);
#[method(state)]
pub unsafe fn state(&self) -> UIMenuElementState;
#[method(setState:)]
pub unsafe fn setState(&self, state: UIMenuElementState);
#[method_id(@__retain_semantics Other sender)]
pub unsafe fn sender(&self) -> Option<Retained<AnyObject>>;
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Other actionWithHandler:)]
pub unsafe fn actionWithHandler(
handler: UIActionHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIImage", feature = "block2"))]
#[method_id(@__retain_semantics Other actionWithTitle:image:identifier:handler:)]
pub unsafe fn actionWithTitle_image_identifier_handler(
title: &NSString,
image: Option<&UIImage>,
identifier: Option<&UIActionIdentifier>,
handler: UIActionHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `UIMenuElement`
#[cfg(feature = "UIMenuElement")]
unsafe impl UIAction {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// UICaptureTextFromCameraSupporting
#[cfg(feature = "UIMenuElement")]
unsafe impl UIAction {
#[cfg(all(
feature = "UIResponder",
feature = "UITextInput",
feature = "UITextInputTraits"
))]
#[method_id(@__retain_semantics Other captureTextFromCameraActionForResponder:identifier:)]
pub unsafe fn captureTextFromCameraActionForResponder_identifier(
responder: &UIResponder,
identifier: Option<&UIActionIdentifier>,
) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,291 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
// NS_ENUM
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActionSheetStyle(pub NSInteger);
impl UIActionSheetStyle {
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[doc(alias = "UIActionSheetStyleAutomatic")]
pub const Automatic: Self = Self(-1);
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[doc(alias = "UIActionSheetStyleDefault")]
pub const Default: Self = Self(UIBarStyle::Default.0);
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[doc(alias = "UIActionSheetStyleBlackTranslucent")]
pub const BlackTranslucent: Self = Self(UIBarStyle::BlackTranslucent.0);
#[cfg(feature = "UIInterface")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[doc(alias = "UIActionSheetStyleBlackOpaque")]
pub const BlackOpaque: Self = Self(UIBarStyle::BlackOpaque.0);
}
unsafe impl Encode for UIActionSheetStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIActionSheetStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
pub struct UIActionSheet;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UIActionSheet {
#[inherits(UIResponder, NSObject)]
type Super = UIView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIActionSheet {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIActionSheet {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIActionSheet {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UIActionSheet {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UIActionSheet {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIActionSheet {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UIActionSheet {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UIActionSheet {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UIActionSheet {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UIActionSheet {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIActionSheet {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIActionSheet {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIActionSheet {
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UIActionSheetDelegate>>>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UIActionSheetDelegate>>,
);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Retained<NSString>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: &NSString);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(actionSheetStyle)]
pub unsafe fn actionSheetStyle(&self) -> UIActionSheetStyle;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(setActionSheetStyle:)]
pub unsafe fn setActionSheetStyle(&self, action_sheet_style: UIActionSheetStyle);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(addButtonWithTitle:)]
pub unsafe fn addButtonWithTitle(&self, title: Option<&NSString>) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method_id(@__retain_semantics Other buttonTitleAtIndex:)]
pub unsafe fn buttonTitleAtIndex(
&self,
button_index: NSInteger,
) -> Option<Retained<NSString>>;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(numberOfButtons)]
pub unsafe fn numberOfButtons(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(cancelButtonIndex)]
pub unsafe fn cancelButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(setCancelButtonIndex:)]
pub unsafe fn setCancelButtonIndex(&self, cancel_button_index: NSInteger);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(destructiveButtonIndex)]
pub unsafe fn destructiveButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(setDestructiveButtonIndex:)]
pub unsafe fn setDestructiveButtonIndex(&self, destructive_button_index: NSInteger);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(firstOtherButtonIndex)]
pub unsafe fn firstOtherButtonIndex(&self) -> NSInteger;
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(isVisible)]
pub unsafe fn isVisible(&self) -> bool;
#[cfg(feature = "UIToolbar")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(showFromToolbar:)]
pub unsafe fn showFromToolbar(&self, view: &UIToolbar);
#[cfg(feature = "UITabBar")]
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(showFromTabBar:)]
pub unsafe fn showFromTabBar(&self, view: &UITabBar);
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method(showFromBarButtonItem:animated:)]
pub unsafe fn showFromBarButtonItem_animated(&self, item: &UIBarButtonItem, animated: bool);
#[method(showFromRect:inView:animated:)]
pub unsafe fn showFromRect_inView_animated(
&self,
rect: CGRect,
view: &UIView,
animated: bool,
);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(showInView:)]
pub unsafe fn showInView(&self, view: &UIView);
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
#[method(dismissWithClickedButtonIndex:animated:)]
pub unsafe fn dismissWithClickedButtonIndex_animated(
&self,
button_index: NSInteger,
animated: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `UIView`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIActionSheet {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIActionSheet {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait UIActionSheetDelegate: NSObjectProtocol + IsMainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(actionSheet:clickedButtonAtIndex:)]
unsafe fn actionSheet_clickedButtonAtIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(actionSheetCancel:)]
unsafe fn actionSheetCancel(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(willPresentActionSheet:)]
unsafe fn willPresentActionSheet(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(didPresentActionSheet:)]
unsafe fn didPresentActionSheet(&self, action_sheet: &UIActionSheet);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(actionSheet:willDismissWithButtonIndex:)]
unsafe fn actionSheet_willDismissWithButtonIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(actionSheet:didDismissWithButtonIndex:)]
unsafe fn actionSheet_didDismissWithButtonIndex(
&self,
action_sheet: &UIActionSheet,
button_index: NSInteger,
);
}
unsafe impl ProtocolType for dyn UIActionSheetDelegate {}
);

View File

@@ -0,0 +1,167 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityType = NSString;
extern "C" {
pub static UIActivityTypePostToFacebook: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePostToTwitter: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePostToWeibo: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeMessage: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeMail: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePrint: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeCopyToPasteboard: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeAssignToContact: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeSaveToCameraRoll: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeAddToReadingList: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePostToFlickr: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePostToVimeo: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypePostToTencentWeibo: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeAirDrop: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeOpenInIBooks: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeMarkupAsPDF: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeSharePlay: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeCollaborationInviteWithLink: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeCollaborationCopyLink: &'static UIActivityType;
}
extern "C" {
pub static UIActivityTypeAddToHomeScreen: &'static UIActivityType;
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActivityCategory(pub NSInteger);
impl UIActivityCategory {
#[doc(alias = "UIActivityCategoryAction")]
pub const Action: Self = Self(0);
#[doc(alias = "UIActivityCategoryShare")]
pub const Share: Self = Self(1);
}
unsafe impl Encode for UIActivityCategory {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIActivityCategory {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIActivity;
unsafe impl ClassType for UIActivity {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIActivity {}
extern_methods!(
unsafe impl UIActivity {
#[method(activityCategory)]
pub unsafe fn activityCategory() -> UIActivityCategory;
#[method_id(@__retain_semantics Other activityType)]
pub unsafe fn activityType(&self) -> Option<Retained<UIActivityType>>;
#[method_id(@__retain_semantics Other activityTitle)]
pub unsafe fn activityTitle(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other activityImage)]
pub unsafe fn activityImage(&self) -> Option<Retained<UIImage>>;
#[method(canPerformWithActivityItems:)]
pub unsafe fn canPerformWithActivityItems(&self, activity_items: &NSArray) -> bool;
#[method(prepareWithActivityItems:)]
pub unsafe fn prepareWithActivityItems(&self, activity_items: &NSArray);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[method_id(@__retain_semantics Other activityViewController)]
pub unsafe fn activityViewController(
&self,
mtm: MainThreadMarker,
) -> Option<Retained<UIViewController>>;
#[method(performActivity)]
pub unsafe fn performActivity(&self);
#[method(activityDidFinish:)]
pub unsafe fn activityDidFinish(&self, completed: bool);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIActivity {
#[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>;
}
);

View File

@@ -0,0 +1,160 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActivityIndicatorViewStyle(pub NSInteger);
impl UIActivityIndicatorViewStyle {
#[doc(alias = "UIActivityIndicatorViewStyleMedium")]
pub const Medium: Self = Self(100);
#[doc(alias = "UIActivityIndicatorViewStyleLarge")]
pub const Large: Self = Self(101);
#[deprecated]
#[doc(alias = "UIActivityIndicatorViewStyleWhiteLarge")]
pub const WhiteLarge: Self = Self(0);
#[deprecated]
#[doc(alias = "UIActivityIndicatorViewStyleWhite")]
pub const White: Self = Self(1);
#[deprecated]
#[doc(alias = "UIActivityIndicatorViewStyleGray")]
pub const Gray: Self = Self(2);
}
unsafe impl Encode for UIActivityIndicatorViewStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIActivityIndicatorViewStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UIActivityIndicatorView;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UIActivityIndicatorView {
#[inherits(UIResponder, NSObject)]
type Super = UIView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIActivityIndicatorView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIActivityIndicatorView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIActivityIndicatorView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UIActivityIndicatorView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UIActivityIndicatorView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIActivityIndicatorView {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UIActivityIndicatorView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UIActivityIndicatorView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UIActivityIndicatorView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UIActivityIndicatorView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIActivityIndicatorView {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIActivityIndicatorView {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIActivityIndicatorView {
#[method_id(@__retain_semantics Init initWithActivityIndicatorStyle:)]
pub unsafe fn initWithActivityIndicatorStyle(
this: Allocated<Self>,
style: UIActivityIndicatorViewStyle,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[method(activityIndicatorViewStyle)]
pub unsafe fn activityIndicatorViewStyle(&self) -> UIActivityIndicatorViewStyle;
#[method(setActivityIndicatorViewStyle:)]
pub unsafe fn setActivityIndicatorViewStyle(
&self,
activity_indicator_view_style: UIActivityIndicatorViewStyle,
);
#[method(hidesWhenStopped)]
pub unsafe fn hidesWhenStopped(&self) -> bool;
#[method(setHidesWhenStopped:)]
pub unsafe fn setHidesWhenStopped(&self, hides_when_stopped: bool);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other color)]
pub unsafe fn color(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setColor:)]
pub unsafe fn setColor(&self, color: Option<&UIColor>);
#[method(startAnimating)]
pub unsafe fn startAnimating(&self);
#[method(stopAnimating)]
pub unsafe fn stopAnimating(&self);
#[method(isAnimating)]
pub unsafe fn isAnimating(&self) -> bool;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIActivityIndicatorView {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,143 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-link-presentation")]
#[cfg(not(target_os = "watchos"))]
use objc2_link_presentation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIActivityItemSource: NSObjectProtocol {
#[cfg(all(
feature = "UIActivityViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[method_id(@__retain_semantics Other activityViewControllerPlaceholderItem:)]
unsafe fn activityViewControllerPlaceholderItem(
&self,
activity_view_controller: &UIActivityViewController,
) -> Retained<AnyObject>;
#[cfg(all(
feature = "UIActivity",
feature = "UIActivityViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[method_id(@__retain_semantics Other activityViewController:itemForActivityType:)]
unsafe fn activityViewController_itemForActivityType(
&self,
activity_view_controller: &UIActivityViewController,
activity_type: Option<&UIActivityType>,
) -> Option<Retained<AnyObject>>;
#[cfg(all(
feature = "UIActivity",
feature = "UIActivityViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[method_id(@__retain_semantics Other activityViewController:subjectForActivityType:)]
unsafe fn activityViewController_subjectForActivityType(
&self,
activity_view_controller: &UIActivityViewController,
activity_type: Option<&UIActivityType>,
) -> Retained<NSString>;
#[cfg(all(
feature = "UIActivity",
feature = "UIActivityViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[method_id(@__retain_semantics Other activityViewController:dataTypeIdentifierForActivityType:)]
unsafe fn activityViewController_dataTypeIdentifierForActivityType(
&self,
activity_view_controller: &UIActivityViewController,
activity_type: Option<&UIActivityType>,
) -> Retained<NSString>;
#[cfg(all(
feature = "UIActivity",
feature = "UIActivityViewController",
feature = "UIImage",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[method_id(@__retain_semantics Other activityViewController:thumbnailImageForActivityType:suggestedSize:)]
unsafe fn activityViewController_thumbnailImageForActivityType_suggestedSize(
&self,
activity_view_controller: &UIActivityViewController,
activity_type: Option<&UIActivityType>,
size: CGSize,
) -> Option<Retained<UIImage>>;
#[cfg(all(
feature = "UIActivityViewController",
feature = "UIResponder",
feature = "UIViewController",
feature = "objc2-link-presentation"
))]
#[cfg(not(target_os = "watchos"))]
#[optional]
#[method_id(@__retain_semantics Other activityViewControllerLinkMetadata:)]
unsafe fn activityViewControllerLinkMetadata(
&self,
activity_view_controller: &UIActivityViewController,
) -> Option<Retained<LPLinkMetadata>>;
}
unsafe impl ProtocolType for dyn UIActivityItemSource {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIActivityItemProvider;
unsafe impl ClassType for UIActivityItemProvider {
#[inherits(NSObject)]
type Super = NSOperation;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for UIActivityItemProvider {}
unsafe impl UIActivityItemSource for UIActivityItemProvider {}
extern_methods!(
unsafe impl UIActivityItemProvider {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithPlaceholderItem:)]
pub unsafe fn initWithPlaceholderItem(
this: Allocated<Self>,
placeholder_item: &AnyObject,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other placeholderItem)]
pub unsafe fn placeholderItem(&self) -> Option<Retained<AnyObject>>;
#[cfg(feature = "UIActivity")]
#[method_id(@__retain_semantics Other activityType)]
pub unsafe fn activityType(&self) -> Option<Retained<UIActivityType>>;
#[method_id(@__retain_semantics Other item)]
pub unsafe fn item(&self) -> Retained<AnyObject>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIActivityItemProvider {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,157 @@
//! 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 UIActivityItemsConfiguration;
unsafe impl ClassType for UIActivityItemsConfiguration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UIActivityItemsConfiguration {}
#[cfg(feature = "UIActivityItemsConfigurationReading")]
unsafe impl UIActivityItemsConfigurationReading for UIActivityItemsConfiguration {}
extern_methods!(
unsafe impl UIActivityItemsConfiguration {
#[method_id(@__retain_semantics Other localObject)]
pub unsafe fn localObject(&self) -> Option<Retained<AnyObject>>;
#[method(setLocalObject:)]
pub unsafe fn setLocalObject(&self, local_object: Option<&AnyObject>);
#[cfg(feature = "UIActivityItemsConfigurationReading")]
#[method_id(@__retain_semantics Other supportedInteractions)]
pub unsafe fn supportedInteractions(
&self,
) -> Retained<NSArray<UIActivityItemsConfigurationInteraction>>;
#[cfg(feature = "UIActivityItemsConfigurationReading")]
#[method(setSupportedInteractions:)]
pub unsafe fn setSupportedInteractions(
&self,
supported_interactions: &NSArray<UIActivityItemsConfigurationInteraction>,
);
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(metadataProvider)]
pub unsafe fn metadataProvider(
&self,
) -> *mut block2::Block<
dyn Fn(NonNull<UIActivityItemsConfigurationMetadataKey>) -> *mut AnyObject,
>;
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(setMetadataProvider:)]
pub unsafe fn setMetadataProvider(
&self,
metadata_provider: Option<
&block2::Block<
dyn Fn(NonNull<UIActivityItemsConfigurationMetadataKey>) -> *mut AnyObject,
>,
>,
);
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(perItemMetadataProvider)]
pub unsafe fn perItemMetadataProvider(
&self,
) -> *mut block2::Block<
dyn Fn(NSInteger, NonNull<UIActivityItemsConfigurationMetadataKey>) -> *mut AnyObject,
>;
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(setPerItemMetadataProvider:)]
pub unsafe fn setPerItemMetadataProvider(
&self,
per_item_metadata_provider: Option<
&block2::Block<
dyn Fn(
NSInteger,
NonNull<UIActivityItemsConfigurationMetadataKey>,
) -> *mut AnyObject,
>,
>,
);
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(previewProvider)]
pub unsafe fn previewProvider(
&self,
) -> *mut block2::Block<
dyn Fn(
NSInteger,
NonNull<UIActivityItemsConfigurationPreviewIntent>,
CGSize,
) -> *mut NSItemProvider,
>;
#[cfg(all(feature = "UIActivityItemsConfigurationReading", feature = "block2"))]
#[method(setPreviewProvider:)]
pub unsafe fn setPreviewProvider(
&self,
preview_provider: Option<
&block2::Block<
dyn Fn(
NSInteger,
NonNull<UIActivityItemsConfigurationPreviewIntent>,
CGSize,
) -> *mut NSItemProvider,
>,
>,
);
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[method(applicationActivitiesProvider)]
pub unsafe fn applicationActivitiesProvider(
&self,
) -> *mut block2::Block<dyn Fn() -> NonNull<NSArray<UIActivity>>>;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[method(setApplicationActivitiesProvider:)]
pub unsafe fn setApplicationActivitiesProvider(
&self,
application_activities_provider: Option<
&block2::Block<dyn Fn() -> NonNull<NSArray<UIActivity>>>,
>,
);
#[method_id(@__retain_semantics Other activityItemsConfigurationWithObjects:)]
pub unsafe fn activityItemsConfigurationWithObjects(
objects: &NSArray<ProtocolObject<dyn NSItemProviderWriting>>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other activityItemsConfigurationWithItemProviders:)]
pub unsafe fn activityItemsConfigurationWithItemProviders(
item_providers: &NSArray<NSItemProvider>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithObjects:)]
pub unsafe fn initWithObjects(
this: Allocated<Self>,
objects: &NSArray<ProtocolObject<dyn NSItemProviderWriting>>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithItemProviders:)]
pub unsafe fn initWithItemProviders(
this: Allocated<Self>,
item_providers: &NSArray<NSItemProvider>,
) -> Retained<Self>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,113 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityItemsConfigurationMetadataKey = NSString;
extern "C" {
pub static UIActivityItemsConfigurationMetadataKeyTitle:
&'static UIActivityItemsConfigurationMetadataKey;
}
extern "C" {
pub static UIActivityItemsConfigurationMetadataKeyMessageBody:
&'static UIActivityItemsConfigurationMetadataKey;
}
extern "C" {
pub static UIActivityItemsConfigurationMetadataKeyLinkPresentationMetadata:
&'static UIActivityItemsConfigurationMetadataKey;
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityItemsConfigurationPreviewIntent = NSString;
extern "C" {
pub static UIActivityItemsConfigurationPreviewIntentFullSize:
&'static UIActivityItemsConfigurationPreviewIntent;
}
extern "C" {
pub static UIActivityItemsConfigurationPreviewIntentThumbnail:
&'static UIActivityItemsConfigurationPreviewIntent;
}
// NS_TYPED_EXTENSIBLE_ENUM
pub type UIActivityItemsConfigurationInteraction = NSString;
extern "C" {
pub static UIActivityItemsConfigurationInteractionShare:
&'static UIActivityItemsConfigurationInteraction;
}
extern "C" {
pub static UIActivityItemsConfigurationInteractionCopy:
&'static UIActivityItemsConfigurationInteraction;
}
extern_protocol!(
pub unsafe trait UIActivityItemsConfigurationReading:
NSObjectProtocol + IsMainThreadOnly
{
#[method_id(@__retain_semantics Other itemProvidersForActivityItemsConfiguration)]
unsafe fn itemProvidersForActivityItemsConfiguration(
&self,
) -> Retained<NSArray<NSItemProvider>>;
#[optional]
#[method(activityItemsConfigurationSupportsInteraction:)]
unsafe fn activityItemsConfigurationSupportsInteraction(
&self,
interaction: &UIActivityItemsConfigurationInteraction,
) -> bool;
#[optional]
#[method_id(@__retain_semantics Other activityItemsConfigurationMetadataForKey:)]
unsafe fn activityItemsConfigurationMetadataForKey(
&self,
key: &UIActivityItemsConfigurationMetadataKey,
) -> Option<Retained<AnyObject>>;
#[optional]
#[method_id(@__retain_semantics Other activityItemsConfigurationMetadataForItemAtIndex:key:)]
unsafe fn activityItemsConfigurationMetadataForItemAtIndex_key(
&self,
index: NSInteger,
key: &UIActivityItemsConfigurationMetadataKey,
) -> Option<Retained<AnyObject>>;
#[optional]
#[method_id(@__retain_semantics Other activityItemsConfigurationPreviewForItemAtIndex:intent:suggestedSize:)]
unsafe fn activityItemsConfigurationPreviewForItemAtIndex_intent_suggestedSize(
&self,
index: NSInteger,
intent: &UIActivityItemsConfigurationPreviewIntent,
suggested_size: CGSize,
) -> Option<Retained<NSItemProvider>>;
#[cfg(feature = "UIActivity")]
#[optional]
#[method_id(@__retain_semantics Other applicationActivitiesForActivityItemsConfiguration)]
unsafe fn applicationActivitiesForActivityItemsConfiguration(
&self,
) -> Option<Retained<NSArray<UIActivity>>>;
}
unsafe impl ProtocolType for dyn UIActivityItemsConfigurationReading {}
);
extern_protocol!(
pub unsafe trait UIActivityItemsConfigurationProviding: NSObjectProtocol {
#[method_id(@__retain_semantics Other activityItemsConfiguration)]
unsafe fn activityItemsConfiguration(
&self,
mtm: MainThreadMarker,
) -> Option<Retained<ProtocolObject<dyn UIActivityItemsConfigurationReading>>>;
}
unsafe impl ProtocolType for dyn UIActivityItemsConfigurationProviding {}
);

View File

@@ -0,0 +1,154 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
pub type UIActivityViewControllerCompletionHandler =
*mut block2::Block<dyn Fn(*mut UIActivityType, Bool)>;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
pub type UIActivityViewControllerCompletionWithItemsHandler =
*mut block2::Block<dyn Fn(*mut UIActivityType, Bool, *mut NSArray, *mut NSError)>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UIActivityViewController;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl ClassType for UIActivityViewController {
#[inherits(UIResponder, NSObject)]
type Super = UIViewController;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSCoding for UIActivityViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSObjectProtocol for UIActivityViewController {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIAppearanceContainer for UIActivityViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIContentContainer for UIActivityViewController {}
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIFocusEnvironment for UIActivityViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIResponderStandardEditActions for UIActivityViewController {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
unsafe impl UITraitEnvironment for UIActivityViewController {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIActivityViewController {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithNibName:bundle:)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(feature = "UIActivity")]
#[method_id(@__retain_semantics Init initWithActivityItems:applicationActivities:)]
pub unsafe fn initWithActivityItems_applicationActivities(
this: Allocated<Self>,
activity_items: &NSArray,
application_activities: Option<&NSArray<UIActivity>>,
) -> Retained<Self>;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[deprecated]
#[method(completionHandler)]
pub unsafe fn completionHandler(&self) -> UIActivityViewControllerCompletionHandler;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[deprecated]
#[method(setCompletionHandler:)]
pub unsafe fn setCompletionHandler(
&self,
completion_handler: UIActivityViewControllerCompletionHandler,
);
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[method(completionWithItemsHandler)]
pub unsafe fn completionWithItemsHandler(
&self,
) -> UIActivityViewControllerCompletionWithItemsHandler;
#[cfg(all(feature = "UIActivity", feature = "block2"))]
#[method(setCompletionWithItemsHandler:)]
pub unsafe fn setCompletionWithItemsHandler(
&self,
completion_with_items_handler: UIActivityViewControllerCompletionWithItemsHandler,
);
#[cfg(feature = "UIActivity")]
#[method_id(@__retain_semantics Other excludedActivityTypes)]
pub unsafe fn excludedActivityTypes(&self) -> Option<Retained<NSArray<UIActivityType>>>;
#[cfg(feature = "UIActivity")]
#[method(setExcludedActivityTypes:)]
pub unsafe fn setExcludedActivityTypes(
&self,
excluded_activity_types: Option<&NSArray<UIActivityType>>,
);
#[method(allowsProminentActivity)]
pub unsafe fn allowsProminentActivity(&self) -> bool;
#[method(setAllowsProminentActivity:)]
pub unsafe fn setAllowsProminentActivity(&self, allows_prominent_activity: bool);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIActivityViewController {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// UIActivityItemsConfiguration
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIActivityViewController {
#[cfg(feature = "UIActivityItemsConfigurationReading")]
#[method_id(@__retain_semantics Init initWithActivityItemsConfiguration:)]
pub unsafe fn initWithActivityItemsConfiguration(
this: Allocated<Self>,
activity_items_configuration: &ProtocolObject<dyn UIActivityItemsConfigurationReading>,
) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,2 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

View File

@@ -0,0 +1,267 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAlertActionStyle(pub NSInteger);
impl UIAlertActionStyle {
#[doc(alias = "UIAlertActionStyleDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "UIAlertActionStyleCancel")]
pub const Cancel: Self = Self(1);
#[doc(alias = "UIAlertActionStyleDestructive")]
pub const Destructive: Self = Self(2);
}
unsafe impl Encode for UIAlertActionStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAlertActionStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAlertControllerStyle(pub NSInteger);
impl UIAlertControllerStyle {
#[doc(alias = "UIAlertControllerStyleActionSheet")]
pub const ActionSheet: Self = Self(0);
#[doc(alias = "UIAlertControllerStyleAlert")]
pub const Alert: Self = Self(1);
}
unsafe impl Encode for UIAlertControllerStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAlertControllerStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAlertControllerSeverity(pub NSInteger);
impl UIAlertControllerSeverity {
#[doc(alias = "UIAlertControllerSeverityDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "UIAlertControllerSeverityCritical")]
pub const Critical: Self = Self(1);
}
unsafe impl Encode for UIAlertControllerSeverity {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAlertControllerSeverity {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIAlertAction;
unsafe impl ClassType for UIAlertAction {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCopying for UIAlertAction {}
unsafe impl NSObjectProtocol for UIAlertAction {}
extern_methods!(
unsafe impl UIAlertAction {
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Other actionWithTitle:style:handler:)]
pub unsafe fn actionWithTitle_style_handler(
title: Option<&NSString>,
style: UIAlertActionStyle,
handler: Option<&block2::Block<dyn Fn(NonNull<UIAlertAction>)>>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(style)]
pub unsafe fn style(&self) -> UIAlertActionStyle;
#[method(isEnabled)]
pub unsafe fn isEnabled(&self) -> bool;
#[method(setEnabled:)]
pub unsafe fn setEnabled(&self, enabled: bool);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIAlertAction {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UIAlertController;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl ClassType for UIAlertController {
#[inherits(UIResponder, NSObject)]
type Super = UIViewController;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSCoding for UIAlertController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSObjectProtocol for UIAlertController {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIAppearanceContainer for UIAlertController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIContentContainer for UIAlertController {}
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIFocusEnvironment for UIAlertController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIResponderStandardEditActions for UIAlertController {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
unsafe impl UITraitEnvironment for UIAlertController {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIAlertController {
#[method_id(@__retain_semantics Other alertControllerWithTitle:message:preferredStyle:)]
pub unsafe fn alertControllerWithTitle_message_preferredStyle(
title: Option<&NSString>,
message: Option<&NSString>,
preferred_style: UIAlertControllerStyle,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method(addAction:)]
pub unsafe fn addAction(&self, action: &UIAlertAction);
#[method_id(@__retain_semantics Other actions)]
pub unsafe fn actions(&self) -> Retained<NSArray<UIAlertAction>>;
#[method_id(@__retain_semantics Other preferredAction)]
pub unsafe fn preferredAction(&self) -> Option<Retained<UIAlertAction>>;
#[method(setPreferredAction:)]
pub unsafe fn setPreferredAction(&self, preferred_action: Option<&UIAlertAction>);
#[cfg(all(
feature = "UIControl",
feature = "UITextField",
feature = "UIView",
feature = "block2"
))]
#[method(addTextFieldWithConfigurationHandler:)]
pub unsafe fn addTextFieldWithConfigurationHandler(
&self,
configuration_handler: Option<&block2::Block<dyn Fn(NonNull<UITextField>)>>,
);
#[cfg(all(feature = "UIControl", feature = "UITextField", feature = "UIView"))]
#[method_id(@__retain_semantics Other textFields)]
pub unsafe fn textFields(&self) -> Option<Retained<NSArray<UITextField>>>;
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: Option<&NSString>);
#[method_id(@__retain_semantics Other message)]
pub unsafe fn message(&self) -> Option<Retained<NSString>>;
#[method(setMessage:)]
pub unsafe fn setMessage(&self, message: Option<&NSString>);
#[method(preferredStyle)]
pub unsafe fn preferredStyle(&self) -> UIAlertControllerStyle;
#[method(severity)]
pub unsafe fn severity(&self) -> UIAlertControllerSeverity;
#[method(setSeverity:)]
pub unsafe fn setSeverity(&self, severity: UIAlertControllerSeverity);
}
);
extern_methods!(
/// Methods declared on superclass `UIViewController`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIAlertController {
#[method_id(@__retain_semantics Init initWithNibName:bundle:)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIAlertController {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// SpringLoading
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIAlertController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UISpringLoadedInteractionSupporting",
feature = "UIViewController"
))]
unsafe impl UISpringLoadedInteractionSupporting for UIAlertController {}

View File

@@ -0,0 +1,263 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAlertViewStyle(pub NSInteger);
impl UIAlertViewStyle {
#[doc(alias = "UIAlertViewStyleDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "UIAlertViewStyleSecureTextInput")]
pub const SecureTextInput: Self = Self(1);
#[doc(alias = "UIAlertViewStylePlainTextInput")]
pub const PlainTextInput: Self = Self(2);
#[doc(alias = "UIAlertViewStyleLoginAndPasswordInput")]
pub const LoginAndPasswordInput: Self = Self(3);
}
unsafe impl Encode for UIAlertViewStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAlertViewStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
pub struct UIAlertView;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UIAlertView {
#[inherits(UIResponder, NSObject)]
type Super = UIView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIAlertView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIAlertView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIAlertView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UIAlertView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UIAlertView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIAlertView {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UIAlertView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UIAlertView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UIAlertView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UIAlertView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIAlertView {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIAlertView {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAlertView {
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(setDelegate:)]
pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Retained<NSString>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: &NSString);
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Other message)]
pub unsafe fn message(&self) -> Option<Retained<NSString>>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(setMessage:)]
pub unsafe fn setMessage(&self, message: Option<&NSString>);
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(addButtonWithTitle:)]
pub unsafe fn addButtonWithTitle(&self, title: Option<&NSString>) -> NSInteger;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method_id(@__retain_semantics Other buttonTitleAtIndex:)]
pub unsafe fn buttonTitleAtIndex(
&self,
button_index: NSInteger,
) -> Option<Retained<NSString>>;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(numberOfButtons)]
pub unsafe fn numberOfButtons(&self) -> NSInteger;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(cancelButtonIndex)]
pub unsafe fn cancelButtonIndex(&self) -> NSInteger;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(setCancelButtonIndex:)]
pub unsafe fn setCancelButtonIndex(&self, cancel_button_index: NSInteger);
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(firstOtherButtonIndex)]
pub unsafe fn firstOtherButtonIndex(&self) -> NSInteger;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(isVisible)]
pub unsafe fn isVisible(&self) -> bool;
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(show)]
pub unsafe fn show(&self);
#[deprecated = "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead"]
#[method(dismissWithClickedButtonIndex:animated:)]
pub unsafe fn dismissWithClickedButtonIndex_animated(
&self,
button_index: NSInteger,
animated: bool,
);
#[method(alertViewStyle)]
pub unsafe fn alertViewStyle(&self) -> UIAlertViewStyle;
#[method(setAlertViewStyle:)]
pub unsafe fn setAlertViewStyle(&self, alert_view_style: UIAlertViewStyle);
#[cfg(all(feature = "UIControl", feature = "UITextField"))]
#[method_id(@__retain_semantics Other textFieldAtIndex:)]
pub unsafe fn textFieldAtIndex(
&self,
text_field_index: NSInteger,
) -> Option<Retained<UITextField>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAlertView {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait UIAlertViewDelegate: NSObjectProtocol + IsMainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(alertView:clickedButtonAtIndex:)]
unsafe fn alertView_clickedButtonAtIndex(
&self,
alert_view: &UIAlertView,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(alertViewCancel:)]
unsafe fn alertViewCancel(&self, alert_view: &UIAlertView);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(willPresentAlertView:)]
unsafe fn willPresentAlertView(&self, alert_view: &UIAlertView);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(didPresentAlertView:)]
unsafe fn didPresentAlertView(&self, alert_view: &UIAlertView);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(alertView:willDismissWithButtonIndex:)]
unsafe fn alertView_willDismissWithButtonIndex(
&self,
alert_view: &UIAlertView,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(alertView:didDismissWithButtonIndex:)]
unsafe fn alertView_didDismissWithButtonIndex(
&self,
alert_view: &UIAlertView,
button_index: NSInteger,
);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[deprecated = "Use UIAlertController instead."]
#[optional]
#[method(alertViewShouldEnableFirstOtherButton:)]
unsafe fn alertViewShouldEnableFirstOtherButton(&self, alert_view: &UIAlertView) -> bool;
}
unsafe impl ProtocolType for dyn UIAlertViewDelegate {}
);

View File

@@ -0,0 +1,42 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIAppearanceContainer: NSObjectProtocol + IsMainThreadOnly {}
unsafe impl ProtocolType for dyn UIAppearanceContainer {}
);
extern_protocol!(
pub unsafe trait UIAppearance: NSObjectProtocol + IsMainThreadOnly {
#[method_id(@__retain_semantics Other appearance)]
unsafe fn appearance(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other appearanceWhenContainedInInstancesOfClasses:)]
unsafe fn appearanceWhenContainedInInstancesOfClasses(
container_types: &NSArray<TodoClass>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Other appearanceForTraitCollection:)]
unsafe fn appearanceForTraitCollection(
r#trait: &UITraitCollection,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Other appearanceForTraitCollection:whenContainedInInstancesOfClasses:)]
unsafe fn appearanceForTraitCollection_whenContainedInInstancesOfClasses(
r#trait: &UITraitCollection,
container_types: &NSArray<TodoClass>,
mtm: MainThreadMarker,
) -> Retained<Self>;
}
unsafe impl ProtocolType for dyn UIAppearance {}
);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,283 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIApplicationShortcutIconType(pub NSInteger);
impl UIApplicationShortcutIconType {
#[doc(alias = "UIApplicationShortcutIconTypeCompose")]
pub const Compose: Self = Self(0);
#[doc(alias = "UIApplicationShortcutIconTypePlay")]
pub const Play: Self = Self(1);
#[doc(alias = "UIApplicationShortcutIconTypePause")]
pub const Pause: Self = Self(2);
#[doc(alias = "UIApplicationShortcutIconTypeAdd")]
pub const Add: Self = Self(3);
#[doc(alias = "UIApplicationShortcutIconTypeLocation")]
pub const Location: Self = Self(4);
#[doc(alias = "UIApplicationShortcutIconTypeSearch")]
pub const Search: Self = Self(5);
#[doc(alias = "UIApplicationShortcutIconTypeShare")]
pub const Share: Self = Self(6);
#[doc(alias = "UIApplicationShortcutIconTypeProhibit")]
pub const Prohibit: Self = Self(7);
#[doc(alias = "UIApplicationShortcutIconTypeContact")]
pub const Contact: Self = Self(8);
#[doc(alias = "UIApplicationShortcutIconTypeHome")]
pub const Home: Self = Self(9);
#[doc(alias = "UIApplicationShortcutIconTypeMarkLocation")]
pub const MarkLocation: Self = Self(10);
#[doc(alias = "UIApplicationShortcutIconTypeFavorite")]
pub const Favorite: Self = Self(11);
#[doc(alias = "UIApplicationShortcutIconTypeLove")]
pub const Love: Self = Self(12);
#[doc(alias = "UIApplicationShortcutIconTypeCloud")]
pub const Cloud: Self = Self(13);
#[doc(alias = "UIApplicationShortcutIconTypeInvitation")]
pub const Invitation: Self = Self(14);
#[doc(alias = "UIApplicationShortcutIconTypeConfirmation")]
pub const Confirmation: Self = Self(15);
#[doc(alias = "UIApplicationShortcutIconTypeMail")]
pub const Mail: Self = Self(16);
#[doc(alias = "UIApplicationShortcutIconTypeMessage")]
pub const Message: Self = Self(17);
#[doc(alias = "UIApplicationShortcutIconTypeDate")]
pub const Date: Self = Self(18);
#[doc(alias = "UIApplicationShortcutIconTypeTime")]
pub const Time: Self = Self(19);
#[doc(alias = "UIApplicationShortcutIconTypeCapturePhoto")]
pub const CapturePhoto: Self = Self(20);
#[doc(alias = "UIApplicationShortcutIconTypeCaptureVideo")]
pub const CaptureVideo: Self = Self(21);
#[doc(alias = "UIApplicationShortcutIconTypeTask")]
pub const Task: Self = Self(22);
#[doc(alias = "UIApplicationShortcutIconTypeTaskCompleted")]
pub const TaskCompleted: Self = Self(23);
#[doc(alias = "UIApplicationShortcutIconTypeAlarm")]
pub const Alarm: Self = Self(24);
#[doc(alias = "UIApplicationShortcutIconTypeBookmark")]
pub const Bookmark: Self = Self(25);
#[doc(alias = "UIApplicationShortcutIconTypeShuffle")]
pub const Shuffle: Self = Self(26);
#[doc(alias = "UIApplicationShortcutIconTypeAudio")]
pub const Audio: Self = Self(27);
#[doc(alias = "UIApplicationShortcutIconTypeUpdate")]
pub const Update: Self = Self(28);
}
unsafe impl Encode for UIApplicationShortcutIconType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIApplicationShortcutIconType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIApplicationShortcutIcon;
unsafe impl ClassType for UIApplicationShortcutIcon {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCopying for UIApplicationShortcutIcon {}
unsafe impl NSObjectProtocol for UIApplicationShortcutIcon {}
extern_methods!(
unsafe impl UIApplicationShortcutIcon {
#[method_id(@__retain_semantics Other iconWithType:)]
pub unsafe fn iconWithType(r#type: UIApplicationShortcutIconType) -> Retained<Self>;
#[method_id(@__retain_semantics Other iconWithTemplateImageName:)]
pub unsafe fn iconWithTemplateImageName(template_image_name: &NSString) -> Retained<Self>;
#[method_id(@__retain_semantics Other iconWithSystemImageName:)]
pub unsafe fn iconWithSystemImageName(system_image_name: &NSString) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIApplicationShortcutIcon {
#[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 UIApplicationShortcutItem;
unsafe impl ClassType for UIApplicationShortcutItem {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCopying for UIApplicationShortcutItem {}
unsafe impl NSMutableCopying for UIApplicationShortcutItem {}
unsafe impl NSObjectProtocol for UIApplicationShortcutItem {}
extern_methods!(
unsafe impl UIApplicationShortcutItem {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithType:localizedTitle:localizedSubtitle:icon:userInfo:)]
pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
this: Allocated<Self>,
r#type: &NSString,
localized_title: &NSString,
localized_subtitle: Option<&NSString>,
icon: Option<&UIApplicationShortcutIcon>,
user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithType:localizedTitle:)]
pub unsafe fn initWithType_localizedTitle(
this: Allocated<Self>,
r#type: &NSString,
localized_title: &NSString,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other type)]
pub unsafe fn r#type(&self) -> Retained<NSString>;
#[method_id(@__retain_semantics Other localizedTitle)]
pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
#[method_id(@__retain_semantics Other localizedSubtitle)]
pub unsafe fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
#[method_id(@__retain_semantics Other icon)]
pub unsafe fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
#[method_id(@__retain_semantics Other userInfo)]
pub unsafe fn userInfo(
&self,
) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
#[method_id(@__retain_semantics Other targetContentIdentifier)]
pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIApplicationShortcutItem {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIMutableApplicationShortcutItem;
unsafe impl ClassType for UIMutableApplicationShortcutItem {
#[inherits(NSObject)]
type Super = UIApplicationShortcutItem;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCopying for UIMutableApplicationShortcutItem {}
unsafe impl NSMutableCopying for UIMutableApplicationShortcutItem {}
unsafe impl NSObjectProtocol for UIMutableApplicationShortcutItem {}
extern_methods!(
unsafe impl UIMutableApplicationShortcutItem {
#[method_id(@__retain_semantics Other type)]
pub unsafe fn r#type(&self) -> Retained<NSString>;
#[method(setType:)]
pub unsafe fn setType(&self, r#type: &NSString);
#[method_id(@__retain_semantics Other localizedTitle)]
pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
#[method(setLocalizedTitle:)]
pub unsafe fn setLocalizedTitle(&self, localized_title: &NSString);
#[method_id(@__retain_semantics Other localizedSubtitle)]
pub unsafe fn localizedSubtitle(&self) -> Option<Retained<NSString>>;
#[method(setLocalizedSubtitle:)]
pub unsafe fn setLocalizedSubtitle(&self, localized_subtitle: Option<&NSString>);
#[method_id(@__retain_semantics Other icon)]
pub unsafe fn icon(&self) -> Option<Retained<UIApplicationShortcutIcon>>;
#[method(setIcon:)]
pub unsafe fn setIcon(&self, icon: Option<&UIApplicationShortcutIcon>);
#[method_id(@__retain_semantics Other userInfo)]
pub unsafe fn userInfo(
&self,
) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>>;
#[method(setUserInfo:)]
pub unsafe fn setUserInfo(
&self,
user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
);
#[method_id(@__retain_semantics Other targetContentIdentifier)]
pub unsafe fn targetContentIdentifier(&self) -> Option<Retained<AnyObject>>;
#[method(setTargetContentIdentifier:)]
pub unsafe fn setTargetContentIdentifier(
&self,
target_content_identifier: Option<&AnyObject>,
);
}
);
extern_methods!(
/// Methods declared on superclass `UIApplicationShortcutItem`
unsafe impl UIMutableApplicationShortcutItem {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithType:localizedTitle:localizedSubtitle:icon:userInfo:)]
pub unsafe fn initWithType_localizedTitle_localizedSubtitle_icon_userInfo(
this: Allocated<Self>,
r#type: &NSString,
localized_title: &NSString,
localized_subtitle: Option<&NSString>,
icon: Option<&UIApplicationShortcutIcon>,
user_info: Option<&NSDictionary<NSString, ProtocolObject<dyn NSSecureCoding>>>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithType:localizedTitle:)]
pub unsafe fn initWithType_localizedTitle(
this: Allocated<Self>,
r#type: &NSString,
localized_title: &NSString,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIMutableApplicationShortcutItem {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,206 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIAttachmentBehaviorType(pub NSInteger);
impl UIAttachmentBehaviorType {
#[doc(alias = "UIAttachmentBehaviorTypeItems")]
pub const Items: Self = Self(0);
#[doc(alias = "UIAttachmentBehaviorTypeAnchor")]
pub const Anchor: Self = Self(1);
}
unsafe impl Encode for UIAttachmentBehaviorType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIAttachmentBehaviorType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct UIFloatRange {
pub minimum: CGFloat,
pub maximum: CGFloat,
}
unsafe impl Encode for UIFloatRange {
const ENCODING: Encoding = Encoding::Struct("?", &[<CGFloat>::ENCODING, <CGFloat>::ENCODING]);
}
unsafe impl RefEncode for UIFloatRange {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
unsafe impl Send for UIFloatRange {}
unsafe impl Sync for UIFloatRange {}
extern "C" {
pub static UIFloatRangeZero: UIFloatRange;
}
extern "C" {
pub static UIFloatRangeInfinite: UIFloatRange;
}
extern "C" {
pub fn UIFloatRangeIsInfinite(range: UIFloatRange) -> Bool;
}
// TODO: pub fn UIFloatRangeMake(minimum: CGFloat,maximum: CGFloat,) -> UIFloatRange;
// TODO: pub fn UIFloatRangeIsEqualToRange(range: UIFloatRange,other_range: UIFloatRange,) -> Bool;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIDynamicBehavior")]
pub struct UIAttachmentBehavior;
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl ClassType for UIAttachmentBehavior {
#[inherits(NSObject)]
type Super = UIDynamicBehavior;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl NSObjectProtocol for UIAttachmentBehavior {}
extern_methods!(
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl UIAttachmentBehavior {
#[method_id(@__retain_semantics Init initWithItem:attachedToAnchor:)]
pub unsafe fn initWithItem_attachedToAnchor(
this: Allocated<Self>,
item: &ProtocolObject<dyn UIDynamicItem>,
point: CGPoint,
) -> Retained<Self>;
#[cfg(feature = "UIGeometry")]
#[method_id(@__retain_semantics Init initWithItem:offsetFromCenter:attachedToAnchor:)]
pub unsafe fn initWithItem_offsetFromCenter_attachedToAnchor(
this: Allocated<Self>,
item: &ProtocolObject<dyn UIDynamicItem>,
offset: UIOffset,
point: CGPoint,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithItem:attachedToItem:)]
pub unsafe fn initWithItem_attachedToItem(
this: Allocated<Self>,
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
) -> Retained<Self>;
#[cfg(feature = "UIGeometry")]
#[method_id(@__retain_semantics Init initWithItem:offsetFromCenter:attachedToItem:offsetFromCenter:)]
pub unsafe fn initWithItem_offsetFromCenter_attachedToItem_offsetFromCenter(
this: Allocated<Self>,
item1: &ProtocolObject<dyn UIDynamicItem>,
offset1: UIOffset,
item2: &ProtocolObject<dyn UIDynamicItem>,
offset2: UIOffset,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other slidingAttachmentWithItem:attachedToItem:attachmentAnchor:axisOfTranslation:)]
pub unsafe fn slidingAttachmentWithItem_attachedToItem_attachmentAnchor_axisOfTranslation(
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
point: CGPoint,
axis: CGVector,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other slidingAttachmentWithItem:attachmentAnchor:axisOfTranslation:)]
pub unsafe fn slidingAttachmentWithItem_attachmentAnchor_axisOfTranslation(
item: &ProtocolObject<dyn UIDynamicItem>,
point: CGPoint,
axis: CGVector,
) -> Retained<Self>;
#[cfg(feature = "UIGeometry")]
#[method_id(@__retain_semantics Other limitAttachmentWithItem:offsetFromCenter:attachedToItem:offsetFromCenter:)]
pub unsafe fn limitAttachmentWithItem_offsetFromCenter_attachedToItem_offsetFromCenter(
item1: &ProtocolObject<dyn UIDynamicItem>,
offset1: UIOffset,
item2: &ProtocolObject<dyn UIDynamicItem>,
offset2: UIOffset,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other fixedAttachmentWithItem:attachedToItem:attachmentAnchor:)]
pub unsafe fn fixedAttachmentWithItem_attachedToItem_attachmentAnchor(
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
point: CGPoint,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other pinAttachmentWithItem:attachedToItem:attachmentAnchor:)]
pub unsafe fn pinAttachmentWithItem_attachedToItem_attachmentAnchor(
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
point: CGPoint,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other items)]
pub unsafe fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;
#[method(attachedBehaviorType)]
pub unsafe fn attachedBehaviorType(&self) -> UIAttachmentBehaviorType;
#[method(anchorPoint)]
pub unsafe fn anchorPoint(&self) -> CGPoint;
#[method(setAnchorPoint:)]
pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint);
#[method(length)]
pub unsafe fn length(&self) -> CGFloat;
#[method(setLength:)]
pub unsafe fn setLength(&self, length: CGFloat);
#[method(damping)]
pub unsafe fn damping(&self) -> CGFloat;
#[method(setDamping:)]
pub unsafe fn setDamping(&self, damping: CGFloat);
#[method(frequency)]
pub unsafe fn frequency(&self) -> CGFloat;
#[method(setFrequency:)]
pub unsafe fn setFrequency(&self, frequency: CGFloat);
#[method(frictionTorque)]
pub unsafe fn frictionTorque(&self) -> CGFloat;
#[method(setFrictionTorque:)]
pub unsafe fn setFrictionTorque(&self, friction_torque: CGFloat);
#[method(attachmentRange)]
pub unsafe fn attachmentRange(&self) -> UIFloatRange;
#[method(setAttachmentRange:)]
pub unsafe fn setAttachmentRange(&self, attachment_range: UIFloatRange);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl UIAttachmentBehavior {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,205 @@
//! 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 UIBackgroundConfiguration;
unsafe impl ClassType for UIBackgroundConfiguration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIBackgroundConfiguration {}
unsafe impl NSCopying for UIBackgroundConfiguration {}
unsafe impl NSObjectProtocol for UIBackgroundConfiguration {}
unsafe impl NSSecureCoding for UIBackgroundConfiguration {}
extern_methods!(
unsafe impl UIBackgroundConfiguration {
#[method_id(@__retain_semantics Other clearConfiguration)]
pub unsafe fn clearConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listPlainCellConfiguration)]
pub unsafe fn listPlainCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listPlainHeaderFooterConfiguration)]
pub unsafe fn listPlainHeaderFooterConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listGroupedCellConfiguration)]
pub unsafe fn listGroupedCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listGroupedHeaderFooterConfiguration)]
pub unsafe fn listGroupedHeaderFooterConfiguration(mtm: MainThreadMarker)
-> Retained<Self>;
#[method_id(@__retain_semantics Other listSidebarHeaderConfiguration)]
pub unsafe fn listSidebarHeaderConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listSidebarCellConfiguration)]
pub unsafe fn listSidebarCellConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other listAccompaniedSidebarCellConfiguration)]
pub unsafe fn listAccompaniedSidebarCellConfiguration(
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "UIConfigurationState")]
#[method_id(@__retain_semantics Other updatedConfigurationForState:)]
pub unsafe fn updatedConfigurationForState(
&self,
state: &ProtocolObject<dyn UIConfigurationState>,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other customView)]
pub unsafe fn customView(&self) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method(setCustomView:)]
pub unsafe fn setCustomView(&self, custom_view: Option<&UIView>);
#[method(cornerRadius)]
pub unsafe fn cornerRadius(&self) -> CGFloat;
#[method(setCornerRadius:)]
pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
#[cfg(feature = "UIGeometry")]
#[method(backgroundInsets)]
pub unsafe fn backgroundInsets(&self) -> NSDirectionalEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setBackgroundInsets:)]
pub unsafe fn setBackgroundInsets(&self, background_insets: NSDirectionalEdgeInsets);
#[cfg(feature = "UIGeometry")]
#[method(edgesAddingLayoutMarginsToBackgroundInsets)]
pub unsafe fn edgesAddingLayoutMarginsToBackgroundInsets(&self) -> NSDirectionalRectEdge;
#[cfg(feature = "UIGeometry")]
#[method(setEdgesAddingLayoutMarginsToBackgroundInsets:)]
pub unsafe fn setEdgesAddingLayoutMarginsToBackgroundInsets(
&self,
edges_adding_layout_margins_to_background_insets: NSDirectionalRectEdge,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(backgroundColorTransformer)]
pub unsafe fn backgroundColorTransformer(&self) -> UIConfigurationColorTransformer;
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(setBackgroundColorTransformer:)]
pub unsafe fn setBackgroundColorTransformer(
&self,
background_color_transformer: UIConfigurationColorTransformer,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other resolvedBackgroundColorForTintColor:)]
pub unsafe fn resolvedBackgroundColorForTintColor(
&self,
tint_color: &UIColor,
) -> Retained<UIColor>;
#[cfg(feature = "UIVisualEffect")]
#[method_id(@__retain_semantics Other visualEffect)]
pub unsafe fn visualEffect(&self) -> Option<Retained<UIVisualEffect>>;
#[cfg(feature = "UIVisualEffect")]
#[method(setVisualEffect:)]
pub unsafe fn setVisualEffect(&self, visual_effect: Option<&UIVisualEffect>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[cfg(feature = "UIView")]
#[method(imageContentMode)]
pub unsafe fn imageContentMode(&self) -> UIViewContentMode;
#[cfg(feature = "UIView")]
#[method(setImageContentMode:)]
pub unsafe fn setImageContentMode(&self, image_content_mode: UIViewContentMode);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other strokeColor)]
pub unsafe fn strokeColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setStrokeColor:)]
pub unsafe fn setStrokeColor(&self, stroke_color: Option<&UIColor>);
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(strokeColorTransformer)]
pub unsafe fn strokeColorTransformer(&self) -> UIConfigurationColorTransformer;
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(setStrokeColorTransformer:)]
pub unsafe fn setStrokeColorTransformer(
&self,
stroke_color_transformer: UIConfigurationColorTransformer,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other resolvedStrokeColorForTintColor:)]
pub unsafe fn resolvedStrokeColorForTintColor(
&self,
tint_color: &UIColor,
) -> Retained<UIColor>;
#[method(strokeWidth)]
pub unsafe fn strokeWidth(&self) -> CGFloat;
#[method(setStrokeWidth:)]
pub unsafe fn setStrokeWidth(&self, stroke_width: CGFloat);
#[method(strokeOutset)]
pub unsafe fn strokeOutset(&self) -> CGFloat;
#[method(setStrokeOutset:)]
pub unsafe fn setStrokeOutset(&self, stroke_outset: CGFloat);
}
);

View File

@@ -0,0 +1,92 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBandSelectionInteractionState(pub NSInteger);
impl UIBandSelectionInteractionState {
#[doc(alias = "UIBandSelectionInteractionStatePossible")]
pub const Possible: Self = Self(0);
#[doc(alias = "UIBandSelectionInteractionStateBegan")]
pub const Began: Self = Self(1);
#[doc(alias = "UIBandSelectionInteractionStateSelecting")]
pub const Selecting: Self = Self(2);
#[doc(alias = "UIBandSelectionInteractionStateEnded")]
pub const Ended: Self = Self(3);
}
unsafe impl Encode for UIBandSelectionInteractionState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBandSelectionInteractionState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIBandSelectionInteraction;
unsafe impl ClassType for UIBandSelectionInteraction {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UIBandSelectionInteraction {}
#[cfg(feature = "UIInteraction")]
unsafe impl UIInteraction for UIBandSelectionInteraction {}
extern_methods!(
unsafe impl UIBandSelectionInteraction {
#[method(isEnabled)]
pub unsafe fn isEnabled(&self) -> bool;
#[method(setEnabled:)]
pub unsafe fn setEnabled(&self, enabled: bool);
#[method(state)]
pub unsafe fn state(&self) -> UIBandSelectionInteractionState;
#[method(selectionRect)]
pub unsafe fn selectionRect(&self) -> CGRect;
#[cfg(feature = "UICommand")]
#[method(initialModifierFlags)]
pub unsafe fn initialModifierFlags(&self) -> UIKeyModifierFlags;
#[cfg(feature = "block2")]
#[method(shouldBeginHandler)]
pub unsafe fn shouldBeginHandler(
&self,
) -> *mut block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>;
#[cfg(feature = "block2")]
#[method(setShouldBeginHandler:)]
pub unsafe fn setShouldBeginHandler(
&self,
should_begin_handler: Option<
&block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>,
>,
);
#[cfg(feature = "block2")]
#[method_id(@__retain_semantics Init initWithSelectionHandler:)]
pub unsafe fn initWithSelectionHandler(
this: Allocated<Self>,
selection_handler: &block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>)>,
) -> Retained<Self>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,122 @@
//! 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 UIBarAppearance;
unsafe impl ClassType for UIBarAppearance {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIBarAppearance {}
unsafe impl NSCopying for UIBarAppearance {}
unsafe impl NSObjectProtocol for UIBarAppearance {}
unsafe impl NSSecureCoding for UIBarAppearance {}
extern_methods!(
unsafe impl UIBarAppearance {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "UIDevice")]
#[method_id(@__retain_semantics Init initWithIdiom:)]
pub unsafe fn initWithIdiom(
this: Allocated<Self>,
idiom: UIUserInterfaceIdiom,
) -> Retained<Self>;
#[cfg(feature = "UIDevice")]
#[method(idiom)]
pub unsafe fn idiom(&self) -> UIUserInterfaceIdiom;
#[method_id(@__retain_semantics Init initWithBarAppearance:)]
pub unsafe fn initWithBarAppearance(
this: Allocated<Self>,
bar_appearance: &UIBarAppearance,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[method_id(@__retain_semantics CopyOrMutCopy copy)]
pub unsafe fn copy(&self) -> Retained<Self>;
#[method(configureWithDefaultBackground)]
pub unsafe fn configureWithDefaultBackground(&self);
#[method(configureWithOpaqueBackground)]
pub unsafe fn configureWithOpaqueBackground(&self);
#[method(configureWithTransparentBackground)]
pub unsafe fn configureWithTransparentBackground(&self);
#[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
#[method_id(@__retain_semantics Other backgroundEffect)]
pub unsafe fn backgroundEffect(&self) -> Option<Retained<UIBlurEffect>>;
#[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
#[method(setBackgroundEffect:)]
pub unsafe fn setBackgroundEffect(&self, background_effect: Option<&UIBlurEffect>);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other backgroundImage)]
pub unsafe fn backgroundImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setBackgroundImage:)]
pub unsafe fn setBackgroundImage(&self, background_image: Option<&UIImage>);
#[cfg(feature = "UIView")]
#[method(backgroundImageContentMode)]
pub unsafe fn backgroundImageContentMode(&self) -> UIViewContentMode;
#[cfg(feature = "UIView")]
#[method(setBackgroundImageContentMode:)]
pub unsafe fn setBackgroundImageContentMode(
&self,
background_image_content_mode: UIViewContentMode,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other shadowColor)]
pub unsafe fn shadowColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setShadowColor:)]
pub unsafe fn setShadowColor(&self, shadow_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other shadowImage)]
pub unsafe fn shadowImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setShadowImage:)]
pub unsafe fn setShadowImage(&self, shadow_image: Option<&UIImage>);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIBarAppearance {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,590 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-symbols")]
use objc2_symbols::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarButtonItemStyle(pub NSInteger);
impl UIBarButtonItemStyle {
#[doc(alias = "UIBarButtonItemStylePlain")]
pub const Plain: Self = Self(0);
#[deprecated]
#[doc(alias = "UIBarButtonItemStyleBordered")]
pub const Bordered: Self = Self(1);
#[doc(alias = "UIBarButtonItemStyleDone")]
pub const Done: Self = Self(2);
}
unsafe impl Encode for UIBarButtonItemStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBarButtonItemStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarButtonSystemItem(pub NSInteger);
impl UIBarButtonSystemItem {
#[doc(alias = "UIBarButtonSystemItemDone")]
pub const Done: Self = Self(0);
#[doc(alias = "UIBarButtonSystemItemCancel")]
pub const Cancel: Self = Self(1);
#[doc(alias = "UIBarButtonSystemItemEdit")]
pub const Edit: Self = Self(2);
#[doc(alias = "UIBarButtonSystemItemSave")]
pub const Save: Self = Self(3);
#[doc(alias = "UIBarButtonSystemItemAdd")]
pub const Add: Self = Self(4);
#[doc(alias = "UIBarButtonSystemItemFlexibleSpace")]
pub const FlexibleSpace: Self = Self(5);
#[doc(alias = "UIBarButtonSystemItemFixedSpace")]
pub const FixedSpace: Self = Self(6);
#[doc(alias = "UIBarButtonSystemItemCompose")]
pub const Compose: Self = Self(7);
#[doc(alias = "UIBarButtonSystemItemReply")]
pub const Reply: Self = Self(8);
#[doc(alias = "UIBarButtonSystemItemAction")]
pub const Action: Self = Self(9);
#[doc(alias = "UIBarButtonSystemItemOrganize")]
pub const Organize: Self = Self(10);
#[doc(alias = "UIBarButtonSystemItemBookmarks")]
pub const Bookmarks: Self = Self(11);
#[doc(alias = "UIBarButtonSystemItemSearch")]
pub const Search: Self = Self(12);
#[doc(alias = "UIBarButtonSystemItemRefresh")]
pub const Refresh: Self = Self(13);
#[doc(alias = "UIBarButtonSystemItemStop")]
pub const Stop: Self = Self(14);
#[doc(alias = "UIBarButtonSystemItemCamera")]
pub const Camera: Self = Self(15);
#[doc(alias = "UIBarButtonSystemItemTrash")]
pub const Trash: Self = Self(16);
#[doc(alias = "UIBarButtonSystemItemPlay")]
pub const Play: Self = Self(17);
#[doc(alias = "UIBarButtonSystemItemPause")]
pub const Pause: Self = Self(18);
#[doc(alias = "UIBarButtonSystemItemRewind")]
pub const Rewind: Self = Self(19);
#[doc(alias = "UIBarButtonSystemItemFastForward")]
pub const FastForward: Self = Self(20);
#[doc(alias = "UIBarButtonSystemItemUndo")]
pub const Undo: Self = Self(21);
#[doc(alias = "UIBarButtonSystemItemRedo")]
pub const Redo: Self = Self(22);
#[deprecated]
#[doc(alias = "UIBarButtonSystemItemPageCurl")]
pub const PageCurl: Self = Self(23);
#[doc(alias = "UIBarButtonSystemItemClose")]
pub const Close: Self = Self(24);
}
unsafe impl Encode for UIBarButtonSystemItem {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBarButtonSystemItem {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIBarItem")]
pub struct UIBarButtonItem;
#[cfg(feature = "UIBarItem")]
unsafe impl ClassType for UIBarButtonItem {
#[inherits(NSObject)]
type Super = UIBarItem;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIBarItem")]
unsafe impl NSCoding for UIBarButtonItem {}
#[cfg(feature = "UIBarItem")]
unsafe impl NSObjectProtocol for UIBarButtonItem {}
#[cfg(all(feature = "UIAppearance", feature = "UIBarItem"))]
unsafe impl UIAppearance for UIBarButtonItem {}
extern_methods!(
#[cfg(feature = "UIBarItem")]
unsafe impl UIBarButtonItem {
#[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>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Init initWithImage:style:target:action:)]
pub unsafe fn initWithImage_style_target_action(
this: Allocated<Self>,
image: Option<&UIImage>,
style: UIBarButtonItemStyle,
target: Option<&AnyObject>,
action: Option<Sel>,
) -> Retained<Self>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Init initWithImage:landscapeImagePhone:style:target:action:)]
pub unsafe fn initWithImage_landscapeImagePhone_style_target_action(
this: Allocated<Self>,
image: Option<&UIImage>,
landscape_image_phone: Option<&UIImage>,
style: UIBarButtonItemStyle,
target: Option<&AnyObject>,
action: Option<Sel>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithTitle:style:target:action:)]
pub unsafe fn initWithTitle_style_target_action(
this: Allocated<Self>,
title: Option<&NSString>,
style: UIBarButtonItemStyle,
target: Option<&AnyObject>,
action: Option<Sel>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithBarButtonSystemItem:target:action:)]
pub unsafe fn initWithBarButtonSystemItem_target_action(
this: Allocated<Self>,
system_item: UIBarButtonSystemItem,
target: Option<&AnyObject>,
action: Option<Sel>,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Init initWithCustomView:)]
pub unsafe fn initWithCustomView(
this: Allocated<Self>,
custom_view: &UIView,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithBarButtonSystemItem:primaryAction:)]
pub unsafe fn initWithBarButtonSystemItem_primaryAction(
this: Allocated<Self>,
system_item: UIBarButtonSystemItem,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithPrimaryAction:)]
pub unsafe fn initWithPrimaryAction(
this: Allocated<Self>,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithBarButtonSystemItem:menu:)]
pub unsafe fn initWithBarButtonSystemItem_menu(
this: Allocated<Self>,
system_item: UIBarButtonSystemItem,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithTitle:menu:)]
pub unsafe fn initWithTitle_menu(
this: Allocated<Self>,
title: Option<&NSString>,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithImage:menu:)]
pub unsafe fn initWithImage_menu(
this: Allocated<Self>,
image: Option<&UIImage>,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithPrimaryAction:menu:)]
pub unsafe fn initWithPrimaryAction_menu(
this: Allocated<Self>,
primary_action: Option<&UIAction>,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithBarButtonSystemItem:primaryAction:menu:)]
pub unsafe fn initWithBarButtonSystemItem_primaryAction_menu(
this: Allocated<Self>,
system_item: UIBarButtonSystemItem,
primary_action: Option<&UIAction>,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[cfg(all(feature = "UIImage", feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithTitle:image:target:action:menu:)]
pub unsafe fn initWithTitle_image_target_action_menu(
this: Allocated<Self>,
title: Option<&NSString>,
image: Option<&UIImage>,
target: Option<&AnyObject>,
action: Option<Sel>,
menu: Option<&UIMenu>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other fixedSpaceItemOfWidth:)]
pub unsafe fn fixedSpaceItemOfWidth(
width: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other flexibleSpaceItem)]
pub unsafe fn flexibleSpaceItem(mtm: MainThreadMarker) -> Retained<Self>;
#[method(style)]
pub unsafe fn style(&self) -> UIBarButtonItemStyle;
#[method(setStyle:)]
pub unsafe fn setStyle(&self, style: UIBarButtonItemStyle);
#[method(width)]
pub unsafe fn width(&self) -> CGFloat;
#[method(setWidth:)]
pub unsafe fn setWidth(&self, width: CGFloat);
#[method_id(@__retain_semantics Other possibleTitles)]
pub unsafe fn possibleTitles(&self) -> Option<Retained<NSSet<NSString>>>;
#[method(setPossibleTitles:)]
pub unsafe fn setPossibleTitles(&self, possible_titles: Option<&NSSet<NSString>>);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other customView)]
pub unsafe fn customView(&self) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method(setCustomView:)]
pub unsafe fn setCustomView(&self, custom_view: Option<&UIView>);
#[method(action)]
pub unsafe fn action(&self) -> Option<Sel>;
#[method(setAction:)]
pub unsafe fn setAction(&self, action: Option<Sel>);
#[method_id(@__retain_semantics Other target)]
pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
#[method(setTarget:)]
pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other primaryAction)]
pub unsafe fn primaryAction(&self) -> Option<Retained<UIAction>>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method(setPrimaryAction:)]
pub unsafe fn setPrimaryAction(&self, primary_action: Option<&UIAction>);
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other menu)]
pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method(setMenu:)]
pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);
#[cfg(feature = "UIContextMenuConfiguration")]
#[method(preferredMenuElementOrder)]
pub unsafe fn preferredMenuElementOrder(&self) -> UIContextMenuConfigurationElementOrder;
#[cfg(feature = "UIContextMenuConfiguration")]
#[method(setPreferredMenuElementOrder:)]
pub unsafe fn setPreferredMenuElementOrder(
&self,
preferred_menu_element_order: UIContextMenuConfigurationElementOrder,
);
#[method(changesSelectionAsPrimaryAction)]
pub unsafe fn changesSelectionAsPrimaryAction(&self) -> bool;
#[method(setChangesSelectionAsPrimaryAction:)]
pub unsafe fn setChangesSelectionAsPrimaryAction(
&self,
changes_selection_as_primary_action: bool,
);
#[method(isSelected)]
pub unsafe fn isSelected(&self) -> bool;
#[method(setSelected:)]
pub unsafe fn setSelected(&self, selected: bool);
#[method(isHidden)]
pub unsafe fn isHidden(&self) -> bool;
#[method(setHidden:)]
pub unsafe fn setHidden(&self, hidden: bool);
#[method(isSymbolAnimationEnabled)]
pub unsafe fn isSymbolAnimationEnabled(&self) -> bool;
#[method(setSymbolAnimationEnabled:)]
pub unsafe fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool);
#[cfg(feature = "UIMenuElement")]
#[method_id(@__retain_semantics Other menuRepresentation)]
pub unsafe fn menuRepresentation(&self) -> Option<Retained<UIMenuElement>>;
#[cfg(feature = "UIMenuElement")]
#[method(setMenuRepresentation:)]
pub unsafe fn setMenuRepresentation(&self, menu_representation: Option<&UIMenuElement>);
#[cfg(feature = "UIBarButtonItemGroup")]
#[method_id(@__retain_semantics Other creatingFixedGroup)]
pub unsafe fn creatingFixedGroup(&self) -> Retained<UIBarButtonItemGroup>;
#[cfg(feature = "UIBarButtonItemGroup")]
#[method_id(@__retain_semantics Other creatingMovableGroupWithCustomizationIdentifier:)]
pub unsafe fn creatingMovableGroupWithCustomizationIdentifier(
&self,
customization_identifier: &NSString,
) -> Retained<UIBarButtonItemGroup>;
#[cfg(feature = "UIBarButtonItemGroup")]
#[method_id(@__retain_semantics Other creatingOptionalGroupWithCustomizationIdentifier:inDefaultCustomization:)]
pub unsafe fn creatingOptionalGroupWithCustomizationIdentifier_inDefaultCustomization(
&self,
customization_identifier: &NSString,
in_default_customization: bool,
) -> Retained<UIBarButtonItemGroup>;
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method(setBackgroundImage:forState:barMetrics:)]
pub unsafe fn setBackgroundImage_forState_barMetrics(
&self,
background_image: Option<&UIImage>,
state: UIControlState,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method_id(@__retain_semantics Other backgroundImageForState:barMetrics:)]
pub unsafe fn backgroundImageForState_barMetrics(
&self,
state: UIControlState,
bar_metrics: UIBarMetrics,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method(setBackgroundImage:forState:style:barMetrics:)]
pub unsafe fn setBackgroundImage_forState_style_barMetrics(
&self,
background_image: Option<&UIImage>,
state: UIControlState,
style: UIBarButtonItemStyle,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method_id(@__retain_semantics Other backgroundImageForState:style:barMetrics:)]
pub unsafe fn backgroundImageForState_style_barMetrics(
&self,
state: UIControlState,
style: UIBarButtonItemStyle,
bar_metrics: UIBarMetrics,
) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other tintColor)]
pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setTintColor:)]
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
#[cfg(feature = "UIBarCommon")]
#[method(setBackgroundVerticalPositionAdjustment:forBarMetrics:)]
pub unsafe fn setBackgroundVerticalPositionAdjustment_forBarMetrics(
&self,
adjustment: CGFloat,
bar_metrics: UIBarMetrics,
);
#[cfg(feature = "UIBarCommon")]
#[method(backgroundVerticalPositionAdjustmentForBarMetrics:)]
pub unsafe fn backgroundVerticalPositionAdjustmentForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> CGFloat;
#[cfg(all(feature = "UIBarCommon", feature = "UIGeometry"))]
#[method(setTitlePositionAdjustment:forBarMetrics:)]
pub unsafe fn setTitlePositionAdjustment_forBarMetrics(
&self,
adjustment: UIOffset,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIGeometry"))]
#[method(titlePositionAdjustmentForBarMetrics:)]
pub unsafe fn titlePositionAdjustmentForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> UIOffset;
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method(setBackButtonBackgroundImage:forState:barMetrics:)]
pub unsafe fn setBackButtonBackgroundImage_forState_barMetrics(
&self,
background_image: Option<&UIImage>,
state: UIControlState,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIControl", feature = "UIImage"))]
#[method_id(@__retain_semantics Other backButtonBackgroundImageForState:barMetrics:)]
pub unsafe fn backButtonBackgroundImageForState_barMetrics(
&self,
state: UIControlState,
bar_metrics: UIBarMetrics,
) -> Option<Retained<UIImage>>;
#[cfg(all(feature = "UIBarCommon", feature = "UIGeometry"))]
#[method(setBackButtonTitlePositionAdjustment:forBarMetrics:)]
pub unsafe fn setBackButtonTitlePositionAdjustment_forBarMetrics(
&self,
adjustment: UIOffset,
bar_metrics: UIBarMetrics,
);
#[cfg(all(feature = "UIBarCommon", feature = "UIGeometry"))]
#[method(backButtonTitlePositionAdjustmentForBarMetrics:)]
pub unsafe fn backButtonTitlePositionAdjustmentForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> UIOffset;
#[cfg(feature = "UIBarCommon")]
#[method(setBackButtonBackgroundVerticalPositionAdjustment:forBarMetrics:)]
pub unsafe fn setBackButtonBackgroundVerticalPositionAdjustment_forBarMetrics(
&self,
adjustment: CGFloat,
bar_metrics: UIBarMetrics,
);
#[cfg(feature = "UIBarCommon")]
#[method(backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:)]
pub unsafe fn backButtonBackgroundVerticalPositionAdjustmentForBarMetrics(
&self,
bar_metrics: UIBarMetrics,
) -> CGFloat;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIBarItem")]
unsafe impl UIBarButtonItem {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// SpringLoading
#[cfg(feature = "UIBarItem")]
unsafe impl UIBarButtonItem {}
);
#[cfg(all(feature = "UIBarItem", feature = "UISpringLoadedInteractionSupporting"))]
unsafe impl UISpringLoadedInteractionSupporting for UIBarButtonItem {}
extern_methods!(
#[cfg(feature = "UIBarItem")]
unsafe impl UIBarButtonItem {
#[cfg(feature = "objc2-symbols")]
#[method(addSymbolEffect:)]
pub unsafe fn addSymbolEffect(&self, symbol_effect: &NSSymbolEffect);
#[cfg(feature = "objc2-symbols")]
#[method(addSymbolEffect:options:)]
pub unsafe fn addSymbolEffect_options(
&self,
symbol_effect: &NSSymbolEffect,
options: &NSSymbolEffectOptions,
);
#[cfg(feature = "objc2-symbols")]
#[method(addSymbolEffect:options:animated:)]
pub unsafe fn addSymbolEffect_options_animated(
&self,
symbol_effect: &NSSymbolEffect,
options: &NSSymbolEffectOptions,
animated: bool,
);
#[cfg(feature = "objc2-symbols")]
#[method(removeSymbolEffectOfType:)]
pub unsafe fn removeSymbolEffectOfType(&self, symbol_effect: &NSSymbolEffect);
#[cfg(feature = "objc2-symbols")]
#[method(removeSymbolEffectOfType:options:)]
pub unsafe fn removeSymbolEffectOfType_options(
&self,
symbol_effect: &NSSymbolEffect,
options: &NSSymbolEffectOptions,
);
#[cfg(feature = "objc2-symbols")]
#[method(removeSymbolEffectOfType:options:animated:)]
pub unsafe fn removeSymbolEffectOfType_options_animated(
&self,
symbol_effect: &NSSymbolEffect,
options: &NSSymbolEffectOptions,
animated: bool,
);
#[method(removeAllSymbolEffects)]
pub unsafe fn removeAllSymbolEffects(&self);
#[cfg(feature = "objc2-symbols")]
#[method(removeAllSymbolEffectsWithOptions:)]
pub unsafe fn removeAllSymbolEffectsWithOptions(&self, options: &NSSymbolEffectOptions);
#[cfg(feature = "objc2-symbols")]
#[method(removeAllSymbolEffectsWithOptions:animated:)]
pub unsafe fn removeAllSymbolEffectsWithOptions_animated(
&self,
options: &NSSymbolEffectOptions,
animated: bool,
);
#[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
#[method(setSymbolImage:withContentTransition:)]
pub unsafe fn setSymbolImage_withContentTransition(
&self,
symbol_image: &UIImage,
transition: &NSSymbolContentTransition,
);
#[cfg(all(feature = "UIImage", feature = "objc2-symbols"))]
#[method(setSymbolImage:withContentTransition:options:)]
pub unsafe fn setSymbolImage_withContentTransition_options(
&self,
symbol_image: &UIImage,
transition: &NSSymbolContentTransition,
options: &NSSymbolEffectOptions,
);
}
);

View File

@@ -0,0 +1,128 @@
//! 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 UIBarButtonItemStateAppearance;
unsafe impl ClassType for UIBarButtonItemStateAppearance {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UIBarButtonItemStateAppearance {}
extern_methods!(
unsafe impl UIBarButtonItemStateAppearance {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other titleTextAttributes)]
pub unsafe fn titleTextAttributes(
&self,
) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
#[method(setTitleTextAttributes:)]
pub unsafe fn setTitleTextAttributes(
&self,
title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
);
#[cfg(feature = "UIGeometry")]
#[method(titlePositionAdjustment)]
pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;
#[cfg(feature = "UIGeometry")]
#[method(setTitlePositionAdjustment:)]
pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other backgroundImage)]
pub unsafe fn backgroundImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setBackgroundImage:)]
pub unsafe fn setBackgroundImage(&self, background_image: Option<&UIImage>);
#[cfg(feature = "UIGeometry")]
#[method(backgroundImagePositionAdjustment)]
pub unsafe fn backgroundImagePositionAdjustment(&self) -> UIOffset;
#[cfg(feature = "UIGeometry")]
#[method(setBackgroundImagePositionAdjustment:)]
pub unsafe fn setBackgroundImagePositionAdjustment(
&self,
background_image_position_adjustment: UIOffset,
);
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIBarButtonItemAppearance;
unsafe impl ClassType for UIBarButtonItemAppearance {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIBarButtonItemAppearance {}
unsafe impl NSCopying for UIBarButtonItemAppearance {}
unsafe impl NSObjectProtocol for UIBarButtonItemAppearance {}
unsafe impl NSSecureCoding for UIBarButtonItemAppearance {}
extern_methods!(
unsafe impl UIBarButtonItemAppearance {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "UIBarButtonItem")]
#[method_id(@__retain_semantics Init initWithStyle:)]
pub unsafe fn initWithStyle(
this: Allocated<Self>,
style: UIBarButtonItemStyle,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[method_id(@__retain_semantics CopyOrMutCopy copy)]
pub unsafe fn copy(&self) -> Retained<Self>;
#[cfg(feature = "UIBarButtonItem")]
#[method(configureWithDefaultForStyle:)]
pub unsafe fn configureWithDefaultForStyle(&self, style: UIBarButtonItemStyle);
#[method_id(@__retain_semantics Other normal)]
pub unsafe fn normal(&self) -> Retained<UIBarButtonItemStateAppearance>;
#[method_id(@__retain_semantics Other highlighted)]
pub unsafe fn highlighted(&self) -> Retained<UIBarButtonItemStateAppearance>;
#[method_id(@__retain_semantics Other disabled)]
pub unsafe fn disabled(&self) -> Retained<UIBarButtonItemStateAppearance>;
#[method_id(@__retain_semantics Other focused)]
pub unsafe fn focused(&self) -> Retained<UIBarButtonItemStateAppearance>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIBarButtonItemAppearance {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,124 @@
//! 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 UIBarButtonItemGroup;
unsafe impl ClassType for UIBarButtonItemGroup {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIBarButtonItemGroup {}
unsafe impl NSObjectProtocol for UIBarButtonItemGroup {}
extern_methods!(
unsafe impl UIBarButtonItemGroup {
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Init initWithBarButtonItems:representativeItem:)]
pub unsafe fn initWithBarButtonItems_representativeItem(
this: Allocated<Self>,
bar_button_items: &NSArray<UIBarButtonItem>,
representative_item: Option<&UIBarButtonItem>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Other fixedGroupWithRepresentativeItem:items:)]
pub unsafe fn fixedGroupWithRepresentativeItem_items(
representative_item: Option<&UIBarButtonItem>,
items: &NSArray<UIBarButtonItem>,
mtm: MainThreadMarker,
) -> Retained<UIBarButtonItemGroup>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Other movableGroupWithCustomizationIdentifier:representativeItem:items:)]
pub unsafe fn movableGroupWithCustomizationIdentifier_representativeItem_items(
customization_identifier: &NSString,
representative_item: Option<&UIBarButtonItem>,
items: &NSArray<UIBarButtonItem>,
mtm: MainThreadMarker,
) -> Retained<UIBarButtonItemGroup>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Other optionalGroupWithCustomizationIdentifier:inDefaultCustomization:representativeItem:items:)]
pub unsafe fn optionalGroupWithCustomizationIdentifier_inDefaultCustomization_representativeItem_items(
customization_identifier: &NSString,
in_default_customization: bool,
representative_item: Option<&UIBarButtonItem>,
items: &NSArray<UIBarButtonItem>,
mtm: MainThreadMarker,
) -> Retained<UIBarButtonItemGroup>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Other barButtonItems)]
pub unsafe fn barButtonItems(&self) -> Retained<NSArray<UIBarButtonItem>>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method(setBarButtonItems:)]
pub unsafe fn setBarButtonItems(&self, bar_button_items: &NSArray<UIBarButtonItem>);
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method_id(@__retain_semantics Other representativeItem)]
pub unsafe fn representativeItem(&self) -> Option<Retained<UIBarButtonItem>>;
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
#[method(setRepresentativeItem:)]
pub unsafe fn setRepresentativeItem(&self, representative_item: Option<&UIBarButtonItem>);
#[method(isDisplayingRepresentativeItem)]
pub unsafe fn isDisplayingRepresentativeItem(&self) -> bool;
#[method(alwaysAvailable)]
pub unsafe fn alwaysAvailable(&self) -> bool;
#[method(setAlwaysAvailable:)]
pub unsafe fn setAlwaysAvailable(&self, always_available: bool);
#[cfg(feature = "UIMenuElement")]
#[method_id(@__retain_semantics Other menuRepresentation)]
pub unsafe fn menuRepresentation(&self) -> Option<Retained<UIMenuElement>>;
#[cfg(feature = "UIMenuElement")]
#[method(setMenuRepresentation:)]
pub unsafe fn setMenuRepresentation(&self, menu_representation: Option<&UIMenuElement>);
#[method(isHidden)]
pub unsafe fn isHidden(&self) -> bool;
#[method(setHidden:)]
pub unsafe fn setHidden(&self, hidden: bool);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIBarButtonItemGroup {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// UIBarButtonItemGroup
#[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
unsafe impl UIBarButtonItem {
#[method_id(@__retain_semantics Other buttonGroup)]
pub unsafe fn buttonGroup(&self) -> Option<Retained<UIBarButtonItemGroup>>;
}
);

View File

@@ -0,0 +1,79 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarMetrics(pub NSInteger);
impl UIBarMetrics {
#[doc(alias = "UIBarMetricsDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "UIBarMetricsCompact")]
pub const Compact: Self = Self(1);
#[doc(alias = "UIBarMetricsDefaultPrompt")]
pub const DefaultPrompt: Self = Self(101);
#[doc(alias = "UIBarMetricsCompactPrompt")]
pub const CompactPrompt: Self = Self(102);
#[deprecated]
#[doc(alias = "UIBarMetricsLandscapePhone")]
pub const LandscapePhone: Self = Self(UIBarMetrics::Compact.0);
#[deprecated]
#[doc(alias = "UIBarMetricsLandscapePhonePrompt")]
pub const LandscapePhonePrompt: Self = Self(UIBarMetrics::CompactPrompt.0);
}
unsafe impl Encode for UIBarMetrics {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBarMetrics {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarPosition(pub NSInteger);
impl UIBarPosition {
#[doc(alias = "UIBarPositionAny")]
pub const Any: Self = Self(0);
#[doc(alias = "UIBarPositionBottom")]
pub const Bottom: Self = Self(1);
#[doc(alias = "UIBarPositionTop")]
pub const Top: Self = Self(2);
#[doc(alias = "UIBarPositionTopAttached")]
pub const TopAttached: Self = Self(3);
}
unsafe impl Encode for UIBarPosition {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBarPosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait UIBarPositioning: NSObjectProtocol + IsMainThreadOnly {
#[method(barPosition)]
unsafe fn barPosition(&self) -> UIBarPosition;
}
unsafe impl ProtocolType for dyn UIBarPositioning {}
);
extern_protocol!(
pub unsafe trait UIBarPositioningDelegate: NSObjectProtocol + IsMainThreadOnly {
#[optional]
#[method(positionForBar:)]
unsafe fn positionForBar(
&self,
bar: &ProtocolObject<dyn UIBarPositioning>,
) -> UIBarPosition;
}
unsafe impl ProtocolType for dyn UIBarPositioningDelegate {}
);

View File

@@ -0,0 +1,131 @@
//! 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 UIBarItem;
unsafe impl ClassType for UIBarItem {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIBarItem {}
unsafe impl NSObjectProtocol for UIBarItem {}
#[cfg(feature = "UIAppearance")]
unsafe impl UIAppearance for UIBarItem {}
extern_methods!(
unsafe impl UIBarItem {
#[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(isEnabled)]
pub unsafe fn isEnabled(&self) -> bool;
#[method(setEnabled:)]
pub unsafe fn setEnabled(&self, enabled: bool);
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: Option<&NSString>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other landscapeImagePhone)]
pub unsafe fn landscapeImagePhone(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setLandscapeImagePhone:)]
pub unsafe fn setLandscapeImagePhone(&self, landscape_image_phone: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other largeContentSizeImage)]
pub unsafe fn largeContentSizeImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setLargeContentSizeImage:)]
pub unsafe fn setLargeContentSizeImage(&self, large_content_size_image: Option<&UIImage>);
#[cfg(feature = "UIGeometry")]
#[method(imageInsets)]
pub unsafe fn imageInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setImageInsets:)]
pub unsafe fn setImageInsets(&self, image_insets: UIEdgeInsets);
#[cfg(feature = "UIGeometry")]
#[method(landscapeImagePhoneInsets)]
pub unsafe fn landscapeImagePhoneInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setLandscapeImagePhoneInsets:)]
pub unsafe fn setLandscapeImagePhoneInsets(
&self,
landscape_image_phone_insets: UIEdgeInsets,
);
#[cfg(feature = "UIGeometry")]
#[method(largeContentSizeImageInsets)]
pub unsafe fn largeContentSizeImageInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setLargeContentSizeImageInsets:)]
pub unsafe fn setLargeContentSizeImageInsets(
&self,
large_content_size_image_insets: UIEdgeInsets,
);
#[method(tag)]
pub unsafe fn tag(&self) -> NSInteger;
#[method(setTag:)]
pub unsafe fn setTag(&self, tag: NSInteger);
#[cfg(feature = "UIControl")]
#[method(setTitleTextAttributes:forState:)]
pub unsafe fn setTitleTextAttributes_forState(
&self,
attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
state: UIControlState,
);
#[cfg(feature = "UIControl")]
#[method_id(@__retain_semantics Other titleTextAttributesForState:)]
pub unsafe fn titleTextAttributesForState(
&self,
state: UIControlState,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIBarItem {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,72 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBehavioralStyle(pub NSUInteger);
impl UIBehavioralStyle {
#[doc(alias = "UIBehavioralStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIBehavioralStylePad")]
pub const Pad: Self = Self(1);
#[doc(alias = "UIBehavioralStyleMac")]
pub const Mac: Self = Self(2);
}
unsafe impl Encode for UIBehavioralStyle {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIBehavioralStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_methods!(
/// UIBehavioralStyle
#[cfg(all(
feature = "UIButton",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIButton {
#[method(behavioralStyle)]
pub unsafe fn behavioralStyle(&self) -> UIBehavioralStyle;
#[method(preferredBehavioralStyle)]
pub unsafe fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
#[method(setPreferredBehavioralStyle:)]
pub unsafe fn setPreferredBehavioralStyle(
&self,
preferred_behavioral_style: UIBehavioralStyle,
);
}
);
extern_methods!(
/// UIBehavioralStyle
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UISlider",
feature = "UIView"
))]
unsafe impl UISlider {
#[method(behavioralStyle)]
pub unsafe fn behavioralStyle(&self) -> UIBehavioralStyle;
#[method(preferredBehavioralStyle)]
pub unsafe fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
#[method(setPreferredBehavioralStyle:)]
pub unsafe fn setPreferredBehavioralStyle(
&self,
preferred_behavioral_style: UIBehavioralStyle,
);
}
);

View File

@@ -0,0 +1,184 @@
//! 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 UIBezierPath;
unsafe impl ClassType for UIBezierPath {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSCoding for UIBezierPath {}
unsafe impl NSCopying for UIBezierPath {}
unsafe impl NSObjectProtocol for UIBezierPath {}
unsafe impl NSSecureCoding for UIBezierPath {}
extern_methods!(
unsafe impl UIBezierPath {
#[method_id(@__retain_semantics Other bezierPath)]
pub unsafe fn bezierPath() -> Retained<Self>;
#[method_id(@__retain_semantics Other bezierPathWithRect:)]
pub unsafe fn bezierPathWithRect(rect: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Other bezierPathWithOvalInRect:)]
pub unsafe fn bezierPathWithOvalInRect(rect: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Other bezierPathWithRoundedRect:cornerRadius:)]
pub unsafe fn bezierPathWithRoundedRect_cornerRadius(
rect: CGRect,
corner_radius: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "UIGeometry")]
#[method_id(@__retain_semantics Other bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:)]
pub unsafe fn bezierPathWithRoundedRect_byRoundingCorners_cornerRadii(
rect: CGRect,
corners: UIRectCorner,
corner_radii: CGSize,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:)]
pub unsafe fn bezierPathWithArcCenter_radius_startAngle_endAngle_clockwise(
center: CGPoint,
radius: CGFloat,
start_angle: CGFloat,
end_angle: CGFloat,
clockwise: bool,
) -> Retained<Self>;
#[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(moveToPoint:)]
pub unsafe fn moveToPoint(&self, point: CGPoint);
#[method(addLineToPoint:)]
pub unsafe fn addLineToPoint(&self, point: CGPoint);
#[method(addCurveToPoint:controlPoint1:controlPoint2:)]
pub unsafe fn addCurveToPoint_controlPoint1_controlPoint2(
&self,
end_point: CGPoint,
control_point1: CGPoint,
control_point2: CGPoint,
);
#[method(addQuadCurveToPoint:controlPoint:)]
pub unsafe fn addQuadCurveToPoint_controlPoint(
&self,
end_point: CGPoint,
control_point: CGPoint,
);
#[method(addArcWithCenter:radius:startAngle:endAngle:clockwise:)]
pub unsafe fn addArcWithCenter_radius_startAngle_endAngle_clockwise(
&self,
center: CGPoint,
radius: CGFloat,
start_angle: CGFloat,
end_angle: CGFloat,
clockwise: bool,
);
#[method(closePath)]
pub unsafe fn closePath(&self);
#[method(removeAllPoints)]
pub unsafe fn removeAllPoints(&self);
#[method(appendPath:)]
pub unsafe fn appendPath(&self, bezier_path: &UIBezierPath);
#[method_id(@__retain_semantics Other bezierPathByReversingPath)]
pub unsafe fn bezierPathByReversingPath(&self) -> Retained<UIBezierPath>;
#[method(applyTransform:)]
pub unsafe fn applyTransform(&self, transform: CGAffineTransform);
#[method(isEmpty)]
pub unsafe fn isEmpty(&self) -> bool;
#[method(bounds)]
pub unsafe fn bounds(&self) -> CGRect;
#[method(currentPoint)]
pub unsafe fn currentPoint(&self) -> CGPoint;
#[method(containsPoint:)]
pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
#[method(lineWidth)]
pub unsafe fn lineWidth(&self) -> CGFloat;
#[method(setLineWidth:)]
pub unsafe fn setLineWidth(&self, line_width: CGFloat);
#[method(miterLimit)]
pub unsafe fn miterLimit(&self) -> CGFloat;
#[method(setMiterLimit:)]
pub unsafe fn setMiterLimit(&self, miter_limit: CGFloat);
#[method(flatness)]
pub unsafe fn flatness(&self) -> CGFloat;
#[method(setFlatness:)]
pub unsafe fn setFlatness(&self, flatness: CGFloat);
#[method(usesEvenOddFillRule)]
pub unsafe fn usesEvenOddFillRule(&self) -> bool;
#[method(setUsesEvenOddFillRule:)]
pub unsafe fn setUsesEvenOddFillRule(&self, uses_even_odd_fill_rule: bool);
#[method(setLineDash:count:phase:)]
pub unsafe fn setLineDash_count_phase(
&self,
pattern: *mut CGFloat,
count: NSInteger,
phase: CGFloat,
);
#[method(getLineDash:count:phase:)]
pub unsafe fn getLineDash_count_phase(
&self,
pattern: *mut CGFloat,
count: *mut NSInteger,
phase: *mut CGFloat,
);
#[method(fill)]
pub unsafe fn fill(&self);
#[method(stroke)]
pub unsafe fn stroke(&self);
#[method(addClip)]
pub unsafe fn addClip(&self);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIBezierPath {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);

View File

@@ -0,0 +1,111 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBlurEffectStyle(pub NSInteger);
impl UIBlurEffectStyle {
#[doc(alias = "UIBlurEffectStyleExtraLight")]
pub const ExtraLight: Self = Self(0);
#[doc(alias = "UIBlurEffectStyleLight")]
pub const Light: Self = Self(1);
#[doc(alias = "UIBlurEffectStyleDark")]
pub const Dark: Self = Self(2);
#[doc(alias = "UIBlurEffectStyleExtraDark")]
pub const ExtraDark: Self = Self(3);
#[doc(alias = "UIBlurEffectStyleRegular")]
pub const Regular: Self = Self(4);
#[doc(alias = "UIBlurEffectStyleProminent")]
pub const Prominent: Self = Self(5);
#[doc(alias = "UIBlurEffectStyleSystemUltraThinMaterial")]
pub const SystemUltraThinMaterial: Self = Self(6);
#[doc(alias = "UIBlurEffectStyleSystemThinMaterial")]
pub const SystemThinMaterial: Self = Self(7);
#[doc(alias = "UIBlurEffectStyleSystemMaterial")]
pub const SystemMaterial: Self = Self(8);
#[doc(alias = "UIBlurEffectStyleSystemThickMaterial")]
pub const SystemThickMaterial: Self = Self(9);
#[doc(alias = "UIBlurEffectStyleSystemChromeMaterial")]
pub const SystemChromeMaterial: Self = Self(10);
#[doc(alias = "UIBlurEffectStyleSystemUltraThinMaterialLight")]
pub const SystemUltraThinMaterialLight: Self = Self(11);
#[doc(alias = "UIBlurEffectStyleSystemThinMaterialLight")]
pub const SystemThinMaterialLight: Self = Self(12);
#[doc(alias = "UIBlurEffectStyleSystemMaterialLight")]
pub const SystemMaterialLight: Self = Self(13);
#[doc(alias = "UIBlurEffectStyleSystemThickMaterialLight")]
pub const SystemThickMaterialLight: Self = Self(14);
#[doc(alias = "UIBlurEffectStyleSystemChromeMaterialLight")]
pub const SystemChromeMaterialLight: Self = Self(15);
#[doc(alias = "UIBlurEffectStyleSystemUltraThinMaterialDark")]
pub const SystemUltraThinMaterialDark: Self = Self(16);
#[doc(alias = "UIBlurEffectStyleSystemThinMaterialDark")]
pub const SystemThinMaterialDark: Self = Self(17);
#[doc(alias = "UIBlurEffectStyleSystemMaterialDark")]
pub const SystemMaterialDark: Self = Self(18);
#[doc(alias = "UIBlurEffectStyleSystemThickMaterialDark")]
pub const SystemThickMaterialDark: Self = Self(19);
#[doc(alias = "UIBlurEffectStyleSystemChromeMaterialDark")]
pub const SystemChromeMaterialDark: Self = Self(20);
}
unsafe impl Encode for UIBlurEffectStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBlurEffectStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIVisualEffect")]
pub struct UIBlurEffect;
#[cfg(feature = "UIVisualEffect")]
unsafe impl ClassType for UIBlurEffect {
#[inherits(NSObject)]
type Super = UIVisualEffect;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIVisualEffect")]
unsafe impl NSCoding for UIBlurEffect {}
#[cfg(feature = "UIVisualEffect")]
unsafe impl NSCopying for UIBlurEffect {}
#[cfg(feature = "UIVisualEffect")]
unsafe impl NSObjectProtocol for UIBlurEffect {}
#[cfg(feature = "UIVisualEffect")]
unsafe impl NSSecureCoding for UIBlurEffect {}
extern_methods!(
#[cfg(feature = "UIVisualEffect")]
unsafe impl UIBlurEffect {
#[method_id(@__retain_semantics Other effectWithStyle:)]
pub unsafe fn effectWithStyle(
style: UIBlurEffectStyle,
mtm: MainThreadMarker,
) -> Retained<UIBlurEffect>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIVisualEffect")]
unsafe impl UIBlurEffect {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,622 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonType(pub NSInteger);
impl UIButtonType {
#[doc(alias = "UIButtonTypeCustom")]
pub const Custom: Self = Self(0);
#[doc(alias = "UIButtonTypeSystem")]
pub const System: Self = Self(1);
#[doc(alias = "UIButtonTypeDetailDisclosure")]
pub const DetailDisclosure: Self = Self(2);
#[doc(alias = "UIButtonTypeInfoLight")]
pub const InfoLight: Self = Self(3);
#[doc(alias = "UIButtonTypeInfoDark")]
pub const InfoDark: Self = Self(4);
#[doc(alias = "UIButtonTypeContactAdd")]
pub const ContactAdd: Self = Self(5);
#[doc(alias = "UIButtonTypePlain")]
pub const Plain: Self = Self(6);
#[doc(alias = "UIButtonTypeClose")]
pub const Close: Self = Self(7);
#[doc(alias = "UIButtonTypeRoundedRect")]
pub const RoundedRect: Self = Self(UIButtonType::System.0);
}
unsafe impl Encode for UIButtonType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonRole(pub NSInteger);
impl UIButtonRole {
#[doc(alias = "UIButtonRoleNormal")]
pub const Normal: Self = Self(0);
#[doc(alias = "UIButtonRolePrimary")]
pub const Primary: Self = Self(1);
#[doc(alias = "UIButtonRoleCancel")]
pub const Cancel: Self = Self(2);
#[doc(alias = "UIButtonRoleDestructive")]
pub const Destructive: Self = Self(3);
}
unsafe impl Encode for UIButtonRole {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonRole {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(all(
feature = "UIControl",
feature = "UIHoverStyle",
feature = "UIPointerStyle",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UIButtonPointerStyleProvider = *mut block2::Block<
dyn Fn(
NonNull<UIButton>,
NonNull<UIPointerEffect>,
NonNull<UIPointerShape>,
) -> *mut UIPointerStyle,
>;
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UIButtonConfigurationUpdateHandler = *mut block2::Block<dyn Fn(NonNull<UIButton>)>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
pub struct UIButton;
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UIButton {
#[inherits(UIView, UIResponder, NSObject)]
type Super = UIControl;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIButton {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIButton {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIButton {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearance for UIButton {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearanceContainer for UIButton {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIButton {}
#[cfg(all(
feature = "UIControl",
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UIButton {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusEnvironment for UIButton {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItem for UIButton {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItemContainer for UIButton {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIButton {}
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIButton {}
extern_methods!(
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIButton {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithFrame:primaryAction:)]
pub unsafe fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other buttonWithType:)]
pub unsafe fn buttonWithType(
button_type: UIButtonType,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other systemButtonWithImage:target:action:)]
pub unsafe fn systemButtonWithImage_target_action(
image: &UIImage,
target: Option<&AnyObject>,
action: Option<Sel>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other systemButtonWithPrimaryAction:)]
pub unsafe fn systemButtonWithPrimaryAction(
primary_action: Option<&UIAction>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other buttonWithType:primaryAction:)]
pub unsafe fn buttonWithType_primaryAction(
button_type: UIButtonType,
primary_action: Option<&UIAction>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(
feature = "UIAction",
feature = "UIButtonConfiguration",
feature = "UIMenuElement"
))]
#[method_id(@__retain_semantics Other buttonWithConfiguration:primaryAction:)]
pub unsafe fn buttonWithConfiguration_primaryAction(
configuration: &UIButtonConfiguration,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
#[cfg(feature = "UIButtonConfiguration")]
#[method_id(@__retain_semantics Other configuration)]
pub unsafe fn configuration(&self) -> Option<Retained<UIButtonConfiguration>>;
#[cfg(feature = "UIButtonConfiguration")]
#[method(setConfiguration:)]
pub unsafe fn setConfiguration(&self, configuration: Option<&UIButtonConfiguration>);
#[method(setNeedsUpdateConfiguration)]
pub unsafe fn setNeedsUpdateConfiguration(&self);
#[method(updateConfiguration)]
pub unsafe fn updateConfiguration(&self);
#[cfg(feature = "block2")]
#[method(configurationUpdateHandler)]
pub unsafe fn configurationUpdateHandler(&self) -> UIButtonConfigurationUpdateHandler;
#[cfg(feature = "block2")]
#[method(setConfigurationUpdateHandler:)]
pub unsafe fn setConfigurationUpdateHandler(
&self,
configuration_update_handler: UIButtonConfigurationUpdateHandler,
);
#[method(automaticallyUpdatesConfiguration)]
pub unsafe fn automaticallyUpdatesConfiguration(&self) -> bool;
#[method(setAutomaticallyUpdatesConfiguration:)]
pub unsafe fn setAutomaticallyUpdatesConfiguration(
&self,
automatically_updates_configuration: bool,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other tintColor)]
pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setTintColor:)]
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
#[method(buttonType)]
pub unsafe fn buttonType(&self) -> UIButtonType;
#[method(isHovered)]
pub unsafe fn isHovered(&self) -> bool;
#[method(isHeld)]
pub unsafe fn isHeld(&self) -> bool;
#[method(role)]
pub unsafe fn role(&self) -> UIButtonRole;
#[method(setRole:)]
pub unsafe fn setRole(&self, role: UIButtonRole);
#[method(isPointerInteractionEnabled)]
pub unsafe fn isPointerInteractionEnabled(&self) -> bool;
#[method(setPointerInteractionEnabled:)]
pub unsafe fn setPointerInteractionEnabled(&self, pointer_interaction_enabled: bool);
#[cfg(all(
feature = "UIHoverStyle",
feature = "UIPointerStyle",
feature = "block2"
))]
#[method(pointerStyleProvider)]
pub unsafe fn pointerStyleProvider(&self) -> UIButtonPointerStyleProvider;
#[cfg(all(
feature = "UIHoverStyle",
feature = "UIPointerStyle",
feature = "block2"
))]
#[method(setPointerStyleProvider:)]
pub unsafe fn setPointerStyleProvider(
&self,
pointer_style_provider: UIButtonPointerStyleProvider,
);
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other menu)]
pub unsafe fn menu(&self) -> Option<Retained<UIMenu>>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method(setMenu:)]
pub unsafe fn setMenu(&self, menu: Option<&UIMenu>);
#[cfg(feature = "UIContextMenuConfiguration")]
#[method(preferredMenuElementOrder)]
pub unsafe fn preferredMenuElementOrder(&self) -> UIContextMenuConfigurationElementOrder;
#[cfg(feature = "UIContextMenuConfiguration")]
#[method(setPreferredMenuElementOrder:)]
pub unsafe fn setPreferredMenuElementOrder(
&self,
preferred_menu_element_order: UIContextMenuConfigurationElementOrder,
);
#[method(changesSelectionAsPrimaryAction)]
pub unsafe fn changesSelectionAsPrimaryAction(&self) -> bool;
#[method(setChangesSelectionAsPrimaryAction:)]
pub unsafe fn setChangesSelectionAsPrimaryAction(
&self,
changes_selection_as_primary_action: bool,
);
#[method(setTitle:forState:)]
pub unsafe fn setTitle_forState(&self, title: Option<&NSString>, state: UIControlState);
#[cfg(feature = "UIColor")]
#[method(setTitleColor:forState:)]
pub unsafe fn setTitleColor_forState(&self, color: Option<&UIColor>, state: UIControlState);
#[cfg(feature = "UIColor")]
#[method(setTitleShadowColor:forState:)]
pub unsafe fn setTitleShadowColor_forState(
&self,
color: Option<&UIColor>,
state: UIControlState,
);
#[cfg(feature = "UIImage")]
#[method(setImage:forState:)]
pub unsafe fn setImage_forState(&self, image: Option<&UIImage>, state: UIControlState);
#[cfg(feature = "UIImage")]
#[method(setBackgroundImage:forState:)]
pub unsafe fn setBackgroundImage_forState(
&self,
image: Option<&UIImage>,
state: UIControlState,
);
#[cfg(all(
feature = "UIImageConfiguration",
feature = "UIImageSymbolConfiguration"
))]
#[method(setPreferredSymbolConfiguration:forImageInState:)]
pub unsafe fn setPreferredSymbolConfiguration_forImageInState(
&self,
configuration: Option<&UIImageSymbolConfiguration>,
state: UIControlState,
);
#[method(setAttributedTitle:forState:)]
pub unsafe fn setAttributedTitle_forState(
&self,
title: Option<&NSAttributedString>,
state: UIControlState,
);
#[method_id(@__retain_semantics Other titleForState:)]
pub unsafe fn titleForState(&self, state: UIControlState) -> Option<Retained<NSString>>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other titleColorForState:)]
pub unsafe fn titleColorForState(&self, state: UIControlState)
-> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other titleShadowColorForState:)]
pub unsafe fn titleShadowColorForState(
&self,
state: UIControlState,
) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other imageForState:)]
pub unsafe fn imageForState(&self, state: UIControlState) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other backgroundImageForState:)]
pub unsafe fn backgroundImageForState(
&self,
state: UIControlState,
) -> Option<Retained<UIImage>>;
#[cfg(all(
feature = "UIImageConfiguration",
feature = "UIImageSymbolConfiguration"
))]
#[method_id(@__retain_semantics Other preferredSymbolConfigurationForImageInState:)]
pub unsafe fn preferredSymbolConfigurationForImageInState(
&self,
state: UIControlState,
) -> Option<Retained<UIImageSymbolConfiguration>>;
#[method_id(@__retain_semantics Other attributedTitleForState:)]
pub unsafe fn attributedTitleForState(
&self,
state: UIControlState,
) -> Option<Retained<NSAttributedString>>;
#[method_id(@__retain_semantics Other currentTitle)]
pub unsafe fn currentTitle(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other currentTitleColor)]
pub unsafe fn currentTitleColor(&self) -> Retained<UIColor>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other currentTitleShadowColor)]
pub unsafe fn currentTitleShadowColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other currentImage)]
pub unsafe fn currentImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other currentBackgroundImage)]
pub unsafe fn currentBackgroundImage(&self) -> Option<Retained<UIImage>>;
#[cfg(all(
feature = "UIImageConfiguration",
feature = "UIImageSymbolConfiguration"
))]
#[method_id(@__retain_semantics Other currentPreferredSymbolConfiguration)]
pub unsafe fn currentPreferredSymbolConfiguration(
&self,
) -> Option<Retained<UIImageSymbolConfiguration>>;
#[method_id(@__retain_semantics Other currentAttributedTitle)]
pub unsafe fn currentAttributedTitle(&self) -> Option<Retained<NSAttributedString>>;
#[cfg(feature = "UILabel")]
#[method_id(@__retain_semantics Other titleLabel)]
pub unsafe fn titleLabel(&self) -> Option<Retained<UILabel>>;
#[cfg(feature = "UIImageView")]
#[method_id(@__retain_semantics Other imageView)]
pub unsafe fn imageView(&self) -> Option<Retained<UIImageView>>;
#[cfg(feature = "UILabel")]
#[method_id(@__retain_semantics Other subtitleLabel)]
pub unsafe fn subtitleLabel(&self) -> Option<Retained<UILabel>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIButton {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIButton {
#[cfg(feature = "UIFont")]
#[deprecated = "Specify an attributed title with a custom font"]
#[method_id(@__retain_semantics Other font)]
pub unsafe fn font(&self) -> Retained<UIFont>;
#[cfg(feature = "UIFont")]
#[deprecated = "Specify an attributed title with a custom font"]
#[method(setFont:)]
pub unsafe fn setFont(&self, font: &UIFont);
#[cfg(feature = "NSParagraphStyle")]
#[deprecated = "Specify an attributed title with a customized paragraph style"]
#[method(lineBreakMode)]
pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSParagraphStyle")]
#[deprecated = "Specify an attributed title with a customized paragraph style"]
#[method(setLineBreakMode:)]
pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
#[deprecated = "Specify an attributed title with a customized shadow style"]
#[method(titleShadowOffset)]
pub unsafe fn titleShadowOffset(&self) -> CGSize;
#[deprecated = "Specify an attributed title with a customized shadow style"]
#[method(setTitleShadowOffset:)]
pub unsafe fn setTitleShadowOffset(&self, title_shadow_offset: CGSize);
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(contentEdgeInsets)]
pub unsafe fn contentEdgeInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(setContentEdgeInsets:)]
pub unsafe fn setContentEdgeInsets(&self, content_edge_insets: UIEdgeInsets);
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(titleEdgeInsets)]
pub unsafe fn titleEdgeInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(setTitleEdgeInsets:)]
pub unsafe fn setTitleEdgeInsets(&self, title_edge_insets: UIEdgeInsets);
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(imageEdgeInsets)]
pub unsafe fn imageEdgeInsets(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(setImageEdgeInsets:)]
pub unsafe fn setImageEdgeInsets(&self, image_edge_insets: UIEdgeInsets);
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(reversesTitleShadowWhenHighlighted)]
pub unsafe fn reversesTitleShadowWhenHighlighted(&self) -> bool;
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(setReversesTitleShadowWhenHighlighted:)]
pub unsafe fn setReversesTitleShadowWhenHighlighted(
&self,
reverses_title_shadow_when_highlighted: bool,
);
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(adjustsImageWhenHighlighted)]
pub unsafe fn adjustsImageWhenHighlighted(&self) -> bool;
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(setAdjustsImageWhenHighlighted:)]
pub unsafe fn setAdjustsImageWhenHighlighted(&self, adjusts_image_when_highlighted: bool);
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(adjustsImageWhenDisabled)]
pub unsafe fn adjustsImageWhenDisabled(&self) -> bool;
#[deprecated = "This property is ignored when using UIButtonConfiguration, you may customize to replicate this behavior via a configurationUpdateHandler"]
#[method(setAdjustsImageWhenDisabled:)]
pub unsafe fn setAdjustsImageWhenDisabled(&self, adjusts_image_when_disabled: bool);
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(showsTouchWhenHighlighted)]
pub unsafe fn showsTouchWhenHighlighted(&self) -> bool;
#[deprecated = "This property is ignored when using UIButtonConfiguration"]
#[method(setShowsTouchWhenHighlighted:)]
pub unsafe fn setShowsTouchWhenHighlighted(&self, shows_touch_when_highlighted: bool);
#[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
#[method(backgroundRectForBounds:)]
pub unsafe fn backgroundRectForBounds(&self, bounds: CGRect) -> CGRect;
#[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
#[method(contentRectForBounds:)]
pub unsafe fn contentRectForBounds(&self, bounds: CGRect) -> CGRect;
#[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
#[method(titleRectForContentRect:)]
pub unsafe fn titleRectForContentRect(&self, content_rect: CGRect) -> CGRect;
#[deprecated = "Override layoutSubviews, call super, and position views as you desire."]
#[method(imageRectForContentRect:)]
pub unsafe fn imageRectForContentRect(&self, content_rect: CGRect) -> CGRect;
}
);
extern_methods!(
/// SpringLoading
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIButton {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UISpringLoadedInteractionSupporting",
feature = "UIView"
))]
unsafe impl UISpringLoadedInteractionSupporting for UIButton {}

View File

@@ -0,0 +1,448 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(feature = "block2")]
pub type UIConfigurationTextAttributesTransformer = *mut block2::Block<
dyn Fn(
NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
) -> NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
>;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonConfigurationSize(pub NSInteger);
impl UIButtonConfigurationSize {
#[doc(alias = "UIButtonConfigurationSizeMedium")]
pub const Medium: Self = Self(0);
#[doc(alias = "UIButtonConfigurationSizeSmall")]
pub const Small: Self = Self(1);
#[doc(alias = "UIButtonConfigurationSizeMini")]
pub const Mini: Self = Self(2);
#[doc(alias = "UIButtonConfigurationSizeLarge")]
pub const Large: Self = Self(3);
}
unsafe impl Encode for UIButtonConfigurationSize {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonConfigurationSize {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonConfigurationTitleAlignment(pub NSInteger);
impl UIButtonConfigurationTitleAlignment {
#[doc(alias = "UIButtonConfigurationTitleAlignmentAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIButtonConfigurationTitleAlignmentLeading")]
pub const Leading: Self = Self(1);
#[doc(alias = "UIButtonConfigurationTitleAlignmentCenter")]
pub const Center: Self = Self(2);
#[doc(alias = "UIButtonConfigurationTitleAlignmentTrailing")]
pub const Trailing: Self = Self(3);
}
unsafe impl Encode for UIButtonConfigurationTitleAlignment {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonConfigurationTitleAlignment {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonConfigurationCornerStyle(pub NSInteger);
impl UIButtonConfigurationCornerStyle {
#[doc(alias = "UIButtonConfigurationCornerStyleFixed")]
pub const Fixed: Self = Self(-1);
#[doc(alias = "UIButtonConfigurationCornerStyleDynamic")]
pub const Dynamic: Self = Self(0);
#[doc(alias = "UIButtonConfigurationCornerStyleSmall")]
pub const Small: Self = Self(1);
#[doc(alias = "UIButtonConfigurationCornerStyleMedium")]
pub const Medium: Self = Self(2);
#[doc(alias = "UIButtonConfigurationCornerStyleLarge")]
pub const Large: Self = Self(3);
#[doc(alias = "UIButtonConfigurationCornerStyleCapsule")]
pub const Capsule: Self = Self(4);
}
unsafe impl Encode for UIButtonConfigurationCornerStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonConfigurationCornerStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonConfigurationMacIdiomStyle(pub NSInteger);
impl UIButtonConfigurationMacIdiomStyle {
#[doc(alias = "UIButtonConfigurationMacIdiomStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIButtonConfigurationMacIdiomStyleBordered")]
pub const Bordered: Self = Self(1);
#[doc(alias = "UIButtonConfigurationMacIdiomStyleBorderless")]
pub const Borderless: Self = Self(2);
#[doc(alias = "UIButtonConfigurationMacIdiomStyleBorderlessTinted")]
pub const BorderlessTinted: Self = Self(3);
}
unsafe impl Encode for UIButtonConfigurationMacIdiomStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonConfigurationMacIdiomStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIButtonConfigurationIndicator(pub NSInteger);
impl UIButtonConfigurationIndicator {
#[doc(alias = "UIButtonConfigurationIndicatorAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIButtonConfigurationIndicatorNone")]
pub const None: Self = Self(1);
#[doc(alias = "UIButtonConfigurationIndicatorPopup")]
pub const Popup: Self = Self(2);
}
unsafe impl Encode for UIButtonConfigurationIndicator {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIButtonConfigurationIndicator {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIButtonConfiguration;
unsafe impl ClassType for UIButtonConfiguration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UIButtonConfiguration {}
unsafe impl NSCopying for UIButtonConfiguration {}
unsafe impl NSObjectProtocol for UIButtonConfiguration {}
unsafe impl NSSecureCoding for UIButtonConfiguration {}
extern_methods!(
unsafe impl UIButtonConfiguration {
#[method_id(@__retain_semantics Other plainButtonConfiguration)]
pub unsafe fn plainButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other tintedButtonConfiguration)]
pub unsafe fn tintedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other grayButtonConfiguration)]
pub unsafe fn grayButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other filledButtonConfiguration)]
pub unsafe fn filledButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other borderlessButtonConfiguration)]
pub unsafe fn borderlessButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other borderedButtonConfiguration)]
pub unsafe fn borderedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other borderedTintedButtonConfiguration)]
pub unsafe fn borderedTintedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Other borderedProminentButtonConfiguration)]
pub unsafe fn borderedProminentButtonConfiguration(mtm: MainThreadMarker)
-> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(
feature = "UIButton",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other updatedConfigurationForButton:)]
pub unsafe fn updatedConfigurationForButton(&self, button: &UIButton) -> Retained<Self>;
#[cfg(feature = "UIBackgroundConfiguration")]
#[method_id(@__retain_semantics Other background)]
pub unsafe fn background(&self) -> Retained<UIBackgroundConfiguration>;
#[cfg(feature = "UIBackgroundConfiguration")]
#[method(setBackground:)]
pub unsafe fn setBackground(&self, background: &UIBackgroundConfiguration);
#[method(cornerStyle)]
pub unsafe fn cornerStyle(&self) -> UIButtonConfigurationCornerStyle;
#[method(setCornerStyle:)]
pub unsafe fn setCornerStyle(&self, corner_style: UIButtonConfigurationCornerStyle);
#[method(buttonSize)]
pub unsafe fn buttonSize(&self) -> UIButtonConfigurationSize;
#[method(setButtonSize:)]
pub unsafe fn setButtonSize(&self, button_size: UIButtonConfigurationSize);
#[method(macIdiomStyle)]
pub unsafe fn macIdiomStyle(&self) -> UIButtonConfigurationMacIdiomStyle;
#[method(setMacIdiomStyle:)]
pub unsafe fn setMacIdiomStyle(&self, mac_idiom_style: UIButtonConfigurationMacIdiomStyle);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other baseForegroundColor)]
pub unsafe fn baseForegroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBaseForegroundColor:)]
pub unsafe fn setBaseForegroundColor(&self, base_foreground_color: Option<&UIColor>);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other baseBackgroundColor)]
pub unsafe fn baseBackgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBaseBackgroundColor:)]
pub unsafe fn setBaseBackgroundColor(&self, base_background_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other image)]
pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[method(setImage:)]
pub unsafe fn setImage(&self, image: Option<&UIImage>);
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(imageColorTransformer)]
pub unsafe fn imageColorTransformer(&self) -> UIConfigurationColorTransformer;
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(setImageColorTransformer:)]
pub unsafe fn setImageColorTransformer(
&self,
image_color_transformer: UIConfigurationColorTransformer,
);
#[cfg(all(
feature = "UIImageConfiguration",
feature = "UIImageSymbolConfiguration"
))]
#[method_id(@__retain_semantics Other preferredSymbolConfigurationForImage)]
pub unsafe fn preferredSymbolConfigurationForImage(
&self,
) -> Option<Retained<UIImageSymbolConfiguration>>;
#[cfg(all(
feature = "UIImageConfiguration",
feature = "UIImageSymbolConfiguration"
))]
#[method(setPreferredSymbolConfigurationForImage:)]
pub unsafe fn setPreferredSymbolConfigurationForImage(
&self,
preferred_symbol_configuration_for_image: Option<&UIImageSymbolConfiguration>,
);
#[method(showsActivityIndicator)]
pub unsafe fn showsActivityIndicator(&self) -> bool;
#[method(setShowsActivityIndicator:)]
pub unsafe fn setShowsActivityIndicator(&self, shows_activity_indicator: bool);
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(activityIndicatorColorTransformer)]
pub unsafe fn activityIndicatorColorTransformer(&self) -> UIConfigurationColorTransformer;
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(setActivityIndicatorColorTransformer:)]
pub unsafe fn setActivityIndicatorColorTransformer(
&self,
activity_indicator_color_transformer: UIConfigurationColorTransformer,
);
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: Option<&NSString>);
#[method_id(@__retain_semantics Other attributedTitle)]
pub unsafe fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAttributedTitle:)]
pub unsafe fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);
#[cfg(feature = "block2")]
#[method(titleTextAttributesTransformer)]
pub unsafe fn titleTextAttributesTransformer(
&self,
) -> UIConfigurationTextAttributesTransformer;
#[cfg(feature = "block2")]
#[method(setTitleTextAttributesTransformer:)]
pub unsafe fn setTitleTextAttributesTransformer(
&self,
title_text_attributes_transformer: UIConfigurationTextAttributesTransformer,
);
#[cfg(feature = "NSParagraphStyle")]
#[method(titleLineBreakMode)]
pub unsafe fn titleLineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSParagraphStyle")]
#[method(setTitleLineBreakMode:)]
pub unsafe fn setTitleLineBreakMode(&self, title_line_break_mode: NSLineBreakMode);
#[method_id(@__retain_semantics Other subtitle)]
pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
#[method(setSubtitle:)]
pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
#[method_id(@__retain_semantics Other attributedSubtitle)]
pub unsafe fn attributedSubtitle(&self) -> Option<Retained<NSAttributedString>>;
#[method(setAttributedSubtitle:)]
pub unsafe fn setAttributedSubtitle(
&self,
attributed_subtitle: Option<&NSAttributedString>,
);
#[cfg(feature = "block2")]
#[method(subtitleTextAttributesTransformer)]
pub unsafe fn subtitleTextAttributesTransformer(
&self,
) -> UIConfigurationTextAttributesTransformer;
#[cfg(feature = "block2")]
#[method(setSubtitleTextAttributesTransformer:)]
pub unsafe fn setSubtitleTextAttributesTransformer(
&self,
subtitle_text_attributes_transformer: UIConfigurationTextAttributesTransformer,
);
#[cfg(feature = "NSParagraphStyle")]
#[method(subtitleLineBreakMode)]
pub unsafe fn subtitleLineBreakMode(&self) -> NSLineBreakMode;
#[cfg(feature = "NSParagraphStyle")]
#[method(setSubtitleLineBreakMode:)]
pub unsafe fn setSubtitleLineBreakMode(&self, subtitle_line_break_mode: NSLineBreakMode);
#[method(indicator)]
pub unsafe fn indicator(&self) -> UIButtonConfigurationIndicator;
#[method(setIndicator:)]
pub unsafe fn setIndicator(&self, indicator: UIButtonConfigurationIndicator);
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(indicatorColorTransformer)]
pub unsafe fn indicatorColorTransformer(&self) -> UIConfigurationColorTransformer;
#[cfg(all(
feature = "UIColor",
feature = "UIConfigurationColorTransformer",
feature = "block2"
))]
#[method(setIndicatorColorTransformer:)]
pub unsafe fn setIndicatorColorTransformer(
&self,
indicator_color_transformer: UIConfigurationColorTransformer,
);
#[cfg(feature = "UIGeometry")]
#[method(contentInsets)]
pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setContentInsets:)]
pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
#[method(setDefaultContentInsets)]
pub unsafe fn setDefaultContentInsets(&self);
#[cfg(feature = "UIGeometry")]
#[method(imagePlacement)]
pub unsafe fn imagePlacement(&self) -> NSDirectionalRectEdge;
#[cfg(feature = "UIGeometry")]
#[method(setImagePlacement:)]
pub unsafe fn setImagePlacement(&self, image_placement: NSDirectionalRectEdge);
#[method(imagePadding)]
pub unsafe fn imagePadding(&self) -> CGFloat;
#[method(setImagePadding:)]
pub unsafe fn setImagePadding(&self, image_padding: CGFloat);
#[method(titlePadding)]
pub unsafe fn titlePadding(&self) -> CGFloat;
#[method(setTitlePadding:)]
pub unsafe fn setTitlePadding(&self, title_padding: CGFloat);
#[method(titleAlignment)]
pub unsafe fn titleAlignment(&self) -> UIButtonConfigurationTitleAlignment;
#[method(setTitleAlignment:)]
pub unsafe fn setTitleAlignment(
&self,
title_alignment: UIButtonConfigurationTitleAlignment,
);
#[method(automaticallyUpdateForSelection)]
pub unsafe fn automaticallyUpdateForSelection(&self) -> bool;
#[method(setAutomaticallyUpdateForSelection:)]
pub unsafe fn setAutomaticallyUpdateForSelection(
&self,
automatically_update_for_selection: bool,
);
}
);

View File

@@ -0,0 +1,31 @@
//! 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 UICalendarSelection;
unsafe impl ClassType for UICalendarSelection {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICalendarSelection {}
extern_methods!(
unsafe impl UICalendarSelection {
#[method(updateSelectableDates)]
pub unsafe fn updateSelectableDates(&self);
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,103 @@
//! 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)]
#[cfg(feature = "UICalendarSelection")]
pub struct UICalendarSelectionMultiDate;
#[cfg(feature = "UICalendarSelection")]
unsafe impl ClassType for UICalendarSelectionMultiDate {
#[inherits(NSObject)]
type Super = UICalendarSelection;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UICalendarSelection")]
unsafe impl NSObjectProtocol for UICalendarSelectionMultiDate {}
extern_methods!(
#[cfg(feature = "UICalendarSelection")]
unsafe impl UICalendarSelectionMultiDate {
#[method_id(@__retain_semantics Other selectedDates)]
pub unsafe fn selectedDates(&self) -> Retained<NSArray<NSDateComponents>>;
#[method(setSelectedDates:)]
pub unsafe fn setSelectedDates(&self, selected_dates: &NSArray<NSDateComponents>);
#[method(setSelectedDates:animated:)]
pub unsafe fn setSelectedDates_animated(
&self,
selected_dates: &NSArray<NSDateComponents>,
animated: bool,
);
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionMultiDateDelegate>>>;
#[method_id(@__retain_semantics Init initWithDelegate:)]
pub unsafe fn initWithDelegate(
this: Allocated<Self>,
delegate: Option<&ProtocolObject<dyn UICalendarSelectionMultiDateDelegate>>,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `UICalendarSelection`
#[cfg(feature = "UICalendarSelection")]
unsafe impl UICalendarSelectionMultiDate {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait UICalendarSelectionMultiDateDelegate: NSObjectProtocol {
#[cfg(feature = "UICalendarSelection")]
#[method(multiDateSelection:didSelectDate:)]
unsafe fn multiDateSelection_didSelectDate(
&self,
selection: &UICalendarSelectionMultiDate,
date_components: &NSDateComponents,
);
#[cfg(feature = "UICalendarSelection")]
#[method(multiDateSelection:didDeselectDate:)]
unsafe fn multiDateSelection_didDeselectDate(
&self,
selection: &UICalendarSelectionMultiDate,
date_components: &NSDateComponents,
);
#[cfg(feature = "UICalendarSelection")]
#[optional]
#[method(multiDateSelection:canSelectDate:)]
unsafe fn multiDateSelection_canSelectDate(
&self,
selection: &UICalendarSelectionMultiDate,
date_components: &NSDateComponents,
) -> bool;
#[cfg(feature = "UICalendarSelection")]
#[optional]
#[method(multiDateSelection:canDeselectDate:)]
unsafe fn multiDateSelection_canDeselectDate(
&self,
selection: &UICalendarSelectionMultiDate,
date_components: &NSDateComponents,
) -> bool;
}
unsafe impl ProtocolType for dyn UICalendarSelectionMultiDateDelegate {}
);

View File

@@ -0,0 +1,86 @@
//! 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)]
#[cfg(feature = "UICalendarSelection")]
pub struct UICalendarSelectionSingleDate;
#[cfg(feature = "UICalendarSelection")]
unsafe impl ClassType for UICalendarSelectionSingleDate {
#[inherits(NSObject)]
type Super = UICalendarSelection;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UICalendarSelection")]
unsafe impl NSObjectProtocol for UICalendarSelectionSingleDate {}
extern_methods!(
#[cfg(feature = "UICalendarSelection")]
unsafe impl UICalendarSelectionSingleDate {
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>>;
#[method_id(@__retain_semantics Other selectedDate)]
pub unsafe fn selectedDate(&self) -> Option<Retained<NSDateComponents>>;
#[method(setSelectedDate:)]
pub unsafe fn setSelectedDate(&self, selected_date: Option<&NSDateComponents>);
#[method(setSelectedDate:animated:)]
pub unsafe fn setSelectedDate_animated(
&self,
selected_date: Option<&NSDateComponents>,
animated: bool,
);
#[method_id(@__retain_semantics Init initWithDelegate:)]
pub unsafe fn initWithDelegate(
this: Allocated<Self>,
delegate: Option<&ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `UICalendarSelection`
#[cfg(feature = "UICalendarSelection")]
unsafe impl UICalendarSelectionSingleDate {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait UICalendarSelectionSingleDateDelegate: NSObjectProtocol {
#[cfg(feature = "UICalendarSelection")]
#[method(dateSelection:didSelectDate:)]
unsafe fn dateSelection_didSelectDate(
&self,
selection: &UICalendarSelectionSingleDate,
date_components: Option<&NSDateComponents>,
);
#[cfg(feature = "UICalendarSelection")]
#[optional]
#[method(dateSelection:canSelectDate:)]
unsafe fn dateSelection_canSelectDate(
&self,
selection: &UICalendarSelectionSingleDate,
date_components: Option<&NSDateComponents>,
) -> bool;
}
unsafe impl ProtocolType for dyn UICalendarSelectionSingleDateDelegate {}
);

View File

@@ -0,0 +1,208 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UICalendarView;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UICalendarView {
#[inherits(UIResponder, NSObject)]
type Super = UIView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UICalendarView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UICalendarView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UICalendarView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UICalendarView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UICalendarView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UICalendarView {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UICalendarView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UICalendarView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UICalendarView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UICalendarView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UICalendarView {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UICalendarView {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICalendarView {
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICalendarViewDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UICalendarViewDelegate>>,
);
#[cfg(feature = "UICalendarSelection")]
#[method_id(@__retain_semantics Other selectionBehavior)]
pub unsafe fn selectionBehavior(&self) -> Option<Retained<UICalendarSelection>>;
#[cfg(feature = "UICalendarSelection")]
#[method(setSelectionBehavior:)]
pub unsafe fn setSelectionBehavior(&self, selection_behavior: Option<&UICalendarSelection>);
#[method_id(@__retain_semantics Other locale)]
pub unsafe fn locale(&self) -> Retained<NSLocale>;
#[method(setLocale:)]
pub unsafe fn setLocale(&self, locale: &NSLocale);
#[method_id(@__retain_semantics Other calendar)]
pub unsafe fn calendar(&self) -> Retained<NSCalendar>;
#[method(setCalendar:)]
pub unsafe fn setCalendar(&self, calendar: &NSCalendar);
#[method_id(@__retain_semantics Other timeZone)]
pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
#[method(setTimeZone:)]
pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
#[cfg(feature = "UIFontDescriptor")]
#[method_id(@__retain_semantics Other fontDesign)]
pub unsafe fn fontDesign(&self) -> Retained<UIFontDescriptorSystemDesign>;
#[cfg(feature = "UIFontDescriptor")]
#[method(setFontDesign:)]
pub unsafe fn setFontDesign(&self, font_design: &UIFontDescriptorSystemDesign);
#[method_id(@__retain_semantics Other availableDateRange)]
pub unsafe fn availableDateRange(&self) -> Retained<NSDateInterval>;
#[method(setAvailableDateRange:)]
pub unsafe fn setAvailableDateRange(&self, available_date_range: &NSDateInterval);
#[method_id(@__retain_semantics Other visibleDateComponents)]
pub unsafe fn visibleDateComponents(&self) -> Retained<NSDateComponents>;
#[method(setVisibleDateComponents:)]
pub unsafe fn setVisibleDateComponents(&self, visible_date_components: &NSDateComponents);
#[method(setVisibleDateComponents:animated:)]
pub unsafe fn setVisibleDateComponents_animated(
&self,
date_components: &NSDateComponents,
animated: bool,
);
#[method(wantsDateDecorations)]
pub unsafe fn wantsDateDecorations(&self) -> bool;
#[method(setWantsDateDecorations:)]
pub unsafe fn setWantsDateDecorations(&self, wants_date_decorations: bool);
#[method(reloadDecorationsForDateComponents:animated:)]
pub unsafe fn reloadDecorationsForDateComponents_animated(
&self,
dates: &NSArray<NSDateComponents>,
animated: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `UIView`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICalendarView {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICalendarView {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
pub unsafe trait UICalendarViewDelegate: NSObjectProtocol {
#[cfg(all(
feature = "UICalendarViewDecoration",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method_id(@__retain_semantics Other calendarView:decorationForDateComponents:)]
unsafe fn calendarView_decorationForDateComponents(
&self,
calendar_view: &UICalendarView,
date_components: &NSDateComponents,
) -> Option<Retained<UICalendarViewDecoration>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method(calendarView:didChangeVisibleDateComponentsFrom:)]
unsafe fn calendarView_didChangeVisibleDateComponentsFrom(
&self,
calendar_view: &UICalendarView,
previous_date_components: &NSDateComponents,
);
}
unsafe impl ProtocolType for dyn UICalendarViewDelegate {}
);

View File

@@ -0,0 +1,101 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICalendarViewDecorationSize(pub NSInteger);
impl UICalendarViewDecorationSize {
#[doc(alias = "UICalendarViewDecorationSizeSmall")]
pub const Small: Self = Self(0);
#[doc(alias = "UICalendarViewDecorationSizeMedium")]
pub const Medium: Self = Self(1);
#[doc(alias = "UICalendarViewDecorationSizeLarge")]
pub const Large: Self = Self(2);
}
unsafe impl Encode for UICalendarViewDecorationSize {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICalendarViewDecorationSize {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICalendarViewDecoration;
unsafe impl ClassType for UICalendarViewDecoration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICalendarViewDecoration {}
extern_methods!(
unsafe impl UICalendarViewDecoration {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "UIColor", feature = "UIImage"))]
#[method_id(@__retain_semantics Init initWithImage:color:size:)]
pub unsafe fn initWithImage_color_size(
this: Allocated<Self>,
image: Option<&UIImage>,
color: Option<&UIColor>,
size: UICalendarViewDecorationSize,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView", feature = "block2"))]
#[method_id(@__retain_semantics Init initWithCustomViewProvider:)]
pub unsafe fn initWithCustomViewProvider(
this: Allocated<Self>,
custom_view_provider: &block2::Block<dyn Fn() -> NonNull<UIView>>,
) -> Retained<Self>;
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other decorationWithColor:size:)]
pub unsafe fn decorationWithColor_size(
color: Option<&UIColor>,
size: UICalendarViewDecorationSize,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other decorationWithImage:)]
pub unsafe fn decorationWithImage(
image: Option<&UIImage>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIColor", feature = "UIImage"))]
#[method_id(@__retain_semantics Other decorationWithImage:color:size:)]
pub unsafe fn decorationWithImage_color_size(
image: Option<&UIImage>,
color: Option<&UIColor>,
size: UICalendarViewDecorationSize,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView", feature = "block2"))]
#[method_id(@__retain_semantics Other decorationWithCustomViewProvider:)]
pub unsafe fn decorationWithCustomViewProvider(
custom_view_provider: &block2::Block<dyn Fn() -> NonNull<UIView>>,
mtm: MainThreadMarker,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICalendarViewDecoration {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,56 @@
//! 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)]
#[cfg(feature = "UIFeedbackGenerator")]
pub struct UICanvasFeedbackGenerator;
#[cfg(feature = "UIFeedbackGenerator")]
unsafe impl ClassType for UICanvasFeedbackGenerator {
#[inherits(NSObject)]
type Super = UIFeedbackGenerator;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIFeedbackGenerator")]
unsafe impl NSObjectProtocol for UICanvasFeedbackGenerator {}
extern_methods!(
#[cfg(feature = "UIFeedbackGenerator")]
unsafe impl UICanvasFeedbackGenerator {
#[method(alignmentOccurredAtLocation:)]
pub unsafe fn alignmentOccurredAtLocation(&self, location: CGPoint);
#[method(pathCompletedAtLocation:)]
pub unsafe fn pathCompletedAtLocation(&self, location: CGPoint);
}
);
extern_methods!(
/// Methods declared on superclass `UIFeedbackGenerator`
#[cfg(feature = "UIFeedbackGenerator")]
unsafe impl UICanvasFeedbackGenerator {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other feedbackGeneratorForView:)]
pub unsafe fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;
#[deprecated]
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIFeedbackGenerator")]
unsafe impl UICanvasFeedbackGenerator {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,757 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellAccessoryDisplayedState(pub NSInteger);
impl UICellAccessoryDisplayedState {
pub const UICellAccessoryDisplayedAlways: Self = Self(0);
pub const UICellAccessoryDisplayedWhenEditing: Self = Self(1);
pub const UICellAccessoryDisplayedWhenNotEditing: Self = Self(2);
}
unsafe impl Encode for UICellAccessoryDisplayedState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryDisplayedState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static UICellAccessoryStandardDimension: CGFloat;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessory;
unsafe impl ClassType for UICellAccessory {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessory {}
unsafe impl NSCopying for UICellAccessory {}
unsafe impl NSObjectProtocol for UICellAccessory {}
unsafe impl NSSecureCoding for UICellAccessory {}
extern_methods!(
unsafe impl UICellAccessory {
#[method(displayedState)]
pub unsafe fn displayedState(&self) -> UICellAccessoryDisplayedState;
#[method(setDisplayedState:)]
pub unsafe fn setDisplayedState(&self, displayed_state: UICellAccessoryDisplayedState);
#[method(isHidden)]
pub unsafe fn isHidden(&self) -> bool;
#[method(setHidden:)]
pub unsafe fn setHidden(&self, hidden: bool);
#[method(reservedLayoutWidth)]
pub unsafe fn reservedLayoutWidth(&self) -> CGFloat;
#[method(setReservedLayoutWidth:)]
pub unsafe fn setReservedLayoutWidth(&self, reserved_layout_width: CGFloat);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other tintColor)]
pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setTintColor:)]
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessory {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDisclosureIndicator;
unsafe impl ClassType for UICellAccessoryDisclosureIndicator {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryDisclosureIndicator {}
unsafe impl NSCopying for UICellAccessoryDisclosureIndicator {}
unsafe impl NSObjectProtocol for UICellAccessoryDisclosureIndicator {}
unsafe impl NSSecureCoding for UICellAccessoryDisclosureIndicator {}
extern_methods!(
unsafe impl UICellAccessoryDisclosureIndicator {}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryDisclosureIndicator {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryDisclosureIndicator {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDetail;
unsafe impl ClassType for UICellAccessoryDetail {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryDetail {}
unsafe impl NSCopying for UICellAccessoryDetail {}
unsafe impl NSObjectProtocol for UICellAccessoryDetail {}
unsafe impl NSSecureCoding for UICellAccessoryDetail {}
extern_methods!(
unsafe impl UICellAccessoryDetail {
#[cfg(feature = "block2")]
#[method(actionHandler)]
pub unsafe fn actionHandler(&self) -> *mut block2::Block<dyn Fn()>;
#[cfg(feature = "block2")]
#[method(setActionHandler:)]
pub unsafe fn setActionHandler(&self, action_handler: Option<&block2::Block<dyn Fn()>>);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryDetail {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryDetail {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryCheckmark;
unsafe impl ClassType for UICellAccessoryCheckmark {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryCheckmark {}
unsafe impl NSCopying for UICellAccessoryCheckmark {}
unsafe impl NSObjectProtocol for UICellAccessoryCheckmark {}
unsafe impl NSSecureCoding for UICellAccessoryCheckmark {}
extern_methods!(
unsafe impl UICellAccessoryCheckmark {}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryCheckmark {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryCheckmark {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryDelete;
unsafe impl ClassType for UICellAccessoryDelete {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryDelete {}
unsafe impl NSCopying for UICellAccessoryDelete {}
unsafe impl NSObjectProtocol for UICellAccessoryDelete {}
unsafe impl NSSecureCoding for UICellAccessoryDelete {}
extern_methods!(
unsafe impl UICellAccessoryDelete {
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "block2")]
#[method(actionHandler)]
pub unsafe fn actionHandler(&self) -> *mut block2::Block<dyn Fn()>;
#[cfg(feature = "block2")]
#[method(setActionHandler:)]
pub unsafe fn setActionHandler(&self, action_handler: Option<&block2::Block<dyn Fn()>>);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryDelete {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryDelete {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryInsert;
unsafe impl ClassType for UICellAccessoryInsert {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryInsert {}
unsafe impl NSCopying for UICellAccessoryInsert {}
unsafe impl NSObjectProtocol for UICellAccessoryInsert {}
unsafe impl NSSecureCoding for UICellAccessoryInsert {}
extern_methods!(
unsafe impl UICellAccessoryInsert {
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "block2")]
#[method(actionHandler)]
pub unsafe fn actionHandler(&self) -> *mut block2::Block<dyn Fn()>;
#[cfg(feature = "block2")]
#[method(setActionHandler:)]
pub unsafe fn setActionHandler(&self, action_handler: Option<&block2::Block<dyn Fn()>>);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryInsert {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryInsert {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryReorder;
unsafe impl ClassType for UICellAccessoryReorder {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryReorder {}
unsafe impl NSCopying for UICellAccessoryReorder {}
unsafe impl NSObjectProtocol for UICellAccessoryReorder {}
unsafe impl NSSecureCoding for UICellAccessoryReorder {}
extern_methods!(
unsafe impl UICellAccessoryReorder {
#[method(showsVerticalSeparator)]
pub unsafe fn showsVerticalSeparator(&self) -> bool;
#[method(setShowsVerticalSeparator:)]
pub unsafe fn setShowsVerticalSeparator(&self, shows_vertical_separator: bool);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryReorder {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryReorder {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryMultiselect;
unsafe impl ClassType for UICellAccessoryMultiselect {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryMultiselect {}
unsafe impl NSCopying for UICellAccessoryMultiselect {}
unsafe impl NSObjectProtocol for UICellAccessoryMultiselect {}
unsafe impl NSSecureCoding for UICellAccessoryMultiselect {}
extern_methods!(
unsafe impl UICellAccessoryMultiselect {
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryMultiselect {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryMultiselect {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellAccessoryOutlineDisclosureStyle(pub NSInteger);
impl UICellAccessoryOutlineDisclosureStyle {
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleHeader")]
pub const Header: Self = Self(1);
#[doc(alias = "UICellAccessoryOutlineDisclosureStyleCell")]
pub const Cell: Self = Self(2);
}
unsafe impl Encode for UICellAccessoryOutlineDisclosureStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryOutlineDisclosureStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryOutlineDisclosure;
unsafe impl ClassType for UICellAccessoryOutlineDisclosure {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryOutlineDisclosure {}
unsafe impl NSCopying for UICellAccessoryOutlineDisclosure {}
unsafe impl NSObjectProtocol for UICellAccessoryOutlineDisclosure {}
unsafe impl NSSecureCoding for UICellAccessoryOutlineDisclosure {}
extern_methods!(
unsafe impl UICellAccessoryOutlineDisclosure {
#[method(style)]
pub unsafe fn style(&self) -> UICellAccessoryOutlineDisclosureStyle;
#[method(setStyle:)]
pub unsafe fn setStyle(&self, style: UICellAccessoryOutlineDisclosureStyle);
#[cfg(feature = "block2")]
#[method(actionHandler)]
pub unsafe fn actionHandler(&self) -> *mut block2::Block<dyn Fn()>;
#[cfg(feature = "block2")]
#[method(setActionHandler:)]
pub unsafe fn setActionHandler(&self, action_handler: Option<&block2::Block<dyn Fn()>>);
}
);
extern_methods!(
/// Methods declared on superclass `UICellAccessory`
unsafe impl UICellAccessoryOutlineDisclosure {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICellAccessoryOutlineDisclosure {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryPopUpMenu;
unsafe impl ClassType for UICellAccessoryPopUpMenu {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryPopUpMenu {}
unsafe impl NSCopying for UICellAccessoryPopUpMenu {}
unsafe impl NSObjectProtocol for UICellAccessoryPopUpMenu {}
unsafe impl NSSecureCoding for UICellAccessoryPopUpMenu {}
extern_methods!(
unsafe impl UICellAccessoryPopUpMenu {
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithMenu:)]
pub unsafe fn initWithMenu(this: Allocated<Self>, menu: &UIMenu) -> Retained<Self>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Other menu)]
pub unsafe fn menu(&self) -> Retained<UIMenu>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
#[method(selectedElementDidChangeHandler)]
pub unsafe fn selectedElementDidChangeHandler(
&self,
) -> *mut block2::Block<dyn Fn(NonNull<UIMenu>)>;
#[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
#[method(setSelectedElementDidChangeHandler:)]
pub unsafe fn setSelectedElementDidChangeHandler(
&self,
selected_element_did_change_handler: Option<&block2::Block<dyn Fn(NonNull<UIMenu>)>>,
);
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryLabel;
unsafe impl ClassType for UICellAccessoryLabel {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryLabel {}
unsafe impl NSCopying for UICellAccessoryLabel {}
unsafe impl NSObjectProtocol for UICellAccessoryLabel {}
unsafe impl NSSecureCoding for UICellAccessoryLabel {}
extern_methods!(
unsafe impl UICellAccessoryLabel {
#[method_id(@__retain_semantics Init initWithText:)]
pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
#[method_id(@__retain_semantics Other text)]
pub unsafe fn text(&self) -> Retained<NSString>;
#[cfg(feature = "UIFont")]
#[method_id(@__retain_semantics Other font)]
pub unsafe fn font(&self) -> Retained<UIFont>;
#[cfg(feature = "UIFont")]
#[method(setFont:)]
pub unsafe fn setFont(&self, font: &UIFont);
#[method(adjustsFontForContentSizeCategory)]
pub unsafe fn adjustsFontForContentSizeCategory(&self) -> bool;
#[method(setAdjustsFontForContentSizeCategory:)]
pub unsafe fn setAdjustsFontForContentSizeCategory(
&self,
adjusts_font_for_content_size_category: bool,
);
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellAccessoryPlacement(pub NSInteger);
impl UICellAccessoryPlacement {
#[doc(alias = "UICellAccessoryPlacementLeading")]
pub const Leading: Self = Self(0);
#[doc(alias = "UICellAccessoryPlacementTrailing")]
pub const Trailing: Self = Self(1);
}
unsafe impl Encode for UICellAccessoryPlacement {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellAccessoryPlacement {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "block2")]
pub type UICellAccessoryPosition =
*mut block2::Block<dyn Fn(NonNull<NSArray<UICellAccessory>>) -> NSUInteger>;
extern "C" {
#[cfg(feature = "block2")]
pub fn UICellAccessoryPositionBeforeAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}
extern "C" {
#[cfg(feature = "block2")]
pub fn UICellAccessoryPositionAfterAccessoryOfClass(
accessory_class: &AnyClass,
) -> UICellAccessoryPosition;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICellAccessoryCustomView;
unsafe impl ClassType for UICellAccessoryCustomView {
#[inherits(NSObject)]
type Super = UICellAccessory;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICellAccessoryCustomView {}
unsafe impl NSCopying for UICellAccessoryCustomView {}
unsafe impl NSObjectProtocol for UICellAccessoryCustomView {}
unsafe impl NSSecureCoding for UICellAccessoryCustomView {}
extern_methods!(
unsafe impl UICellAccessoryCustomView {
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Init initWithCustomView:placement:)]
pub unsafe fn initWithCustomView_placement(
this: Allocated<Self>,
custom_view: &UIView,
placement: UICellAccessoryPlacement,
) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[method_id(@__retain_semantics Other customView)]
pub unsafe fn customView(&self) -> Retained<UIView>;
#[method(placement)]
pub unsafe fn placement(&self) -> UICellAccessoryPlacement;
#[method(maintainsFixedSize)]
pub unsafe fn maintainsFixedSize(&self) -> bool;
#[method(setMaintainsFixedSize:)]
pub unsafe fn setMaintainsFixedSize(&self, maintains_fixed_size: bool);
#[cfg(feature = "block2")]
#[method(position)]
pub unsafe fn position(&self) -> UICellAccessoryPosition;
#[cfg(feature = "block2")]
#[method(setPosition:)]
pub unsafe fn setPosition(&self, position: UICellAccessoryPosition);
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,142 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellConfigurationDragState(pub NSInteger);
impl UICellConfigurationDragState {
#[doc(alias = "UICellConfigurationDragStateNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICellConfigurationDragStateLifting")]
pub const Lifting: Self = Self(1);
#[doc(alias = "UICellConfigurationDragStateDragging")]
pub const Dragging: Self = Self(2);
}
unsafe impl Encode for UICellConfigurationDragState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellConfigurationDragState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICellConfigurationDropState(pub NSInteger);
impl UICellConfigurationDropState {
#[doc(alias = "UICellConfigurationDropStateNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICellConfigurationDropStateNotTargeted")]
pub const NotTargeted: Self = Self(1);
#[doc(alias = "UICellConfigurationDropStateTargeted")]
pub const Targeted: Self = Self(2);
}
unsafe impl Encode for UICellConfigurationDropState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICellConfigurationDropState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIViewConfigurationState")]
pub struct UICellConfigurationState;
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl ClassType for UICellConfigurationState {
#[inherits(NSObject)]
type Super = UIViewConfigurationState;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl NSCoding for UICellConfigurationState {}
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl NSCopying for UICellConfigurationState {}
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl NSObjectProtocol for UICellConfigurationState {}
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl NSSecureCoding for UICellConfigurationState {}
#[cfg(all(feature = "UIConfigurationState", feature = "UIViewConfigurationState"))]
unsafe impl UIConfigurationState for UICellConfigurationState {}
extern_methods!(
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl UICellConfigurationState {
#[method(isEditing)]
pub unsafe fn isEditing(&self) -> bool;
#[method(setEditing:)]
pub unsafe fn setEditing(&self, editing: bool);
#[method(isExpanded)]
pub unsafe fn isExpanded(&self) -> bool;
#[method(setExpanded:)]
pub unsafe fn setExpanded(&self, expanded: bool);
#[method(isSwiped)]
pub unsafe fn isSwiped(&self) -> bool;
#[method(setSwiped:)]
pub unsafe fn setSwiped(&self, swiped: bool);
#[method(isReordering)]
pub unsafe fn isReordering(&self) -> bool;
#[method(setReordering:)]
pub unsafe fn setReordering(&self, reordering: bool);
#[method(cellDragState)]
pub unsafe fn cellDragState(&self) -> UICellConfigurationDragState;
#[method(setCellDragState:)]
pub unsafe fn setCellDragState(&self, cell_drag_state: UICellConfigurationDragState);
#[method(cellDropState)]
pub unsafe fn cellDropState(&self) -> UICellConfigurationDropState;
#[method(setCellDropState:)]
pub unsafe fn setCellDropState(&self, cell_drop_state: UICellConfigurationDropState);
}
);
extern_methods!(
/// Methods declared on superclass `UIViewConfigurationState`
#[cfg(feature = "UIViewConfigurationState")]
unsafe impl UICellConfigurationState {
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Init initWithTraitCollection:)]
pub unsafe fn initWithTraitCollection(
this: Allocated<Self>,
trait_collection: &UITraitCollection,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,206 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-cloud-kit")]
use objc2_cloud_kit::*;
use objc2_foundation::*;
use crate::*;
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICloudSharingPermissionOptions(pub NSUInteger);
bitflags::bitflags! {
impl UICloudSharingPermissionOptions: NSUInteger {
const UICloudSharingPermissionStandard = 0;
const UICloudSharingPermissionAllowPublic = 1<<0;
const UICloudSharingPermissionAllowPrivate = 1<<1;
const UICloudSharingPermissionAllowReadOnly = 1<<2;
const UICloudSharingPermissionAllowReadWrite = 1<<3;
}
}
unsafe impl Encode for UICloudSharingPermissionOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UICloudSharingPermissionOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait UICloudSharingControllerDelegate:
NSObjectProtocol + IsMainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[method(cloudSharingController:failedToSaveShareWithError:)]
unsafe fn cloudSharingController_failedToSaveShareWithError(
&self,
csc: &UICloudSharingController,
error: &NSError,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[method_id(@__retain_semantics Other itemTitleForCloudSharingController:)]
unsafe fn itemTitleForCloudSharingController(
&self,
csc: &UICloudSharingController,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[method_id(@__retain_semantics Other itemThumbnailDataForCloudSharingController:)]
unsafe fn itemThumbnailDataForCloudSharingController(
&self,
csc: &UICloudSharingController,
) -> Option<Retained<NSData>>;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[method_id(@__retain_semantics Other itemTypeForCloudSharingController:)]
unsafe fn itemTypeForCloudSharingController(
&self,
csc: &UICloudSharingController,
) -> Option<Retained<NSString>>;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[method(cloudSharingControllerDidSaveShare:)]
unsafe fn cloudSharingControllerDidSaveShare(&self, csc: &UICloudSharingController);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[method(cloudSharingControllerDidStopSharing:)]
unsafe fn cloudSharingControllerDidStopSharing(&self, csc: &UICloudSharingController);
}
unsafe impl ProtocolType for dyn UICloudSharingControllerDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UICloudSharingController;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl ClassType for UICloudSharingController {
#[inherits(UIResponder, NSObject)]
type Super = UIViewController;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSCoding for UICloudSharingController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSObjectProtocol for UICloudSharingController {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIAppearanceContainer for UICloudSharingController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIContentContainer for UICloudSharingController {}
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIFocusEnvironment for UICloudSharingController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIResponderStandardEditActions for UICloudSharingController {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
unsafe impl UITraitEnvironment for UICloudSharingController {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UICloudSharingController {
#[method_id(@__retain_semantics Init initWithNibName:bundle:)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(feature = "block2", feature = "objc2-cloud-kit"))]
#[deprecated = "Use -[UIActivityViewController initWithActivityItemsConfiguration:] and pass it a UIActivityItemsConfigurationReading-conforming object with an NSItemProvider and registered preparation handler"]
#[method_id(@__retain_semantics Init initWithPreparationHandler:)]
pub unsafe fn initWithPreparationHandler(
this: Allocated<Self>,
preparation_handler: &block2::Block<
dyn Fn(
NonNull<UICloudSharingController>,
NonNull<block2::Block<dyn Fn(*mut CKShare, *mut CKContainer, *mut NSError)>>,
),
>,
) -> Retained<Self>;
#[cfg(feature = "objc2-cloud-kit")]
#[method_id(@__retain_semantics Init initWithShare:container:)]
pub unsafe fn initWithShare_container(
this: Allocated<Self>,
share: &CKShare,
container: &CKContainer,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICloudSharingControllerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UICloudSharingControllerDelegate>>,
);
#[cfg(feature = "objc2-cloud-kit")]
#[method_id(@__retain_semantics Other share)]
pub unsafe fn share(&self) -> Option<Retained<CKShare>>;
#[method(availablePermissions)]
pub unsafe fn availablePermissions(&self) -> UICloudSharingPermissionOptions;
#[method(setAvailablePermissions:)]
pub unsafe fn setAvailablePermissions(
&self,
available_permissions: UICloudSharingPermissionOptions,
);
#[cfg(feature = "UIActivityItemProvider")]
#[method_id(@__retain_semantics Other activityItemSource)]
pub unsafe fn activityItemSource(
&self,
) -> Retained<ProtocolObject<dyn UIActivityItemSource>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UICloudSharingController {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,222 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionLayoutListAppearance(pub NSInteger);
impl UICollectionLayoutListAppearance {
#[doc(alias = "UICollectionLayoutListAppearancePlain")]
pub const Plain: Self = Self(0);
#[doc(alias = "UICollectionLayoutListAppearanceGrouped")]
pub const Grouped: Self = Self(1);
#[doc(alias = "UICollectionLayoutListAppearanceInsetGrouped")]
pub const InsetGrouped: Self = Self(2);
#[doc(alias = "UICollectionLayoutListAppearanceSidebar")]
pub const Sidebar: Self = Self(3);
#[doc(alias = "UICollectionLayoutListAppearanceSidebarPlain")]
pub const SidebarPlain: Self = Self(4);
}
unsafe impl Encode for UICollectionLayoutListAppearance {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionLayoutListAppearance {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionLayoutListHeaderMode(pub NSInteger);
impl UICollectionLayoutListHeaderMode {
#[doc(alias = "UICollectionLayoutListHeaderModeNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICollectionLayoutListHeaderModeSupplementary")]
pub const Supplementary: Self = Self(1);
#[doc(alias = "UICollectionLayoutListHeaderModeFirstItemInSection")]
pub const FirstItemInSection: Self = Self(2);
}
unsafe impl Encode for UICollectionLayoutListHeaderMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionLayoutListHeaderMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionLayoutListFooterMode(pub NSInteger);
impl UICollectionLayoutListFooterMode {
#[doc(alias = "UICollectionLayoutListFooterModeNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICollectionLayoutListFooterModeSupplementary")]
pub const Supplementary: Self = Self(1);
}
unsafe impl Encode for UICollectionLayoutListFooterMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionLayoutListFooterMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
pub type UICollectionLayoutListSwipeActionsConfigurationProvider =
*mut block2::Block<dyn Fn(NonNull<NSIndexPath>) -> *mut UISwipeActionsConfiguration>;
#[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
pub type UICollectionLayoutListItemSeparatorHandler = *mut block2::Block<
dyn Fn(
NonNull<NSIndexPath>,
NonNull<UIListSeparatorConfiguration>,
) -> NonNull<UIListSeparatorConfiguration>,
>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionLayoutListConfiguration;
unsafe impl ClassType for UICollectionLayoutListConfiguration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCopying for UICollectionLayoutListConfiguration {}
unsafe impl NSObjectProtocol for UICollectionLayoutListConfiguration {}
extern_methods!(
unsafe impl UICollectionLayoutListConfiguration {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithAppearance:)]
pub unsafe fn initWithAppearance(
this: Allocated<Self>,
appearance: UICollectionLayoutListAppearance,
) -> Retained<Self>;
#[method(appearance)]
pub unsafe fn appearance(&self) -> UICollectionLayoutListAppearance;
#[method(showsSeparators)]
pub unsafe fn showsSeparators(&self) -> bool;
#[method(setShowsSeparators:)]
pub unsafe fn setShowsSeparators(&self, shows_separators: bool);
#[cfg(feature = "UIListSeparatorConfiguration")]
#[method_id(@__retain_semantics Other separatorConfiguration)]
pub unsafe fn separatorConfiguration(&self) -> Retained<UIListSeparatorConfiguration>;
#[cfg(feature = "UIListSeparatorConfiguration")]
#[method(setSeparatorConfiguration:)]
pub unsafe fn setSeparatorConfiguration(
&self,
separator_configuration: &UIListSeparatorConfiguration,
);
#[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
#[method(itemSeparatorHandler)]
pub unsafe fn itemSeparatorHandler(&self) -> UICollectionLayoutListItemSeparatorHandler;
#[cfg(all(feature = "UIListSeparatorConfiguration", feature = "block2"))]
#[method(setItemSeparatorHandler:)]
pub unsafe fn setItemSeparatorHandler(
&self,
item_separator_handler: UICollectionLayoutListItemSeparatorHandler,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other backgroundColor)]
pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setBackgroundColor:)]
pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
#[method(leadingSwipeActionsConfigurationProvider)]
pub unsafe fn leadingSwipeActionsConfigurationProvider(
&self,
) -> UICollectionLayoutListSwipeActionsConfigurationProvider;
#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
#[method(setLeadingSwipeActionsConfigurationProvider:)]
pub unsafe fn setLeadingSwipeActionsConfigurationProvider(
&self,
leading_swipe_actions_configuration_provider: UICollectionLayoutListSwipeActionsConfigurationProvider,
);
#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
#[method(trailingSwipeActionsConfigurationProvider)]
pub unsafe fn trailingSwipeActionsConfigurationProvider(
&self,
) -> UICollectionLayoutListSwipeActionsConfigurationProvider;
#[cfg(all(feature = "UISwipeActionsConfiguration", feature = "block2"))]
#[method(setTrailingSwipeActionsConfigurationProvider:)]
pub unsafe fn setTrailingSwipeActionsConfigurationProvider(
&self,
trailing_swipe_actions_configuration_provider: UICollectionLayoutListSwipeActionsConfigurationProvider,
);
#[method(headerMode)]
pub unsafe fn headerMode(&self) -> UICollectionLayoutListHeaderMode;
#[method(setHeaderMode:)]
pub unsafe fn setHeaderMode(&self, header_mode: UICollectionLayoutListHeaderMode);
#[method(footerMode)]
pub unsafe fn footerMode(&self) -> UICollectionLayoutListFooterMode;
#[method(setFooterMode:)]
pub unsafe fn setFooterMode(&self, footer_mode: UICollectionLayoutListFooterMode);
#[method(headerTopPadding)]
pub unsafe fn headerTopPadding(&self) -> CGFloat;
#[method(setHeaderTopPadding:)]
pub unsafe fn setHeaderTopPadding(&self, header_top_padding: CGFloat);
}
);
extern_methods!(
/// UICollectionLayoutListSection
#[cfg(feature = "UICollectionViewCompositionalLayout")]
unsafe impl NSCollectionLayoutSection {
#[method_id(@__retain_semantics Other sectionWithListConfiguration:layoutEnvironment:)]
pub unsafe fn sectionWithListConfiguration_layoutEnvironment(
configuration: &UICollectionLayoutListConfiguration,
layout_environment: &ProtocolObject<dyn NSCollectionLayoutEnvironment>,
) -> Retained<Self>;
}
);
extern_methods!(
/// UICollectionLayoutListSection
#[cfg(all(
feature = "UICollectionViewCompositionalLayout",
feature = "UICollectionViewLayout"
))]
unsafe impl UICollectionViewCompositionalLayout {
#[method_id(@__retain_semantics Other layoutWithListConfiguration:)]
pub unsafe fn layoutWithListConfiguration(
configuration: &UICollectionLayoutListConfiguration,
) -> Retained<Self>;
}
);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,379 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionViewCellDragState(pub NSInteger);
impl UICollectionViewCellDragState {
#[doc(alias = "UICollectionViewCellDragStateNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICollectionViewCellDragStateLifting")]
pub const Lifting: Self = Self(1);
#[doc(alias = "UICollectionViewCellDragStateDragging")]
pub const Dragging: Self = Self(2);
}
unsafe impl Encode for UICollectionViewCellDragState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionViewCellDragState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UICollectionReusableView;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UICollectionReusableView {
#[inherits(UIResponder, NSObject)]
type Super = UIView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UICollectionReusableView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UICollectionReusableView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UICollectionReusableView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UICollectionReusableView {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UICollectionReusableView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UICollectionReusableView {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UICollectionReusableView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UICollectionReusableView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UICollectionReusableView {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UICollectionReusableView {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UICollectionReusableView {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UICollectionReusableView {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionReusableView {
#[method_id(@__retain_semantics Other reuseIdentifier)]
pub unsafe fn reuseIdentifier(&self) -> Option<Retained<NSString>>;
#[method(prepareForReuse)]
pub unsafe fn prepareForReuse(&self);
#[cfg(feature = "UICollectionViewLayout")]
#[method(applyLayoutAttributes:)]
pub unsafe fn applyLayoutAttributes(
&self,
layout_attributes: &UICollectionViewLayoutAttributes,
);
#[cfg(feature = "UICollectionViewLayout")]
#[method(willTransitionFromLayout:toLayout:)]
pub unsafe fn willTransitionFromLayout_toLayout(
&self,
old_layout: &UICollectionViewLayout,
new_layout: &UICollectionViewLayout,
);
#[cfg(feature = "UICollectionViewLayout")]
#[method(didTransitionFromLayout:toLayout:)]
pub unsafe fn didTransitionFromLayout_toLayout(
&self,
old_layout: &UICollectionViewLayout,
new_layout: &UICollectionViewLayout,
);
#[cfg(feature = "UICollectionViewLayout")]
#[method_id(@__retain_semantics Other preferredLayoutAttributesFittingAttributes:)]
pub unsafe fn preferredLayoutAttributesFittingAttributes(
&self,
layout_attributes: &UICollectionViewLayoutAttributes,
) -> Retained<UICollectionViewLayoutAttributes>;
}
);
extern_methods!(
/// Methods declared on superclass `UIView`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionReusableView {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionReusableView {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
#[cfg(all(
feature = "UICellConfigurationState",
feature = "UIResponder",
feature = "UIView",
feature = "UIViewConfigurationState",
feature = "block2"
))]
pub type UICollectionViewCellConfigurationUpdateHandler =
*mut block2::Block<dyn Fn(NonNull<UICollectionViewCell>, NonNull<UICellConfigurationState>)>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
pub struct UICollectionViewCell;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UICollectionViewCell {
#[inherits(UIView, UIResponder, NSObject)]
type Super = UICollectionReusableView;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UICollectionViewCell {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UICollectionViewCell {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UICollectionViewCell {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UICollectionViewCell {}
#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UICollectionViewCell {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UICollectionViewCell {}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UICollectionViewCell {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UICollectionViewCell {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UICollectionViewCell {}
#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UICollectionViewCell {}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UICollectionViewCell {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UICollectionViewCell {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionViewCell {
#[cfg(all(
feature = "UICellConfigurationState",
feature = "UIViewConfigurationState"
))]
#[method_id(@__retain_semantics Other configurationState)]
pub unsafe fn configurationState(&self) -> Retained<UICellConfigurationState>;
#[method(setNeedsUpdateConfiguration)]
pub unsafe fn setNeedsUpdateConfiguration(&self);
#[cfg(all(
feature = "UICellConfigurationState",
feature = "UIViewConfigurationState"
))]
#[method(updateConfigurationUsingState:)]
pub unsafe fn updateConfigurationUsingState(&self, state: &UICellConfigurationState);
#[cfg(all(
feature = "UICellConfigurationState",
feature = "UIViewConfigurationState",
feature = "block2"
))]
#[method(configurationUpdateHandler)]
pub unsafe fn configurationUpdateHandler(
&self,
) -> UICollectionViewCellConfigurationUpdateHandler;
#[cfg(all(
feature = "UICellConfigurationState",
feature = "UIViewConfigurationState",
feature = "block2"
))]
#[method(setConfigurationUpdateHandler:)]
pub unsafe fn setConfigurationUpdateHandler(
&self,
configuration_update_handler: UICollectionViewCellConfigurationUpdateHandler,
);
#[cfg(feature = "UIContentConfiguration")]
#[method_id(@__retain_semantics Other contentConfiguration)]
pub unsafe fn contentConfiguration(
&self,
) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
#[cfg(feature = "UIContentConfiguration")]
#[method(setContentConfiguration:)]
pub unsafe fn setContentConfiguration(
&self,
content_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
);
#[method(automaticallyUpdatesContentConfiguration)]
pub unsafe fn automaticallyUpdatesContentConfiguration(&self) -> bool;
#[method(setAutomaticallyUpdatesContentConfiguration:)]
pub unsafe fn setAutomaticallyUpdatesContentConfiguration(
&self,
automatically_updates_content_configuration: bool,
);
#[method_id(@__retain_semantics Other contentView)]
pub unsafe fn contentView(&self) -> Retained<UIView>;
#[method(isSelected)]
pub unsafe fn isSelected(&self) -> bool;
#[method(setSelected:)]
pub unsafe fn setSelected(&self, selected: bool);
#[method(isHighlighted)]
pub unsafe fn isHighlighted(&self) -> bool;
#[method(setHighlighted:)]
pub unsafe fn setHighlighted(&self, highlighted: bool);
#[method(dragStateDidChange:)]
pub unsafe fn dragStateDidChange(&self, drag_state: UICollectionViewCellDragState);
#[cfg(feature = "UIBackgroundConfiguration")]
#[method_id(@__retain_semantics Other defaultBackgroundConfiguration)]
pub unsafe fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
#[cfg(feature = "UIBackgroundConfiguration")]
#[method_id(@__retain_semantics Other backgroundConfiguration)]
pub unsafe fn backgroundConfiguration(&self)
-> Option<Retained<UIBackgroundConfiguration>>;
#[cfg(feature = "UIBackgroundConfiguration")]
#[method(setBackgroundConfiguration:)]
pub unsafe fn setBackgroundConfiguration(
&self,
background_configuration: Option<&UIBackgroundConfiguration>,
);
#[method(automaticallyUpdatesBackgroundConfiguration)]
pub unsafe fn automaticallyUpdatesBackgroundConfiguration(&self) -> bool;
#[method(setAutomaticallyUpdatesBackgroundConfiguration:)]
pub unsafe fn setAutomaticallyUpdatesBackgroundConfiguration(
&self,
automatically_updates_background_configuration: bool,
);
#[method_id(@__retain_semantics Other backgroundView)]
pub unsafe fn backgroundView(&self) -> Option<Retained<UIView>>;
#[method(setBackgroundView:)]
pub unsafe fn setBackgroundView(&self, background_view: Option<&UIView>);
#[method_id(@__retain_semantics Other selectedBackgroundView)]
pub unsafe fn selectedBackgroundView(&self) -> Option<Retained<UIView>>;
#[method(setSelectedBackgroundView:)]
pub unsafe fn setSelectedBackgroundView(&self, selected_background_view: Option<&UIView>);
}
);
extern_methods!(
/// Methods declared on superclass `UIView`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionViewCell {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICollectionViewCell {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,158 @@
//! 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)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UICollectionViewController;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl ClassType for UICollectionViewController {
#[inherits(UIResponder, NSObject)]
type Super = UIViewController;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSCoding for UICollectionViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSObjectProtocol for UICollectionViewController {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIAppearanceContainer for UICollectionViewController {}
#[cfg(all(
feature = "UICollectionView",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UICollectionViewDataSource for UICollectionViewController {}
#[cfg(all(
feature = "UICollectionView",
feature = "UIResponder",
feature = "UIScrollView",
feature = "UIViewController"
))]
unsafe impl UICollectionViewDelegate for UICollectionViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIContentContainer for UICollectionViewController {}
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIFocusEnvironment for UICollectionViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIResponderStandardEditActions for UICollectionViewController {}
#[cfg(all(
feature = "UIResponder",
feature = "UIScrollView",
feature = "UIViewController"
))]
unsafe impl UIScrollViewDelegate for UICollectionViewController {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
unsafe impl UITraitEnvironment for UICollectionViewController {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UICollectionViewController {
#[cfg(feature = "UICollectionViewLayout")]
#[method_id(@__retain_semantics Init initWithCollectionViewLayout:)]
pub unsafe fn initWithCollectionViewLayout(
this: Allocated<Self>,
layout: &UICollectionViewLayout,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithNibName:bundle:)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(
feature = "UICollectionView",
feature = "UIScrollView",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other collectionView)]
pub unsafe fn collectionView(&self) -> Option<Retained<UICollectionView>>;
#[cfg(all(
feature = "UICollectionView",
feature = "UIScrollView",
feature = "UIView"
))]
#[method(setCollectionView:)]
pub unsafe fn setCollectionView(&self, collection_view: Option<&UICollectionView>);
#[method(clearsSelectionOnViewWillAppear)]
pub unsafe fn clearsSelectionOnViewWillAppear(&self) -> bool;
#[method(setClearsSelectionOnViewWillAppear:)]
pub unsafe fn setClearsSelectionOnViewWillAppear(
&self,
clears_selection_on_view_will_appear: bool,
);
#[method(useLayoutToLayoutNavigationTransitions)]
pub unsafe fn useLayoutToLayoutNavigationTransitions(&self) -> bool;
#[method(setUseLayoutToLayoutNavigationTransitions:)]
pub unsafe fn setUseLayoutToLayoutNavigationTransitions(
&self,
use_layout_to_layout_navigation_transitions: bool,
);
#[cfg(feature = "UICollectionViewLayout")]
#[method_id(@__retain_semantics Other collectionViewLayout)]
pub unsafe fn collectionViewLayout(&self) -> Retained<UICollectionViewLayout>;
#[method(installsStandardGestureForInteractiveMovement)]
pub unsafe fn installsStandardGestureForInteractiveMovement(&self) -> bool;
#[method(setInstallsStandardGestureForInteractiveMovement:)]
pub unsafe fn setInstallsStandardGestureForInteractiveMovement(
&self,
installs_standard_gesture_for_interactive_movement: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UICollectionViewController {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,301 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static UICollectionViewFlowLayoutAutomaticSize: CGSize;
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionViewFlowLayoutSectionInsetReference(pub NSInteger);
impl UICollectionViewFlowLayoutSectionInsetReference {
pub const UICollectionViewFlowLayoutSectionInsetFromContentInset: Self = Self(0);
pub const UICollectionViewFlowLayoutSectionInsetFromSafeArea: Self = Self(1);
pub const UICollectionViewFlowLayoutSectionInsetFromLayoutMargins: Self = Self(2);
}
unsafe impl Encode for UICollectionViewFlowLayoutSectionInsetReference {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionViewFlowLayoutSectionInsetReference {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UICollectionViewLayout")]
pub struct UICollectionViewFlowLayoutInvalidationContext;
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl ClassType for UICollectionViewFlowLayoutInvalidationContext {
#[inherits(NSObject)]
type Super = UICollectionViewLayoutInvalidationContext;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl NSObjectProtocol for UICollectionViewFlowLayoutInvalidationContext {}
extern_methods!(
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewFlowLayoutInvalidationContext {
#[method(invalidateFlowLayoutDelegateMetrics)]
pub unsafe fn invalidateFlowLayoutDelegateMetrics(&self) -> bool;
#[method(setInvalidateFlowLayoutDelegateMetrics:)]
pub unsafe fn setInvalidateFlowLayoutDelegateMetrics(
&self,
invalidate_flow_layout_delegate_metrics: bool,
);
#[method(invalidateFlowLayoutAttributes)]
pub unsafe fn invalidateFlowLayoutAttributes(&self) -> bool;
#[method(setInvalidateFlowLayoutAttributes:)]
pub unsafe fn setInvalidateFlowLayoutAttributes(
&self,
invalidate_flow_layout_attributes: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewFlowLayoutInvalidationContext {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_protocol!(
#[cfg(all(feature = "UICollectionView", feature = "UIScrollView"))]
pub unsafe trait UICollectionViewDelegateFlowLayout:
UICollectionViewDelegate + IsMainThreadOnly
{
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:sizeForItemAtIndexPath:)]
unsafe fn collectionView_layout_sizeForItemAtIndexPath(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
index_path: &NSIndexPath,
) -> CGSize;
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIGeometry",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:insetForSectionAtIndex:)]
unsafe fn collectionView_layout_insetForSectionAtIndex(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
section: NSInteger,
) -> UIEdgeInsets;
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:minimumLineSpacingForSectionAtIndex:)]
unsafe fn collectionView_layout_minimumLineSpacingForSectionAtIndex(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
section: NSInteger,
) -> CGFloat;
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:minimumInteritemSpacingForSectionAtIndex:)]
unsafe fn collectionView_layout_minimumInteritemSpacingForSectionAtIndex(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
section: NSInteger,
) -> CGFloat;
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:referenceSizeForHeaderInSection:)]
unsafe fn collectionView_layout_referenceSizeForHeaderInSection(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
section: NSInteger,
) -> CGSize;
#[cfg(all(
feature = "UICollectionViewLayout",
feature = "UIResponder",
feature = "UIView"
))]
#[optional]
#[method(collectionView:layout:referenceSizeForFooterInSection:)]
unsafe fn collectionView_layout_referenceSizeForFooterInSection(
&self,
collection_view: &UICollectionView,
collection_view_layout: &UICollectionViewLayout,
section: NSInteger,
) -> CGSize;
}
#[cfg(all(feature = "UICollectionView", feature = "UIScrollView"))]
unsafe impl ProtocolType for dyn UICollectionViewDelegateFlowLayout {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UICollectionViewLayout")]
pub struct UICollectionViewFlowLayout;
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl ClassType for UICollectionViewFlowLayout {
#[inherits(NSObject)]
type Super = UICollectionViewLayout;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl NSCoding for UICollectionViewFlowLayout {}
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl NSObjectProtocol for UICollectionViewFlowLayout {}
extern_methods!(
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewFlowLayout {
#[method(minimumLineSpacing)]
pub unsafe fn minimumLineSpacing(&self) -> CGFloat;
#[method(setMinimumLineSpacing:)]
pub unsafe fn setMinimumLineSpacing(&self, minimum_line_spacing: CGFloat);
#[method(minimumInteritemSpacing)]
pub unsafe fn minimumInteritemSpacing(&self) -> CGFloat;
#[method(setMinimumInteritemSpacing:)]
pub unsafe fn setMinimumInteritemSpacing(&self, minimum_interitem_spacing: CGFloat);
#[method(itemSize)]
pub unsafe fn itemSize(&self) -> CGSize;
#[method(setItemSize:)]
pub unsafe fn setItemSize(&self, item_size: CGSize);
#[method(estimatedItemSize)]
pub unsafe fn estimatedItemSize(&self) -> CGSize;
#[method(setEstimatedItemSize:)]
pub unsafe fn setEstimatedItemSize(&self, estimated_item_size: CGSize);
#[method(scrollDirection)]
pub unsafe fn scrollDirection(&self) -> UICollectionViewScrollDirection;
#[method(setScrollDirection:)]
pub unsafe fn setScrollDirection(&self, scroll_direction: UICollectionViewScrollDirection);
#[method(headerReferenceSize)]
pub unsafe fn headerReferenceSize(&self) -> CGSize;
#[method(setHeaderReferenceSize:)]
pub unsafe fn setHeaderReferenceSize(&self, header_reference_size: CGSize);
#[method(footerReferenceSize)]
pub unsafe fn footerReferenceSize(&self) -> CGSize;
#[method(setFooterReferenceSize:)]
pub unsafe fn setFooterReferenceSize(&self, footer_reference_size: CGSize);
#[cfg(feature = "UIGeometry")]
#[method(sectionInset)]
pub unsafe fn sectionInset(&self) -> UIEdgeInsets;
#[cfg(feature = "UIGeometry")]
#[method(setSectionInset:)]
pub unsafe fn setSectionInset(&self, section_inset: UIEdgeInsets);
#[method(sectionInsetReference)]
pub unsafe fn sectionInsetReference(
&self,
) -> UICollectionViewFlowLayoutSectionInsetReference;
#[method(setSectionInsetReference:)]
pub unsafe fn setSectionInsetReference(
&self,
section_inset_reference: UICollectionViewFlowLayoutSectionInsetReference,
);
#[method(sectionHeadersPinToVisibleBounds)]
pub unsafe fn sectionHeadersPinToVisibleBounds(&self) -> bool;
#[method(setSectionHeadersPinToVisibleBounds:)]
pub unsafe fn setSectionHeadersPinToVisibleBounds(
&self,
section_headers_pin_to_visible_bounds: bool,
);
#[method(sectionFootersPinToVisibleBounds)]
pub unsafe fn sectionFootersPinToVisibleBounds(&self) -> bool;
#[method(setSectionFootersPinToVisibleBounds:)]
pub unsafe fn setSectionFootersPinToVisibleBounds(
&self,
section_footers_pin_to_visible_bounds: bool,
);
}
);
extern_methods!(
/// Methods declared on superclass `UICollectionViewLayout`
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewFlowLayout {
#[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>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewFlowLayout {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,175 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UICollectionViewCellRegistrationConfigurationHandler = *mut block2::Block<
dyn Fn(NonNull<UICollectionViewCell>, NonNull<NSIndexPath>, NonNull<AnyObject>),
>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewCellRegistration;
unsafe impl ClassType for UICollectionViewCellRegistration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICollectionViewCellRegistration {}
extern_methods!(
unsafe impl UICollectionViewCellRegistration {
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[method_id(@__retain_semantics Other registrationWithCellClass:configurationHandler:)]
pub unsafe fn registrationWithCellClass_configurationHandler(
cell_class: &AnyClass,
configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UINib",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[method_id(@__retain_semantics Other registrationWithCellNib:configurationHandler:)]
pub unsafe fn registrationWithCellNib_configurationHandler(
cell_nib: &UINib,
configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
) -> Retained<Self>;
#[method(cellClass)]
pub unsafe fn cellClass(&self) -> Option<&'static AnyClass>;
#[cfg(feature = "UINib")]
#[method_id(@__retain_semantics Other cellNib)]
pub unsafe fn cellNib(&self) -> Option<Retained<UINib>>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[method(configurationHandler)]
pub unsafe fn configurationHandler(
&self,
) -> UICollectionViewCellRegistrationConfigurationHandler;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewCellRegistration {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UICollectionViewSupplementaryRegistrationConfigurationHandler = *mut block2::Block<
dyn Fn(NonNull<UICollectionReusableView>, NonNull<NSString>, NonNull<NSIndexPath>),
>;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewSupplementaryRegistration;
unsafe impl ClassType for UICollectionViewSupplementaryRegistration {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICollectionViewSupplementaryRegistration {}
extern_methods!(
unsafe impl UICollectionViewSupplementaryRegistration {
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[method_id(@__retain_semantics Other registrationWithSupplementaryClass:elementKind:configurationHandler:)]
pub unsafe fn registrationWithSupplementaryClass_elementKind_configurationHandler(
supplementary_class: &AnyClass,
element_kind: &NSString,
configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UINib",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[method_id(@__retain_semantics Other registrationWithSupplementaryNib:elementKind:configurationHandler:)]
pub unsafe fn registrationWithSupplementaryNib_elementKind_configurationHandler(
supplementary_nib: &UINib,
element_kind: &NSString,
configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
) -> Retained<Self>;
#[method(supplementaryClass)]
pub unsafe fn supplementaryClass(&self) -> Option<&'static AnyClass>;
#[cfg(feature = "UINib")]
#[method_id(@__retain_semantics Other supplementaryNib)]
pub unsafe fn supplementaryNib(&self) -> Option<Retained<UINib>>;
#[method_id(@__retain_semantics Other elementKind)]
pub unsafe fn elementKind(&self) -> Retained<NSString>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[method(configurationHandler)]
pub unsafe fn configurationHandler(
&self,
) -> UICollectionViewSupplementaryRegistrationConfigurationHandler;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewSupplementaryRegistration {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,556 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
extern "C" {
pub static UICollectionViewLayoutAutomaticDimension: CGFloat;
}
extern "C" {
pub static UICollectionElementKindSectionHeader: &'static NSString;
}
extern "C" {
pub static UICollectionElementKindSectionFooter: &'static NSString;
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionViewScrollDirection(pub NSInteger);
impl UICollectionViewScrollDirection {
#[doc(alias = "UICollectionViewScrollDirectionVertical")]
pub const Vertical: Self = Self(0);
#[doc(alias = "UICollectionViewScrollDirectionHorizontal")]
pub const Horizontal: Self = Self(1);
}
unsafe impl Encode for UICollectionViewScrollDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionViewScrollDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionElementCategory(pub NSUInteger);
impl UICollectionElementCategory {
#[doc(alias = "UICollectionElementCategoryCell")]
pub const Cell: Self = Self(0);
#[doc(alias = "UICollectionElementCategorySupplementaryView")]
pub const SupplementaryView: Self = Self(1);
#[doc(alias = "UICollectionElementCategoryDecorationView")]
pub const DecorationView: Self = Self(2);
}
unsafe impl Encode for UICollectionElementCategory {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionElementCategory {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewLayoutAttributes;
unsafe impl ClassType for UICollectionViewLayoutAttributes {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCopying for UICollectionViewLayoutAttributes {}
unsafe impl NSObjectProtocol for UICollectionViewLayoutAttributes {}
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl UIDynamicItem for UICollectionViewLayoutAttributes {}
extern_methods!(
unsafe impl UICollectionViewLayoutAttributes {
#[method(frame)]
pub unsafe fn frame(&self) -> CGRect;
#[method(setFrame:)]
pub unsafe fn setFrame(&self, frame: CGRect);
#[method(center)]
pub unsafe fn center(&self) -> CGPoint;
#[method(setCenter:)]
pub unsafe fn setCenter(&self, center: CGPoint);
#[method(size)]
pub unsafe fn size(&self) -> CGSize;
#[method(setSize:)]
pub unsafe fn setSize(&self, size: CGSize);
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
#[method(transform3D)]
pub unsafe fn transform3D(&self) -> CATransform3D;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
#[method(setTransform3D:)]
pub unsafe fn setTransform3D(&self, transform3_d: CATransform3D);
#[method(bounds)]
pub unsafe fn bounds(&self) -> CGRect;
#[method(setBounds:)]
pub unsafe fn setBounds(&self, bounds: CGRect);
#[method(transform)]
pub unsafe fn transform(&self) -> CGAffineTransform;
#[method(setTransform:)]
pub unsafe fn setTransform(&self, transform: CGAffineTransform);
#[method(alpha)]
pub unsafe fn alpha(&self) -> CGFloat;
#[method(setAlpha:)]
pub unsafe fn setAlpha(&self, alpha: CGFloat);
#[method(zIndex)]
pub unsafe fn zIndex(&self) -> NSInteger;
#[method(setZIndex:)]
pub unsafe fn setZIndex(&self, z_index: NSInteger);
#[method(isHidden)]
pub unsafe fn isHidden(&self) -> bool;
#[method(setHidden:)]
pub unsafe fn setHidden(&self, hidden: bool);
#[method_id(@__retain_semantics Other indexPath)]
pub unsafe fn indexPath(&self) -> Retained<NSIndexPath>;
#[method(setIndexPath:)]
pub unsafe fn setIndexPath(&self, index_path: &NSIndexPath);
#[method(representedElementCategory)]
pub unsafe fn representedElementCategory(&self) -> UICollectionElementCategory;
#[method_id(@__retain_semantics Other representedElementKind)]
pub unsafe fn representedElementKind(&self) -> Option<Retained<NSString>>;
#[method_id(@__retain_semantics Other layoutAttributesForCellWithIndexPath:)]
pub unsafe fn layoutAttributesForCellWithIndexPath(
index_path: &NSIndexPath,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other layoutAttributesForSupplementaryViewOfKind:withIndexPath:)]
pub unsafe fn layoutAttributesForSupplementaryViewOfKind_withIndexPath(
element_kind: &NSString,
index_path: &NSIndexPath,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[method_id(@__retain_semantics Other layoutAttributesForDecorationViewOfKind:withIndexPath:)]
pub unsafe fn layoutAttributesForDecorationViewOfKind_withIndexPath(
decoration_view_kind: &NSString,
index_path: &NSIndexPath,
mtm: MainThreadMarker,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewLayoutAttributes {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewLayoutInvalidationContext;
unsafe impl ClassType for UICollectionViewLayoutInvalidationContext {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICollectionViewLayoutInvalidationContext {}
extern_methods!(
unsafe impl UICollectionViewLayoutInvalidationContext {
#[method(invalidateEverything)]
pub unsafe fn invalidateEverything(&self) -> bool;
#[method(invalidateDataSourceCounts)]
pub unsafe fn invalidateDataSourceCounts(&self) -> bool;
#[method(invalidateItemsAtIndexPaths:)]
pub unsafe fn invalidateItemsAtIndexPaths(&self, index_paths: &NSArray<NSIndexPath>);
#[method(invalidateSupplementaryElementsOfKind:atIndexPaths:)]
pub unsafe fn invalidateSupplementaryElementsOfKind_atIndexPaths(
&self,
element_kind: &NSString,
index_paths: &NSArray<NSIndexPath>,
);
#[method(invalidateDecorationElementsOfKind:atIndexPaths:)]
pub unsafe fn invalidateDecorationElementsOfKind_atIndexPaths(
&self,
element_kind: &NSString,
index_paths: &NSArray<NSIndexPath>,
);
#[method_id(@__retain_semantics Other invalidatedItemIndexPaths)]
pub unsafe fn invalidatedItemIndexPaths(&self) -> Option<Retained<NSArray<NSIndexPath>>>;
#[method_id(@__retain_semantics Other invalidatedSupplementaryIndexPaths)]
pub unsafe fn invalidatedSupplementaryIndexPaths(
&self,
) -> Option<Retained<NSDictionary<NSString, NSArray<NSIndexPath>>>>;
#[method_id(@__retain_semantics Other invalidatedDecorationIndexPaths)]
pub unsafe fn invalidatedDecorationIndexPaths(
&self,
) -> Option<Retained<NSDictionary<NSString, NSArray<NSIndexPath>>>>;
#[method(contentOffsetAdjustment)]
pub unsafe fn contentOffsetAdjustment(&self) -> CGPoint;
#[method(setContentOffsetAdjustment:)]
pub unsafe fn setContentOffsetAdjustment(&self, content_offset_adjustment: CGPoint);
#[method(contentSizeAdjustment)]
pub unsafe fn contentSizeAdjustment(&self) -> CGSize;
#[method(setContentSizeAdjustment:)]
pub unsafe fn setContentSizeAdjustment(&self, content_size_adjustment: CGSize);
#[method_id(@__retain_semantics Other previousIndexPathsForInteractivelyMovingItems)]
pub unsafe fn previousIndexPathsForInteractivelyMovingItems(
&self,
) -> Option<Retained<NSArray<NSIndexPath>>>;
#[method_id(@__retain_semantics Other targetIndexPathsForInteractivelyMovingItems)]
pub unsafe fn targetIndexPathsForInteractivelyMovingItems(
&self,
) -> Option<Retained<NSArray<NSIndexPath>>>;
#[method(interactiveMovementTarget)]
pub unsafe fn interactiveMovementTarget(&self) -> CGPoint;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewLayoutInvalidationContext {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewLayout;
unsafe impl ClassType for UICollectionViewLayout {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSCoding for UICollectionViewLayout {}
unsafe impl NSObjectProtocol for UICollectionViewLayout {}
extern_methods!(
unsafe impl UICollectionViewLayout {
#[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>>;
#[cfg(all(
feature = "UICollectionView",
feature = "UIResponder",
feature = "UIScrollView",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other collectionView)]
pub unsafe fn collectionView(&self) -> Option<Retained<UICollectionView>>;
#[method(invalidateLayout)]
pub unsafe fn invalidateLayout(&self);
#[method(invalidateLayoutWithContext:)]
pub unsafe fn invalidateLayoutWithContext(
&self,
context: &UICollectionViewLayoutInvalidationContext,
);
#[method(registerClass:forDecorationViewOfKind:)]
pub unsafe fn registerClass_forDecorationViewOfKind(
&self,
view_class: Option<&AnyClass>,
element_kind: &NSString,
);
#[cfg(feature = "UINib")]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[method(registerNib:forDecorationViewOfKind:)]
pub unsafe fn registerNib_forDecorationViewOfKind(
&self,
nib: Option<&UINib>,
element_kind: &NSString,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewLayout {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);
extern_methods!(
/// UISubclassingHooks
unsafe impl UICollectionViewLayout {
#[method(layoutAttributesClass)]
pub unsafe fn layoutAttributesClass(mtm: MainThreadMarker) -> &'static AnyClass;
#[method(invalidationContextClass)]
pub unsafe fn invalidationContextClass(mtm: MainThreadMarker) -> &'static AnyClass;
#[method(prepareLayout)]
pub unsafe fn prepareLayout(&self);
#[method_id(@__retain_semantics Other layoutAttributesForElementsInRect:)]
pub unsafe fn layoutAttributesForElementsInRect(
&self,
rect: CGRect,
) -> Option<Retained<NSArray<UICollectionViewLayoutAttributes>>>;
#[method_id(@__retain_semantics Other layoutAttributesForItemAtIndexPath:)]
pub unsafe fn layoutAttributesForItemAtIndexPath(
&self,
index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other layoutAttributesForSupplementaryViewOfKind:atIndexPath:)]
pub unsafe fn layoutAttributesForSupplementaryViewOfKind_atIndexPath(
&self,
element_kind: &NSString,
index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other layoutAttributesForDecorationViewOfKind:atIndexPath:)]
pub unsafe fn layoutAttributesForDecorationViewOfKind_atIndexPath(
&self,
element_kind: &NSString,
index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method(shouldInvalidateLayoutForBoundsChange:)]
pub unsafe fn shouldInvalidateLayoutForBoundsChange(&self, new_bounds: CGRect) -> bool;
#[method_id(@__retain_semantics Other invalidationContextForBoundsChange:)]
pub unsafe fn invalidationContextForBoundsChange(
&self,
new_bounds: CGRect,
) -> Retained<UICollectionViewLayoutInvalidationContext>;
#[method(shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes:)]
pub unsafe fn shouldInvalidateLayoutForPreferredLayoutAttributes_withOriginalAttributes(
&self,
preferred_attributes: &UICollectionViewLayoutAttributes,
original_attributes: &UICollectionViewLayoutAttributes,
) -> bool;
#[method_id(@__retain_semantics Other invalidationContextForPreferredLayoutAttributes:withOriginalAttributes:)]
pub unsafe fn invalidationContextForPreferredLayoutAttributes_withOriginalAttributes(
&self,
preferred_attributes: &UICollectionViewLayoutAttributes,
original_attributes: &UICollectionViewLayoutAttributes,
) -> Retained<UICollectionViewLayoutInvalidationContext>;
#[method(targetContentOffsetForProposedContentOffset:withScrollingVelocity:)]
pub unsafe fn targetContentOffsetForProposedContentOffset_withScrollingVelocity(
&self,
proposed_content_offset: CGPoint,
velocity: CGPoint,
) -> CGPoint;
#[method(targetContentOffsetForProposedContentOffset:)]
pub unsafe fn targetContentOffsetForProposedContentOffset(
&self,
proposed_content_offset: CGPoint,
) -> CGPoint;
#[method(collectionViewContentSize)]
pub unsafe fn collectionViewContentSize(&self) -> CGSize;
#[cfg(feature = "UIInterface")]
#[method(developmentLayoutDirection)]
pub unsafe fn developmentLayoutDirection(&self) -> UIUserInterfaceLayoutDirection;
#[method(flipsHorizontallyInOppositeLayoutDirection)]
pub unsafe fn flipsHorizontallyInOppositeLayoutDirection(&self) -> bool;
}
);
extern_methods!(
/// UIUpdateSupportHooks
unsafe impl UICollectionViewLayout {
#[cfg(feature = "UICollectionViewUpdateItem")]
#[method(prepareForCollectionViewUpdates:)]
pub unsafe fn prepareForCollectionViewUpdates(
&self,
update_items: &NSArray<UICollectionViewUpdateItem>,
);
#[method(finalizeCollectionViewUpdates)]
pub unsafe fn finalizeCollectionViewUpdates(&self);
#[method(prepareForAnimatedBoundsChange:)]
pub unsafe fn prepareForAnimatedBoundsChange(&self, old_bounds: CGRect);
#[method(finalizeAnimatedBoundsChange)]
pub unsafe fn finalizeAnimatedBoundsChange(&self);
#[method(prepareForTransitionToLayout:)]
pub unsafe fn prepareForTransitionToLayout(&self, new_layout: &UICollectionViewLayout);
#[method(prepareForTransitionFromLayout:)]
pub unsafe fn prepareForTransitionFromLayout(&self, old_layout: &UICollectionViewLayout);
#[method(finalizeLayoutTransition)]
pub unsafe fn finalizeLayoutTransition(&self);
#[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingItemAtIndexPath:)]
pub unsafe fn initialLayoutAttributesForAppearingItemAtIndexPath(
&self,
item_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingItemAtIndexPath:)]
pub unsafe fn finalLayoutAttributesForDisappearingItemAtIndexPath(
&self,
item_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath:)]
pub unsafe fn initialLayoutAttributesForAppearingSupplementaryElementOfKind_atIndexPath(
&self,
element_kind: &NSString,
element_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath:)]
pub unsafe fn finalLayoutAttributesForDisappearingSupplementaryElementOfKind_atIndexPath(
&self,
element_kind: &NSString,
element_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:)]
pub unsafe fn initialLayoutAttributesForAppearingDecorationElementOfKind_atIndexPath(
&self,
element_kind: &NSString,
decoration_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath:)]
pub unsafe fn finalLayoutAttributesForDisappearingDecorationElementOfKind_atIndexPath(
&self,
element_kind: &NSString,
decoration_index_path: &NSIndexPath,
) -> Option<Retained<UICollectionViewLayoutAttributes>>;
#[method_id(@__retain_semantics Other indexPathsToDeleteForSupplementaryViewOfKind:)]
pub unsafe fn indexPathsToDeleteForSupplementaryViewOfKind(
&self,
element_kind: &NSString,
) -> Retained<NSArray<NSIndexPath>>;
#[method_id(@__retain_semantics Other indexPathsToDeleteForDecorationViewOfKind:)]
pub unsafe fn indexPathsToDeleteForDecorationViewOfKind(
&self,
element_kind: &NSString,
) -> Retained<NSArray<NSIndexPath>>;
#[method_id(@__retain_semantics Other indexPathsToInsertForSupplementaryViewOfKind:)]
pub unsafe fn indexPathsToInsertForSupplementaryViewOfKind(
&self,
element_kind: &NSString,
) -> Retained<NSArray<NSIndexPath>>;
#[method_id(@__retain_semantics Other indexPathsToInsertForDecorationViewOfKind:)]
pub unsafe fn indexPathsToInsertForDecorationViewOfKind(
&self,
element_kind: &NSString,
) -> Retained<NSArray<NSIndexPath>>;
}
);
extern_methods!(
/// UIReorderingSupportHooks
unsafe impl UICollectionViewLayout {
#[method_id(@__retain_semantics Other targetIndexPathForInteractivelyMovingItem:withPosition:)]
pub unsafe fn targetIndexPathForInteractivelyMovingItem_withPosition(
&self,
previous_index_path: &NSIndexPath,
position: CGPoint,
) -> Retained<NSIndexPath>;
#[method_id(@__retain_semantics Other layoutAttributesForInteractivelyMovingItemAtIndexPath:withTargetPosition:)]
pub unsafe fn layoutAttributesForInteractivelyMovingItemAtIndexPath_withTargetPosition(
&self,
index_path: &NSIndexPath,
position: CGPoint,
) -> Retained<UICollectionViewLayoutAttributes>;
#[method_id(@__retain_semantics Other invalidationContextForInteractivelyMovingItems:withTargetPosition:previousIndexPaths:previousPosition:)]
pub unsafe fn invalidationContextForInteractivelyMovingItems_withTargetPosition_previousIndexPaths_previousPosition(
&self,
target_index_paths: &NSArray<NSIndexPath>,
target_position: CGPoint,
previous_index_paths: &NSArray<NSIndexPath>,
previous_position: CGPoint,
) -> Retained<UICollectionViewLayoutInvalidationContext>;
#[method_id(@__retain_semantics Other invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths:previousIndexPaths:movementCancelled:)]
pub unsafe fn invalidationContextForEndingInteractiveMovementOfItemsToFinalIndexPaths_previousIndexPaths_movementCancelled(
&self,
index_paths: &NSArray<NSIndexPath>,
previous_index_paths: &NSArray<NSIndexPath>,
movement_cancelled: bool,
) -> Retained<UICollectionViewLayoutInvalidationContext>;
}
);

View File

@@ -0,0 +1,201 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
pub struct UICollectionViewListCell;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl ClassType for UICollectionViewListCell {
#[inherits(UICollectionReusableView, UIView, UIResponder, NSObject)]
type Super = UICollectionViewCell;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl NSCoding for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl NSObjectProtocol for UICollectionViewListCell {}
#[cfg(all(
feature = "UIAppearance",
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearance for UICollectionViewListCell {}
#[cfg(all(
feature = "UIAppearance",
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearanceContainer for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UICoordinateSpace for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusEnvironment for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItem for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItemContainer for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIResponderStandardEditActions for UICollectionViewListCell {}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UICollectionViewListCell {}
extern_methods!(
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UICollectionViewListCell {
#[cfg(feature = "UIListContentConfiguration")]
#[method_id(@__retain_semantics Other defaultContentConfiguration)]
pub unsafe fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;
#[method(indentationLevel)]
pub unsafe fn indentationLevel(&self) -> NSInteger;
#[method(setIndentationLevel:)]
pub unsafe fn setIndentationLevel(&self, indentation_level: NSInteger);
#[method(indentationWidth)]
pub unsafe fn indentationWidth(&self) -> CGFloat;
#[method(setIndentationWidth:)]
pub unsafe fn setIndentationWidth(&self, indentation_width: CGFloat);
#[method(indentsAccessories)]
pub unsafe fn indentsAccessories(&self) -> bool;
#[method(setIndentsAccessories:)]
pub unsafe fn setIndentsAccessories(&self, indents_accessories: bool);
#[cfg(feature = "UICellAccessory")]
#[method_id(@__retain_semantics Other accessories)]
pub unsafe fn accessories(&self) -> Retained<NSArray<UICellAccessory>>;
#[cfg(feature = "UICellAccessory")]
#[method(setAccessories:)]
pub unsafe fn setAccessories(&self, accessories: &NSArray<UICellAccessory>);
#[cfg(feature = "UILayoutGuide")]
#[method_id(@__retain_semantics Other separatorLayoutGuide)]
pub unsafe fn separatorLayoutGuide(&self) -> Retained<UILayoutGuide>;
}
);
extern_methods!(
/// Methods declared on superclass `UIView`
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UICollectionViewListCell {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UICollectionViewListCell {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,73 @@
//! 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)]
#[cfg(feature = "UICollectionViewLayout")]
pub struct UICollectionViewTransitionLayout;
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl ClassType for UICollectionViewTransitionLayout {
#[inherits(NSObject)]
type Super = UICollectionViewLayout;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl NSCoding for UICollectionViewTransitionLayout {}
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl NSObjectProtocol for UICollectionViewTransitionLayout {}
extern_methods!(
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewTransitionLayout {
#[method(transitionProgress)]
pub unsafe fn transitionProgress(&self) -> CGFloat;
#[method(setTransitionProgress:)]
pub unsafe fn setTransitionProgress(&self, transition_progress: CGFloat);
#[method_id(@__retain_semantics Other currentLayout)]
pub unsafe fn currentLayout(&self) -> Retained<UICollectionViewLayout>;
#[method_id(@__retain_semantics Other nextLayout)]
pub unsafe fn nextLayout(&self) -> Retained<UICollectionViewLayout>;
#[method_id(@__retain_semantics Init initWithCurrentLayout:nextLayout:)]
pub unsafe fn initWithCurrentLayout_nextLayout(
this: Allocated<Self>,
current_layout: &UICollectionViewLayout,
new_layout: &UICollectionViewLayout,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method(updateValue:forAnimatedKey:)]
pub unsafe fn updateValue_forAnimatedKey(&self, value: CGFloat, key: &NSString);
#[method(valueForAnimatedKey:)]
pub unsafe fn valueForAnimatedKey(&self, key: &NSString) -> CGFloat;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UICollectionViewLayout")]
unsafe impl UICollectionViewTransitionLayout {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,67 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionUpdateAction(pub NSInteger);
impl UICollectionUpdateAction {
#[doc(alias = "UICollectionUpdateActionInsert")]
pub const Insert: Self = Self(0);
#[doc(alias = "UICollectionUpdateActionDelete")]
pub const Delete: Self = Self(1);
#[doc(alias = "UICollectionUpdateActionReload")]
pub const Reload: Self = Self(2);
#[doc(alias = "UICollectionUpdateActionMove")]
pub const Move: Self = Self(3);
#[doc(alias = "UICollectionUpdateActionNone")]
pub const None: Self = Self(4);
}
unsafe impl Encode for UICollectionUpdateAction {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionUpdateAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewUpdateItem;
unsafe impl ClassType for UICollectionViewUpdateItem {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UICollectionViewUpdateItem {}
extern_methods!(
unsafe impl UICollectionViewUpdateItem {
#[method_id(@__retain_semantics Other indexPathBeforeUpdate)]
pub unsafe fn indexPathBeforeUpdate(&self) -> Option<Retained<NSIndexPath>>;
#[method_id(@__retain_semantics Other indexPathAfterUpdate)]
pub unsafe fn indexPathAfterUpdate(&self) -> Option<Retained<NSIndexPath>>;
#[method(updateAction)]
pub unsafe fn updateAction(&self) -> UICollectionUpdateAction;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UICollectionViewUpdateItem {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,197 @@
//! 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 UICollisionBehaviorMode(pub NSUInteger);
bitflags::bitflags! {
impl UICollisionBehaviorMode: NSUInteger {
#[doc(alias = "UICollisionBehaviorModeItems")]
const Items = 1<<0;
#[doc(alias = "UICollisionBehaviorModeBoundaries")]
const Boundaries = 1<<1;
#[doc(alias = "UICollisionBehaviorModeEverything")]
const Everything = NSUIntegerMax as _;
}
}
unsafe impl Encode for UICollisionBehaviorMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UICollisionBehaviorMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
pub unsafe trait UICollisionBehaviorDelegate:
NSObjectProtocol + IsMainThreadOnly
{
#[cfg(feature = "UIDynamicBehavior")]
#[optional]
#[method(collisionBehavior:beganContactForItem:withItem:atPoint:)]
unsafe fn collisionBehavior_beganContactForItem_withItem_atPoint(
&self,
behavior: &UICollisionBehavior,
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
p: CGPoint,
);
#[cfg(feature = "UIDynamicBehavior")]
#[optional]
#[method(collisionBehavior:endedContactForItem:withItem:)]
unsafe fn collisionBehavior_endedContactForItem_withItem(
&self,
behavior: &UICollisionBehavior,
item1: &ProtocolObject<dyn UIDynamicItem>,
item2: &ProtocolObject<dyn UIDynamicItem>,
);
#[cfg(feature = "UIDynamicBehavior")]
#[optional]
#[method(collisionBehavior:beganContactForItem:withBoundaryIdentifier:atPoint:)]
unsafe fn collisionBehavior_beganContactForItem_withBoundaryIdentifier_atPoint(
&self,
behavior: &UICollisionBehavior,
item: &ProtocolObject<dyn UIDynamicItem>,
identifier: Option<&ProtocolObject<dyn NSCopying>>,
p: CGPoint,
);
#[cfg(feature = "UIDynamicBehavior")]
#[optional]
#[method(collisionBehavior:endedContactForItem:withBoundaryIdentifier:)]
unsafe fn collisionBehavior_endedContactForItem_withBoundaryIdentifier(
&self,
behavior: &UICollisionBehavior,
item: &ProtocolObject<dyn UIDynamicItem>,
identifier: Option<&ProtocolObject<dyn NSCopying>>,
);
}
unsafe impl ProtocolType for dyn UICollisionBehaviorDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIDynamicBehavior")]
pub struct UICollisionBehavior;
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl ClassType for UICollisionBehavior {
#[inherits(NSObject)]
type Super = UIDynamicBehavior;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl NSObjectProtocol for UICollisionBehavior {}
extern_methods!(
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl UICollisionBehavior {
#[method_id(@__retain_semantics Init initWithItems:)]
pub unsafe fn initWithItems(
this: Allocated<Self>,
items: &NSArray<ProtocolObject<dyn UIDynamicItem>>,
) -> Retained<Self>;
#[method(addItem:)]
pub unsafe fn addItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
#[method(removeItem:)]
pub unsafe fn removeItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
#[method_id(@__retain_semantics Other items)]
pub unsafe fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;
#[method(collisionMode)]
pub unsafe fn collisionMode(&self) -> UICollisionBehaviorMode;
#[method(setCollisionMode:)]
pub unsafe fn setCollisionMode(&self, collision_mode: UICollisionBehaviorMode);
#[method(translatesReferenceBoundsIntoBoundary)]
pub unsafe fn translatesReferenceBoundsIntoBoundary(&self) -> bool;
#[method(setTranslatesReferenceBoundsIntoBoundary:)]
pub unsafe fn setTranslatesReferenceBoundsIntoBoundary(
&self,
translates_reference_bounds_into_boundary: bool,
);
#[cfg(feature = "UIGeometry")]
#[method(setTranslatesReferenceBoundsIntoBoundaryWithInsets:)]
pub unsafe fn setTranslatesReferenceBoundsIntoBoundaryWithInsets(
&self,
insets: UIEdgeInsets,
);
#[cfg(feature = "UIBezierPath")]
#[method(addBoundaryWithIdentifier:forPath:)]
pub unsafe fn addBoundaryWithIdentifier_forPath(
&self,
identifier: &ProtocolObject<dyn NSCopying>,
bezier_path: &UIBezierPath,
);
#[method(addBoundaryWithIdentifier:fromPoint:toPoint:)]
pub unsafe fn addBoundaryWithIdentifier_fromPoint_toPoint(
&self,
identifier: &ProtocolObject<dyn NSCopying>,
p1: CGPoint,
p2: CGPoint,
);
#[cfg(feature = "UIBezierPath")]
#[method_id(@__retain_semantics Other boundaryWithIdentifier:)]
pub unsafe fn boundaryWithIdentifier(
&self,
identifier: &ProtocolObject<dyn NSCopying>,
) -> Option<Retained<UIBezierPath>>;
#[method(removeBoundaryWithIdentifier:)]
pub unsafe fn removeBoundaryWithIdentifier(
&self,
identifier: &ProtocolObject<dyn NSCopying>,
);
#[method_id(@__retain_semantics Other boundaryIdentifiers)]
pub unsafe fn boundaryIdentifiers(
&self,
) -> Option<Retained<NSArray<ProtocolObject<dyn NSCopying>>>>;
#[method(removeAllBoundaries)]
pub unsafe fn removeAllBoundaries(&self);
#[method_id(@__retain_semantics Other collisionDelegate)]
pub unsafe fn collisionDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICollisionBehaviorDelegate>>>;
#[method(setCollisionDelegate:)]
pub unsafe fn setCollisionDelegate(
&self,
collision_delegate: Option<&ProtocolObject<dyn UICollisionBehaviorDelegate>>,
);
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(feature = "UIDynamicBehavior")]
unsafe impl UICollisionBehavior {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,281 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
use objc2_core_image::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIColor;
unsafe impl ClassType for UIColor {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl Send for UIColor {}
unsafe impl Sync for UIColor {}
unsafe impl NSCoding for UIColor {}
unsafe impl NSCopying for UIColor {}
unsafe impl NSObjectProtocol for UIColor {}
unsafe impl NSSecureCoding for UIColor {}
extern_methods!(
unsafe impl UIColor {
#[method_id(@__retain_semantics Other colorWithWhite:alpha:)]
pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Retained<UIColor>;
#[method_id(@__retain_semantics Other colorWithHue:saturation:brightness:alpha:)]
pub unsafe fn colorWithHue_saturation_brightness_alpha(
hue: CGFloat,
saturation: CGFloat,
brightness: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Other colorWithRed:green:blue:alpha:)]
pub unsafe fn colorWithRed_green_blue_alpha(
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Other colorWithDisplayP3Red:green:blue:alpha:)]
pub unsafe fn colorWithDisplayP3Red_green_blue_alpha(
display_p3_red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Other colorWithPatternImage:)]
pub unsafe fn colorWithPatternImage(image: &UIImage) -> Retained<UIColor>;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
#[method_id(@__retain_semantics Other colorWithCIColor:)]
pub unsafe fn colorWithCIColor(ci_color: &CIColor) -> Retained<UIColor>;
#[method_id(@__retain_semantics Init initWithWhite:alpha:)]
pub unsafe fn initWithWhite_alpha(
this: Allocated<Self>,
white: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Init initWithHue:saturation:brightness:alpha:)]
pub unsafe fn initWithHue_saturation_brightness_alpha(
this: Allocated<Self>,
hue: CGFloat,
saturation: CGFloat,
brightness: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Init initWithRed:green:blue:alpha:)]
pub unsafe fn initWithRed_green_blue_alpha(
this: Allocated<Self>,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Init initWithDisplayP3Red:green:blue:alpha:)]
pub unsafe fn initWithDisplayP3Red_green_blue_alpha(
this: Allocated<Self>,
display_p3_red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat,
) -> Retained<UIColor>;
#[cfg(feature = "UIImage")]
#[method_id(@__retain_semantics Init initWithPatternImage:)]
pub unsafe fn initWithPatternImage(
this: Allocated<Self>,
image: &UIImage,
) -> Retained<UIColor>;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
#[method_id(@__retain_semantics Init initWithCIColor:)]
pub unsafe fn initWithCIColor(
this: Allocated<Self>,
ci_color: &CIColor,
) -> Retained<UIColor>;
#[method_id(@__retain_semantics Other blackColor)]
pub unsafe fn blackColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other darkGrayColor)]
pub unsafe fn darkGrayColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other lightGrayColor)]
pub unsafe fn lightGrayColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other whiteColor)]
pub unsafe fn whiteColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other grayColor)]
pub unsafe fn grayColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other redColor)]
pub unsafe fn redColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other greenColor)]
pub unsafe fn greenColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other blueColor)]
pub unsafe fn blueColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other cyanColor)]
pub unsafe fn cyanColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other yellowColor)]
pub unsafe fn yellowColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other magentaColor)]
pub unsafe fn magentaColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other orangeColor)]
pub unsafe fn orangeColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other purpleColor)]
pub unsafe fn purpleColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other brownColor)]
pub unsafe fn brownColor() -> Retained<UIColor>;
#[method_id(@__retain_semantics Other clearColor)]
pub unsafe fn clearColor() -> Retained<UIColor>;
#[method(set)]
pub unsafe fn set(&self);
#[method(setFill)]
pub unsafe fn setFill(&self);
#[method(setStroke)]
pub unsafe fn setStroke(&self);
#[method(getWhite:alpha:)]
pub unsafe fn getWhite_alpha(&self, white: *mut CGFloat, alpha: *mut CGFloat) -> bool;
#[method(getHue:saturation:brightness:alpha:)]
pub unsafe fn getHue_saturation_brightness_alpha(
&self,
hue: *mut CGFloat,
saturation: *mut CGFloat,
brightness: *mut CGFloat,
alpha: *mut CGFloat,
) -> bool;
#[method(getRed:green:blue:alpha:)]
pub unsafe fn getRed_green_blue_alpha(
&self,
red: *mut CGFloat,
green: *mut CGFloat,
blue: *mut CGFloat,
alpha: *mut CGFloat,
) -> bool;
#[method_id(@__retain_semantics Other colorWithAlphaComponent:)]
pub unsafe fn colorWithAlphaComponent(&self, alpha: CGFloat) -> Retained<UIColor>;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
#[method_id(@__retain_semantics Other CIColor)]
pub unsafe fn CIColor(&self) -> Retained<CIColor>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
unsafe impl UIColor {
#[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_methods!(
/// UINSItemProvider
unsafe impl UIColor {}
);
unsafe impl NSItemProviderReading for UIColor {}
unsafe impl NSItemProviderWriting for UIColor {}
extern_category!(
/// Category "UIKitAdditions" on [`CIColor`].
#[doc(alias = "UIKitAdditions")]
pub unsafe trait CIColorUIKitAdditions {
#[method_id(@__retain_semantics Init initWithColor:)]
unsafe fn initWithColor(this: Allocated<Self>, color: &UIColor) -> Retained<Self>;
}
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
unsafe impl CIColorUIKitAdditions for CIColor {}
);
extern_methods!(
/// UIColorNamedColors
unsafe impl UIColor {
#[method_id(@__retain_semantics Other colorNamed:)]
pub unsafe fn colorNamed(name: &NSString) -> Option<Retained<UIColor>>;
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Other colorNamed:inBundle:compatibleWithTraitCollection:)]
pub unsafe fn colorNamed_inBundle_compatibleWithTraitCollection(
name: &NSString,
bundle: Option<&NSBundle>,
trait_collection: Option<&UITraitCollection>,
) -> Option<Retained<UIColor>>;
}
);
extern_methods!(
/// DynamicColors
unsafe impl UIColor {
#[cfg(all(feature = "UITraitCollection", feature = "block2"))]
#[method_id(@__retain_semantics Other colorWithDynamicProvider:)]
pub unsafe fn colorWithDynamicProvider(
dynamic_provider: &block2::Block<
dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
>,
) -> Retained<UIColor>;
#[cfg(all(feature = "UITraitCollection", feature = "block2"))]
#[method_id(@__retain_semantics Init initWithDynamicProvider:)]
pub unsafe fn initWithDynamicProvider(
this: Allocated<Self>,
dynamic_provider: &block2::Block<
dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
>,
) -> Retained<UIColor>;
#[cfg(feature = "UITraitCollection")]
#[method_id(@__retain_semantics Other resolvedColorWithTraitCollection:)]
pub unsafe fn resolvedColorWithTraitCollection(
&self,
trait_collection: &UITraitCollection,
) -> Retained<UIColor>;
}
);

View File

@@ -0,0 +1,152 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIColorPickerViewControllerDelegate:
NSObjectProtocol + IsMainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[deprecated]
#[optional]
#[method(colorPickerViewControllerDidSelectColor:)]
unsafe fn colorPickerViewControllerDidSelectColor(
&self,
view_controller: &UIColorPickerViewController,
);
#[cfg(all(
feature = "UIColor",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[method(colorPickerViewController:didSelectColor:continuously:)]
unsafe fn colorPickerViewController_didSelectColor_continuously(
&self,
view_controller: &UIColorPickerViewController,
color: &UIColor,
continuously: bool,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[method(colorPickerViewControllerDidFinish:)]
unsafe fn colorPickerViewControllerDidFinish(
&self,
view_controller: &UIColorPickerViewController,
);
}
unsafe impl ProtocolType for dyn UIColorPickerViewControllerDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UIColorPickerViewController;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl ClassType for UIColorPickerViewController {
#[inherits(UIResponder, NSObject)]
type Super = UIViewController;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSCoding for UIColorPickerViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl NSObjectProtocol for UIColorPickerViewController {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIAppearanceContainer for UIColorPickerViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIContentContainer for UIColorPickerViewController {}
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
unsafe impl UIFocusEnvironment for UIColorPickerViewController {}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIResponderStandardEditActions for UIColorPickerViewController {}
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
unsafe impl UITraitEnvironment for UIColorPickerViewController {}
extern_methods!(
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIColorPickerViewController {
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UIColorPickerViewControllerDelegate>>>;
#[method(setDelegate:)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UIColorPickerViewControllerDelegate>>,
);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other selectedColor)]
pub unsafe fn selectedColor(&self) -> Retained<UIColor>;
#[cfg(feature = "UIColor")]
#[method(setSelectedColor:)]
pub unsafe fn setSelectedColor(&self, selected_color: &UIColor);
#[method(supportsAlpha)]
pub unsafe fn supportsAlpha(&self) -> bool;
#[method(setSupportsAlpha:)]
pub unsafe fn setSupportsAlpha(&self, supports_alpha: bool);
#[method_id(@__retain_semantics Init initWithNibName:bundle:)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `UIViewController`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIColorPickerViewController {
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
unsafe impl UIColorPickerViewController {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);

View File

@@ -0,0 +1,159 @@
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
pub struct UIColorWell;
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl ClassType for UIColorWell {
#[inherits(UIView, UIResponder, NSObject)]
type Super = UIControl;
type Mutability = MainThreadOnly;
}
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIColorWell {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIColorWell {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIColorWell {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearance for UIColorWell {}
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIAppearanceContainer for UIColorWell {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIColorWell {}
#[cfg(all(
feature = "UIControl",
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIDynamicItem for UIColorWell {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusEnvironment for UIColorWell {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItem for UIColorWell {}
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
unsafe impl UIFocusItemContainer for UIColorWell {}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIColorWell {}
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIColorWell {}
extern_methods!(
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIColorWell {
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: Option<&NSString>);
#[method(supportsAlpha)]
pub unsafe fn supportsAlpha(&self) -> bool;
#[method(setSupportsAlpha:)]
pub unsafe fn setSupportsAlpha(&self, supports_alpha: bool);
#[cfg(feature = "UIColor")]
#[method_id(@__retain_semantics Other selectedColor)]
pub unsafe fn selectedColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[method(setSelectedColor:)]
pub unsafe fn setSelectedColor(&self, selected_color: Option<&UIColor>);
}
);
extern_methods!(
/// Methods declared on superclass `UIControl`
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIColorWell {
#[method_id(@__retain_semantics Init initWithFrame:)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
#[method_id(@__retain_semantics Init initWithFrame:primaryAction:)]
pub unsafe fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
}
);
extern_methods!(
/// Methods declared on superclass `NSObject`
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIColorWell {
#[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(mtm: MainThreadMarker) -> Retained<Self>;
}
);

Some files were not shown because too many files have changed in this diff Show More