objc2_foundation/generated/
NSOrderedCollectionChange.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscollectionchangetype?language=objc)
9// NS_ENUM
10#[repr(transparent)]
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
12pub struct NSCollectionChangeType(pub NSInteger);
13impl NSCollectionChangeType {
14    #[doc(alias = "NSCollectionChangeInsert")]
15    pub const Insert: Self = Self(0);
16    #[doc(alias = "NSCollectionChangeRemove")]
17    pub const Remove: Self = Self(1);
18}
19
20unsafe impl Encode for NSCollectionChangeType {
21    const ENCODING: Encoding = NSInteger::ENCODING;
22}
23
24unsafe impl RefEncode for NSCollectionChangeType {
25    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
26}
27
28extern_class!(
29    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsorderedcollectionchange?language=objc)
30    #[unsafe(super(NSObject))]
31    #[derive(Debug, PartialEq, Eq, Hash)]
32    pub struct NSOrderedCollectionChange<ObjectType: ?Sized = AnyObject>;
33);
34
35extern_conformance!(
36    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedCollectionChange<ObjectType> {}
37);
38
39impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
40    extern_methods!(
41        #[unsafe(method(changeWithObject:type:index:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn changeWithObject_type_index(
44            an_object: Option<&ObjectType>,
45            r#type: NSCollectionChangeType,
46            index: NSUInteger,
47        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;
48
49        #[unsafe(method(changeWithObject:type:index:associatedIndex:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn changeWithObject_type_index_associatedIndex(
52            an_object: Option<&ObjectType>,
53            r#type: NSCollectionChangeType,
54            index: NSUInteger,
55            associated_index: NSUInteger,
56        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;
57
58        #[unsafe(method(object))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn object(&self) -> Option<Retained<ObjectType>>;
61
62        #[unsafe(method(changeType))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn changeType(&self) -> NSCollectionChangeType;
65
66        #[unsafe(method(index))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn index(&self) -> NSUInteger;
69
70        #[unsafe(method(associatedIndex))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn associatedIndex(&self) -> NSUInteger;
73
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(initWithObject:type:index:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithObject_type_index(
81            this: Allocated<Self>,
82            an_object: Option<&ObjectType>,
83            r#type: NSCollectionChangeType,
84            index: NSUInteger,
85        ) -> Retained<Self>;
86
87        #[unsafe(method(initWithObject:type:index:associatedIndex:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithObject_type_index_associatedIndex(
90            this: Allocated<Self>,
91            an_object: Option<&ObjectType>,
92            r#type: NSCollectionChangeType,
93            index: NSUInteger,
94            associated_index: NSUInteger,
95        ) -> Retained<Self>;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}