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
35unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedCollectionChange<ObjectType> {}
36
37impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
38    extern_methods!(
39        #[unsafe(method(changeWithObject:type:index:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn changeWithObject_type_index(
42            an_object: Option<&ObjectType>,
43            r#type: NSCollectionChangeType,
44            index: NSUInteger,
45        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;
46
47        #[unsafe(method(changeWithObject:type:index:associatedIndex:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn changeWithObject_type_index_associatedIndex(
50            an_object: Option<&ObjectType>,
51            r#type: NSCollectionChangeType,
52            index: NSUInteger,
53            associated_index: NSUInteger,
54        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;
55
56        #[unsafe(method(object))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn object(&self) -> Option<Retained<ObjectType>>;
59
60        #[unsafe(method(changeType))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn changeType(&self) -> NSCollectionChangeType;
63
64        #[unsafe(method(index))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn index(&self) -> NSUInteger;
67
68        #[unsafe(method(associatedIndex))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn associatedIndex(&self) -> NSUInteger;
71
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(initWithObject:type:index:))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn initWithObject_type_index(
79            this: Allocated<Self>,
80            an_object: Option<&ObjectType>,
81            r#type: NSCollectionChangeType,
82            index: NSUInteger,
83        ) -> Retained<Self>;
84
85        #[unsafe(method(initWithObject:type:index:associatedIndex:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithObject_type_index_associatedIndex(
88            this: Allocated<Self>,
89            an_object: Option<&ObjectType>,
90            r#type: NSCollectionChangeType,
91            index: NSUInteger,
92            associated_index: NSUInteger,
93        ) -> Retained<Self>;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
99    extern_methods!(
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}