1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSOrderedCollectionDifferenceCalculationOptions {
        NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = 1 << 0,
        NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = 1 << 1,
        NSOrderedCollectionDifferenceCalculationInferMoves = 1 << 2,
    }
);

__inner_extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
    pub struct NSOrderedCollectionDifference<
        ObjectType: Message = Object,
        ObjectTypeOwnership: Ownership = Shared,
    > {
        _inner0: PhantomData<*mut (ObjectType, ObjectTypeOwnership)>,
        notunwindsafe: PhantomData<&'static mut ()>,
    }

    #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership> ClassType
        for NSOrderedCollectionDifference<ObjectType, ObjectTypeOwnership>
    {
        type Super = NSObject;
    }
);

#[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership> NSFastEnumeration
    for NSOrderedCollectionDifference<ObjectType, ObjectTypeOwnership>
{
}

#[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership> NSObjectProtocol
    for NSOrderedCollectionDifference<ObjectType, ObjectTypeOwnership>
{
}

extern_methods!(
    #[cfg(feature = "Foundation_NSOrderedCollectionDifference")]
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSOrderedCollectionDifference<ObjectType, ObjectTypeOwnership>
    {
        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "Foundation_NSOrderedCollectionChange"
        ))]
        #[method_id(@__retain_semantics Init initWithChanges:)]
        pub unsafe fn initWithChanges(
            this: Option<Allocated<Self>>,
            changes: &NSArray<NSOrderedCollectionChange<ObjectType>>,
        ) -> Id<Self, Shared>;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "Foundation_NSIndexSet",
            feature = "Foundation_NSOrderedCollectionChange"
        ))]
        #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:)]
        pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges(
            this: Option<Allocated<Self>>,
            inserts: &NSIndexSet,
            inserted_objects: Option<&NSArray<ObjectType>>,
            removes: &NSIndexSet,
            removed_objects: Option<&NSArray<ObjectType>>,
            changes: &NSArray<NSOrderedCollectionChange<ObjectType>>,
        ) -> Id<Self, Shared>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSIndexSet"))]
        #[method_id(@__retain_semantics Init initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:)]
        pub unsafe fn initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects(
            this: Option<Allocated<Self>>,
            inserts: &NSIndexSet,
            inserted_objects: Option<&NSArray<ObjectType>>,
            removes: &NSIndexSet,
            removed_objects: Option<&NSArray<ObjectType>>,
        ) -> Id<Self, Shared>;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "Foundation_NSOrderedCollectionChange"
        ))]
        #[method_id(@__retain_semantics Other insertions)]
        pub unsafe fn insertions(
            &self,
        ) -> Id<NSArray<NSOrderedCollectionChange<ObjectType>>, Shared>;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "Foundation_NSOrderedCollectionChange"
        ))]
        #[method_id(@__retain_semantics Other removals)]
        pub unsafe fn removals(&self)
            -> Id<NSArray<NSOrderedCollectionChange<ObjectType>>, Shared>;

        #[method(hasChanges)]
        pub unsafe fn hasChanges(&self) -> bool;

        #[cfg(feature = "Foundation_NSOrderedCollectionChange")]
        #[method_id(@__retain_semantics Other differenceByTransformingChangesWithBlock:)]
        pub unsafe fn differenceByTransformingChangesWithBlock(
            &self,
            block: &Block<
                (NonNull<NSOrderedCollectionChange<ObjectType>>,),
                NonNull<NSOrderedCollectionChange<Object>>,
            >,
        ) -> Id<NSOrderedCollectionDifference<Object>, Shared>;

        #[method_id(@__retain_semantics Other inverseDifference)]
        pub unsafe fn inverseDifference(&self) -> Id<Self, Shared>;
    }
);