objc2_system_extensions/generated/
mod.rs

1// This file has been automatically generated by `objc2`'s `header-translator`.
2// DO NOT EDIT
3
4#![allow(unused_imports)]
5#![allow(deprecated)]
6#![allow(non_snake_case)]
7#![allow(non_camel_case_types)]
8#![allow(non_upper_case_globals)]
9#![allow(missing_docs)]
10#![allow(clippy::too_many_arguments)]
11#![allow(clippy::type_complexity)]
12#![allow(clippy::upper_case_acronyms)]
13#![allow(clippy::identity_op)]
14#![allow(clippy::missing_safety_doc)]
15#![allow(clippy::doc_lazy_continuation)]
16#![allow(rustdoc::broken_intra_doc_links)]
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::invalid_html_tags)]
19
20#[link(name = "SystemExtensions", kind = "framework")]
21extern "C" {}
22
23use core::ffi::*;
24use core::ptr::NonNull;
25#[cfg(feature = "dispatch2")]
26use dispatch2::*;
27use objc2::__framework_prelude::*;
28use objc2_foundation::*;
29
30use crate::*;
31
32extern "C" {
33    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionerrordomain?language=objc)
34    pub static OSSystemExtensionErrorDomain: &'static NSErrorDomain;
35}
36
37extern "C" {
38    /// A property of a Driver Extension bundle containing a message that tells
39    /// the user why the app is requesting to install it.
40    ///
41    ///
42    /// The 'OSBundleUsageDescription' key is required in your Driver
43    /// Extension if your app uses APIs that install them.
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/systemextensions/osbundleusagedescriptionkey?language=objc)
46    pub static OSBundleUsageDescriptionKey: &'static NSString;
47}
48
49extern "C" {
50    /// A property of a System Extension bundle containing a message that tells
51    /// the user why the app is requesting to install it.
52    ///
53    ///
54    /// The 'NSSystemExtensionUsageDescription' key is required in your
55    /// System Extension if your app uses APIs that install them.
56    ///
57    /// See also [Apple's documentation](https://developer.apple.com/documentation/systemextensions/nssystemextensionusagedescriptionkey?language=objc)
58    pub static NSSystemExtensionUsageDescriptionKey: &'static NSString;
59}
60
61extern "C" {
62    /// An optional property of a System Extension bundle naming the bundle
63    /// identifier of a kernel extension (kext) with similar purpose and capabilities.
64    ///
65    ///
66    /// The 'OSRelatedKernelExtension' key is optional. If one is present
67    /// and the related kernel extension has the same Team ID and is approved by the
68    /// system policy, this System Extension is also approved.
69    ///
70    /// See also [Apple's documentation](https://developer.apple.com/documentation/systemextensions/osrelatedkernelextensionkey?language=objc)
71    pub static OSRelatedKernelExtensionKey: &'static NSString;
72}
73
74/// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionerrorcode?language=objc)
75// NS_ERROR_ENUM
76#[repr(transparent)]
77#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
78pub struct OSSystemExtensionErrorCode(pub NSInteger);
79impl OSSystemExtensionErrorCode {
80    #[doc(alias = "OSSystemExtensionErrorUnknown")]
81    pub const Unknown: Self = Self(1);
82    #[doc(alias = "OSSystemExtensionErrorMissingEntitlement")]
83    pub const MissingEntitlement: Self = Self(2);
84    #[doc(alias = "OSSystemExtensionErrorUnsupportedParentBundleLocation")]
85    pub const UnsupportedParentBundleLocation: Self = Self(3);
86    #[doc(alias = "OSSystemExtensionErrorExtensionNotFound")]
87    pub const ExtensionNotFound: Self = Self(4);
88    #[doc(alias = "OSSystemExtensionErrorExtensionMissingIdentifier")]
89    pub const ExtensionMissingIdentifier: Self = Self(5);
90    #[doc(alias = "OSSystemExtensionErrorDuplicateExtensionIdentifer")]
91    pub const DuplicateExtensionIdentifer: Self = Self(6);
92    #[doc(alias = "OSSystemExtensionErrorUnknownExtensionCategory")]
93    pub const UnknownExtensionCategory: Self = Self(7);
94    #[doc(alias = "OSSystemExtensionErrorCodeSignatureInvalid")]
95    pub const CodeSignatureInvalid: Self = Self(8);
96    #[doc(alias = "OSSystemExtensionErrorValidationFailed")]
97    pub const ValidationFailed: Self = Self(9);
98    #[doc(alias = "OSSystemExtensionErrorForbiddenBySystemPolicy")]
99    pub const ForbiddenBySystemPolicy: Self = Self(10);
100    #[doc(alias = "OSSystemExtensionErrorRequestCanceled")]
101    pub const RequestCanceled: Self = Self(11);
102    #[doc(alias = "OSSystemExtensionErrorRequestSuperseded")]
103    pub const RequestSuperseded: Self = Self(12);
104    #[doc(alias = "OSSystemExtensionErrorAuthorizationRequired")]
105    pub const AuthorizationRequired: Self = Self(13);
106}
107
108unsafe impl Encode for OSSystemExtensionErrorCode {
109    const ENCODING: Encoding = NSInteger::ENCODING;
110}
111
112unsafe impl RefEncode for OSSystemExtensionErrorCode {
113    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
114}
115
116/// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionreplacementaction?language=objc)
117// NS_ENUM
118#[repr(transparent)]
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120pub struct OSSystemExtensionReplacementAction(pub NSInteger);
121impl OSSystemExtensionReplacementAction {
122    /// Returned by the delegate when it determines that replacing an existing
123    /// System Extension should not proceed.
124    #[doc(alias = "OSSystemExtensionReplacementActionCancel")]
125    pub const Cancel: Self = Self(0);
126    /// Returned by the delegate when it determines that replacing an existing
127    /// System Extension is desired.
128    #[doc(alias = "OSSystemExtensionReplacementActionReplace")]
129    pub const Replace: Self = Self(1);
130}
131
132unsafe impl Encode for OSSystemExtensionReplacementAction {
133    const ENCODING: Encoding = NSInteger::ENCODING;
134}
135
136unsafe impl RefEncode for OSSystemExtensionReplacementAction {
137    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
138}
139
140/// Describes additional result feedback after completion of a system extension request
141///
142/// See also [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionrequestresult?language=objc)
143// NS_ENUM
144#[repr(transparent)]
145#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
146pub struct OSSystemExtensionRequestResult(pub NSInteger);
147impl OSSystemExtensionRequestResult {
148    /// The request was successfully completed.
149    #[doc(alias = "OSSystemExtensionRequestCompleted")]
150    pub const Completed: Self = Self(0);
151    /// The request will be successfully completed after a reboot.
152    #[doc(alias = "OSSystemExtensionRequestWillCompleteAfterReboot")]
153    pub const WillCompleteAfterReboot: Self = Self(1);
154}
155
156unsafe impl Encode for OSSystemExtensionRequestResult {
157    const ENCODING: Encoding = NSInteger::ENCODING;
158}
159
160unsafe impl RefEncode for OSSystemExtensionRequestResult {
161    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
162}
163
164extern_class!(
165    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionrequest?language=objc)
166    #[unsafe(super(NSObject))]
167    #[derive(Debug, PartialEq, Eq, Hash)]
168    pub struct OSSystemExtensionRequest;
169);
170
171extern_conformance!(
172    unsafe impl NSObjectProtocol for OSSystemExtensionRequest {}
173);
174
175impl OSSystemExtensionRequest {
176    extern_methods!(
177        #[cfg(feature = "dispatch2")]
178        /// Creates a request to activate a System Extension.
179        ///
180        ///
181        /// This method creates a new request to activate a System Extension.
182        /// Extensions are bundles discovered from the `Contents/Library/SystemExtensions`
183        /// directory of the main application bundle.
184        ///
185        ///
186        /// Parameter `identifier`: The bundle identifier of the target extension.
187        ///
188        ///
189        /// Parameter `queue`: The dispatch queue to use when calling delegate methods.
190        ///
191        ///
192        /// Returns: A new extension request.
193        ///
194        ///
195        /// Note: It is expected that an application create and submit an activation
196        /// request whenever an extension should be active. Upon submitting an activation
197        /// request for an inactive extension, user approval may be required and the
198        /// request will not succeed until approval is given.
199        ///
200        /// If the extension is already active then the request will succeed in short
201        /// order without significant delay or user interaction. Activating an new version
202        /// of an already active extension will prompt the delegate to resolve the conflict
203        /// before proceeding.
204        ///
205        /// An activation request can be successful but also indicate that a reboot is
206        /// required in order for the extension to become active. This can occur when
207        /// replacing an existing extension that required a reboot in order to deactivate.
208        /// The most recently activated extension will then become active when the system
209        /// is next rebooted.
210        ///
211        /// # Safety
212        ///
213        /// `queue` possibly has additional threading requirements.
214        #[unsafe(method(activationRequestForExtension:queue:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn activationRequestForExtension_queue(
217            identifier: &NSString,
218            queue: &DispatchQueue,
219        ) -> Retained<Self>;
220
221        #[cfg(feature = "dispatch2")]
222        /// Creates a request to deactivate a System Extension.
223        ///
224        ///
225        /// This method creates a new request to deactivate a System Extension.
226        /// Extensions are discovered from the `Contents/Library/SystemExtensions`
227        /// directory of the main application bundle.
228        ///
229        ///
230        /// Parameter `identifier`: The bundle identifier of the target extension.
231        ///
232        ///
233        /// Parameter `queue`: The dispatch queue to use when calling delegate methods.
234        ///
235        ///
236        /// Note: It is possible for an extension to require a reboot before it is fully
237        /// deactivated. If a request succeeds and indicates a reboot is required, the
238        /// extension may still appear to be operational until that time.
239        ///
240        /// # Safety
241        ///
242        /// `queue` possibly has additional threading requirements.
243        #[unsafe(method(deactivationRequestForExtension:queue:))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn deactivationRequestForExtension_queue(
246            identifier: &NSString,
247            queue: &DispatchQueue,
248        ) -> Retained<Self>;
249
250        #[cfg(feature = "dispatch2")]
251        /// Creates a request to get information about System Extensions.
252        ///
253        ///
254        /// This method creates a new request to retrieve the properties
255        /// of any System Extensions matching the given identifier.
256        ///
257        ///
258        /// Parameter `identifier`: The bundle identifier of the target extension(s).
259        ///
260        ///
261        /// Parameter `queue`: The dispatch queue to use when calling delegate methods.
262        ///
263        /// # Safety
264        ///
265        /// `queue` possibly has additional threading requirements.
266        #[unsafe(method(propertiesRequestForExtension:queue:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn propertiesRequestForExtension_queue(
269            identifier: &NSString,
270            queue: &DispatchQueue,
271        ) -> Retained<Self>;
272
273        /// A delegate to receive updates about the progress of a request
274        #[unsafe(method(delegate))]
275        #[unsafe(method_family = none)]
276        pub unsafe fn delegate(
277            &self,
278        ) -> Option<Retained<ProtocolObject<dyn OSSystemExtensionRequestDelegate>>>;
279
280        /// Setter for [`delegate`][Self::delegate].
281        ///
282        /// This is a [weak property][objc2::topics::weak_property].
283        #[unsafe(method(setDelegate:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn setDelegate(
286            &self,
287            delegate: Option<&ProtocolObject<dyn OSSystemExtensionRequestDelegate>>,
288        );
289
290        /// The bundle identifier of the target extension
291        #[unsafe(method(identifier))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn identifier(&self) -> Retained<NSString>;
294    );
295}
296
297/// Methods declared on superclass `NSObject`.
298impl OSSystemExtensionRequest {
299    extern_methods!(
300        #[unsafe(method(init))]
301        #[unsafe(method_family = init)]
302        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
303
304        #[unsafe(method(new))]
305        #[unsafe(method_family = new)]
306        pub unsafe fn new() -> Retained<Self>;
307    );
308}
309
310extern_class!(
311    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionproperties?language=objc)
312    #[unsafe(super(NSObject))]
313    #[derive(Debug, PartialEq, Eq, Hash)]
314    pub struct OSSystemExtensionProperties;
315);
316
317extern_conformance!(
318    unsafe impl NSObjectProtocol for OSSystemExtensionProperties {}
319);
320
321impl OSSystemExtensionProperties {
322    extern_methods!(
323        /// The file URL locating an indicating the extension bundle these properties
324        /// were retreived from.
325        #[unsafe(method(URL))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn URL(&self) -> Retained<NSURL>;
328
329        /// The bundle identifier of the extension (CFBundleIdentifier)
330        #[unsafe(method(bundleIdentifier))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn bundleIdentifier(&self) -> Retained<NSString>;
333
334        /// The bundle version of the extension (CFBundleVersion)
335        #[unsafe(method(bundleVersion))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn bundleVersion(&self) -> Retained<NSString>;
338
339        /// The bundle short version string of the extension (CFBundleShortVersionString)
340        #[unsafe(method(bundleShortVersion))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn bundleShortVersion(&self) -> Retained<NSString>;
343
344        /// Returns the enabled state of the extension
345        #[unsafe(method(isEnabled))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn isEnabled(&self) -> bool;
348
349        /// Returns whether an extension is waiting for user approval
350        #[unsafe(method(isAwaitingUserApproval))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn isAwaitingUserApproval(&self) -> bool;
353
354        /// Returns if an extension is being uninstalled
355        #[unsafe(method(isUninstalling))]
356        #[unsafe(method_family = none)]
357        pub unsafe fn isUninstalling(&self) -> bool;
358    );
359}
360
361/// Methods declared on superclass `NSObject`.
362impl OSSystemExtensionProperties {
363    extern_methods!(
364        #[unsafe(method(init))]
365        #[unsafe(method_family = init)]
366        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
367
368        #[unsafe(method(new))]
369        #[unsafe(method_family = new)]
370        pub unsafe fn new() -> Retained<Self>;
371    );
372}
373
374extern_protocol!(
375    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionrequestdelegate?language=objc)
376    pub unsafe trait OSSystemExtensionRequestDelegate: NSObjectProtocol {
377        /// Called when the target extension bundle identifier is already activated.
378        ///
379        ///
380        /// The delegate will receive this callback when an activation request
381        /// encounters an existing extension with the same team and bundle identifiers but
382        /// with different version identifiers. The delegate must make a decision on
383        /// whether or not to replace the existing extension.
384        ///
385        ///
386        /// Parameter `request`: The request that encountered the conflict
387        ///
388        ///
389        /// Parameter `existing`: The NSBundle of the existing extension
390        ///
391        ///
392        /// Parameter `ext`: The NSBundle of the extension matching the bundle identifier of the request
393        ///
394        ///
395        /// Returns: A replacement action indicating the desired outcome of the conflict
396        ///
397        ///
398        /// Note: This method is invoked if the `CFBundleVersion` or `CFBundleShortVersionString`
399        /// identifiers of the target and existing extension differ.
400        ///
401        /// If the local system has System Extension developer mode enabled, this callback
402        /// will always fire when an existing extension is found, regardless of version
403        /// identifiers.
404        ///
405        /// Returning OSSystemExtensionReplacementActionAbortRequest will trigger a callback
406        /// to `request:didFailWithError:` with the OSSystemExtensionErrorRequestCanceled
407        /// error code.
408        #[unsafe(method(request:actionForReplacingExtension:withExtension:))]
409        #[unsafe(method_family = none)]
410        unsafe fn request_actionForReplacingExtension_withExtension(
411            &self,
412            request: &OSSystemExtensionRequest,
413            existing: &OSSystemExtensionProperties,
414            ext: &OSSystemExtensionProperties,
415        ) -> OSSystemExtensionReplacementAction;
416
417        /// Called when the target extension requires user approval to be activated.
418        ///
419        ///
420        /// Activating an extension may require explicit user approval in order
421        /// to proceed. For example, this can occur when the user has never previously
422        /// approved this extension. If approval is necessary, this callback will be
423        /// triggered and the activation request will remain pending until user approves,
424        /// or until the application exits.
425        #[unsafe(method(requestNeedsUserApproval:))]
426        #[unsafe(method_family = none)]
427        unsafe fn requestNeedsUserApproval(&self, request: &OSSystemExtensionRequest);
428
429        /// Called when the target extension request has completed.
430        ///
431        ///
432        /// Successful results can come with additional information regarding
433        /// the manner in which they were completed. See the OSSystemExtensionRequestResult
434        /// documentation for more information.
435        ///
436        ///
437        /// Parameter `result`: Additional result information from the completed request.
438        ///
439        ///
440        /// Note: If the request completes with the `OSSystemExtensionRequestWillCompleteAfterReboot`
441        /// result, then the extension will not be active until after the next reboot. Upon
442        /// reboot, a given extension will be in the state dictated by the most recently
443        /// processed request.
444        #[unsafe(method(request:didFinishWithResult:))]
445        #[unsafe(method_family = none)]
446        unsafe fn request_didFinishWithResult(
447            &self,
448            request: &OSSystemExtensionRequest,
449            result: OSSystemExtensionRequestResult,
450        );
451
452        /// Called when the target extension request failed.
453        #[unsafe(method(request:didFailWithError:))]
454        #[unsafe(method_family = none)]
455        unsafe fn request_didFailWithError(
456            &self,
457            request: &OSSystemExtensionRequest,
458            error: &NSError,
459        );
460
461        /// Called request for properties has completed.
462        ///
463        ///
464        /// Parameter `properties`: Returns an array of OSSystemExtensionProperties matching the
465        /// requested bundle identifier.
466        #[optional]
467        #[unsafe(method(request:foundProperties:))]
468        #[unsafe(method_family = none)]
469        unsafe fn request_foundProperties(
470            &self,
471            request: &OSSystemExtensionRequest,
472            properties: &NSArray<OSSystemExtensionProperties>,
473        );
474    }
475);
476
477extern_class!(
478    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionmanager?language=objc)
479    #[unsafe(super(NSObject))]
480    #[derive(Debug, PartialEq, Eq, Hash)]
481    pub struct OSSystemExtensionManager;
482);
483
484extern_conformance!(
485    unsafe impl NSObjectProtocol for OSSystemExtensionManager {}
486);
487
488impl OSSystemExtensionManager {
489    extern_methods!(
490        #[unsafe(method(init))]
491        #[unsafe(method_family = init)]
492        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
493
494        #[unsafe(method(new))]
495        #[unsafe(method_family = new)]
496        pub unsafe fn new(&self) -> Retained<Self>;
497
498        #[unsafe(method(sharedManager))]
499        #[unsafe(method_family = none)]
500        pub unsafe fn sharedManager() -> Retained<OSSystemExtensionManager>;
501
502        /// Submits a System Extension request to the manager.
503        ///
504        ///
505        /// Parameter `request`: The request to process.
506        #[unsafe(method(submitRequest:))]
507        #[unsafe(method_family = none)]
508        pub unsafe fn submitRequest(&self, request: &OSSystemExtensionRequest);
509    );
510}
511
512/// Methods declared on superclass `NSObject`.
513impl OSSystemExtensionManager {
514    extern_methods!(
515        #[unsafe(method(new))]
516        #[unsafe(method_family = new)]
517        pub unsafe fn new_class() -> Retained<Self>;
518    );
519}
520
521extern_class!(
522    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensioninfo?language=objc)
523    #[unsafe(super(NSObject))]
524    #[derive(Debug, PartialEq, Eq, Hash)]
525    pub struct OSSystemExtensionInfo;
526);
527
528unsafe impl Send for OSSystemExtensionInfo {}
529
530unsafe impl Sync for OSSystemExtensionInfo {}
531
532extern_conformance!(
533    unsafe impl NSObjectProtocol for OSSystemExtensionInfo {}
534);
535
536impl OSSystemExtensionInfo {
537    extern_methods!(
538        /// The bundle identifier of the extension (CFBundleIdentifier)
539        #[unsafe(method(bundleIdentifier))]
540        #[unsafe(method_family = none)]
541        pub unsafe fn bundleIdentifier(&self) -> Retained<NSString>;
542
543        /// The bundle version of the extension (CFBundleVersion)
544        #[unsafe(method(bundleVersion))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn bundleVersion(&self) -> Retained<NSString>;
547
548        /// The bundle short version string of the extension (CFBundleShortVersionString)
549        #[unsafe(method(bundleShortVersion))]
550        #[unsafe(method_family = none)]
551        pub unsafe fn bundleShortVersion(&self) -> Retained<NSString>;
552    );
553}
554
555/// Methods declared on superclass `NSObject`.
556impl OSSystemExtensionInfo {
557    extern_methods!(
558        #[unsafe(method(init))]
559        #[unsafe(method_family = init)]
560        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
561
562        #[unsafe(method(new))]
563        #[unsafe(method_family = new)]
564        pub unsafe fn new() -> Retained<Self>;
565    );
566}
567
568extern_protocol!(
569    /// [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionsworkspaceobserver?language=objc)
570    pub unsafe trait OSSystemExtensionsWorkspaceObserver: NSObjectProtocol {
571        /// This delegate method will be called when a system extension has been validated and allowed by the user to run.
572        #[optional]
573        #[unsafe(method(systemExtensionWillBecomeEnabled:))]
574        #[unsafe(method_family = none)]
575        unsafe fn systemExtensionWillBecomeEnabled(
576            &self,
577            system_extension_info: &OSSystemExtensionInfo,
578        );
579
580        /// This delegate method will be called when the user disables an already enabled system extension, or when the system extension is first installed and is in the disabled state.
581        #[optional]
582        #[unsafe(method(systemExtensionWillBecomeDisabled:))]
583        #[unsafe(method_family = none)]
584        unsafe fn systemExtensionWillBecomeDisabled(
585            &self,
586            system_extension_info: &OSSystemExtensionInfo,
587        );
588
589        /// This delegate method will be called when a system extension is deactivated and is about to get uninstalled. The extension may still be running until the system is rebooted.
590        #[optional]
591        #[unsafe(method(systemExtensionWillBecomeInactive:))]
592        #[unsafe(method_family = none)]
593        unsafe fn systemExtensionWillBecomeInactive(
594            &self,
595            system_extension_info: &OSSystemExtensionInfo,
596        );
597    }
598);
599
600extern_class!(
601    /// Note: Using the workspace API requires the system extension entitlement
602    ///
603    /// See also [Apple's documentation](https://developer.apple.com/documentation/systemextensions/ossystemextensionsworkspace?language=objc)
604    #[unsafe(super(NSObject))]
605    #[derive(Debug, PartialEq, Eq, Hash)]
606    pub struct OSSystemExtensionsWorkspace;
607);
608
609unsafe impl Send for OSSystemExtensionsWorkspace {}
610
611unsafe impl Sync for OSSystemExtensionsWorkspace {}
612
613extern_conformance!(
614    unsafe impl NSObjectProtocol for OSSystemExtensionsWorkspace {}
615);
616
617impl OSSystemExtensionsWorkspace {
618    extern_methods!(
619        #[unsafe(method(sharedWorkspace))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn sharedWorkspace() -> Retained<OSSystemExtensionsWorkspace>;
622
623        /// Start observing changes to System Extension(s) which are enabled or ready to be enabled.
624        #[unsafe(method(addObserver:error:_))]
625        #[unsafe(method_family = none)]
626        pub unsafe fn addObserver_error(
627            &self,
628            observer: &ProtocolObject<dyn OSSystemExtensionsWorkspaceObserver>,
629        ) -> Result<(), Retained<NSError>>;
630
631        /// Stop observing changes to System Extension(s).
632        #[unsafe(method(removeObserver:))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn removeObserver(
635            &self,
636            observer: &ProtocolObject<dyn OSSystemExtensionsWorkspaceObserver>,
637        );
638
639        /// Get information about system extension(s) in an app with a bundle identifier
640        ///
641        ///
642        /// Parameter `bundleID`: BundleIdentifier of the application containing the system extension(s)
643        ///
644        /// Parameter `out_error`: Error parameter to be populated with relevant error information
645        ///
646        ///
647        /// Returns: A set of system extension property objects on success, nil otherwise.
648        #[unsafe(method(systemExtensionsForApplicationWithBundleID:error:_))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn systemExtensionsForApplicationWithBundleID_error(
651            &self,
652            bundle_id: &NSString,
653        ) -> Result<Retained<NSSet<OSSystemExtensionProperties>>, Retained<NSError>>;
654    );
655}
656
657/// Methods declared on superclass `NSObject`.
658impl OSSystemExtensionsWorkspace {
659    extern_methods!(
660        #[unsafe(method(init))]
661        #[unsafe(method_family = init)]
662        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
663
664        #[unsafe(method(new))]
665        #[unsafe(method_family = new)]
666        pub unsafe fn new() -> Retained<Self>;
667    );
668}