objc2_intents/generated/
INObjectCollection.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inobjectcollection?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct INObjectCollection<ObjectType: ?Sized = AnyObject>;
15);
16
17impl<ObjectType: ?Sized + Message> INObjectCollection<ObjectType> {
18    /// Unchecked conversion of the generic parameter.
19    ///
20    /// # Safety
21    ///
22    /// The generic must be valid to reinterpret as the given type.
23    #[inline]
24    pub unsafe fn cast_unchecked<NewObjectType: ?Sized + Message>(
25        &self,
26    ) -> &INObjectCollection<NewObjectType> {
27        unsafe { &*((self as *const Self).cast()) }
28    }
29}
30
31extern_conformance!(
32    unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for INObjectCollection<ObjectType> {}
33);
34
35extern_conformance!(
36    unsafe impl<ObjectType: ?Sized> NSCopying for INObjectCollection<ObjectType> {}
37);
38
39unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for INObjectCollection<ObjectType> {
40    type Result = Self;
41}
42
43extern_conformance!(
44    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for INObjectCollection<ObjectType> {}
45);
46
47extern_conformance!(
48    unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for INObjectCollection<ObjectType> {}
49);
50
51impl<ObjectType: Message> INObjectCollection<ObjectType> {
52    extern_methods!(
53        #[cfg(feature = "INObjectSection")]
54        #[unsafe(method(sections))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn sections(&self) -> Retained<NSArray<INObjectSection<ObjectType>>>;
57
58        #[unsafe(method(allItems))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn allItems(&self) -> Retained<NSArray<ObjectType>>;
61
62        #[unsafe(method(usesIndexedCollation))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn usesIndexedCollation(&self) -> bool;
65
66        /// Setter for [`usesIndexedCollation`][Self::usesIndexedCollation].
67        #[unsafe(method(setUsesIndexedCollation:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setUsesIndexedCollation(&self, uses_indexed_collation: bool);
70
71        #[cfg(feature = "INObjectSection")]
72        #[unsafe(method(initWithSections:))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn initWithSections(
75            this: Allocated<Self>,
76            sections: &NSArray<INObjectSection<ObjectType>>,
77        ) -> Retained<Self>;
78
79        #[unsafe(method(initWithItems:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithItems(
82            this: Allocated<Self>,
83            items: &NSArray<ObjectType>,
84        ) -> Retained<Self>;
85
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89    );
90}
91
92/// Methods declared on superclass `NSObject`.
93impl<ObjectType: Message> INObjectCollection<ObjectType> {
94    extern_methods!(
95        #[unsafe(method(new))]
96        #[unsafe(method_family = new)]
97        pub unsafe fn new() -> Retained<Self>;
98    );
99}