objc2-open-directory 0.3.2

Bindings to the OpenDirectory framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/opendirectory/odmoduleentry?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ODModuleEntry;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ODModuleEntry {}
);

impl ODModuleEntry {
    extern_methods!(
        #[cfg(feature = "ODMappings")]
        #[unsafe(method(mappings))]
        #[unsafe(method_family = none)]
        pub unsafe fn mappings(&self) -> Option<Retained<ODMappings>>;

        #[cfg(feature = "ODMappings")]
        /// Setter for [`mappings`][Self::mappings].
        ///
        /// # Safety
        ///
        /// `mappings` might not allow `None`.
        #[unsafe(method(setMappings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMappings(&self, mappings: Option<&ODMappings>);

        #[unsafe(method(supportedOptions))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedOptions(&self) -> Retained<NSArray>;

        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[unsafe(method(xpcServiceName))]
        #[unsafe(method_family = none)]
        pub unsafe fn xpcServiceName(&self) -> Retained<NSString>;

        /// Setter for [`xpcServiceName`][Self::xpcServiceName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setXpcServiceName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setXpcServiceName(&self, xpc_service_name: Option<&NSString>);

        #[unsafe(method(uuidString))]
        #[unsafe(method_family = none)]
        pub unsafe fn uuidString(&self) -> Retained<NSString>;

        /// Setter for [`uuidString`][Self::uuidString].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setUuidString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUuidString(&self, uuid_string: Option<&NSString>);

        /// Creates a new module entry with a given name and service.
        ///
        ///
        /// Creates a new module entry with a given name and service.
        ///
        /// # Safety
        ///
        /// - `name` might not allow `None`.
        /// - `xpc_service_name` might not allow `None`.
        #[unsafe(method(moduleEntryWithName:xpcServiceName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moduleEntryWithName_xpcServiceName(
            name: Option<&NSString>,
            xpc_service_name: Option<&NSString>,
        ) -> Option<Retained<Self>>;

        /// Assigns a particular option for this module.
        ///
        ///
        /// Options are dictated by the module and can be queried via [module supportedOptions].
        ///
        /// # Safety
        ///
        /// - `option_name` might not allow `None`.
        /// - `value` should be of the correct type.
        /// - `value` might not allow `None`.
        #[unsafe(method(setOption:value:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOption_value(
            &self,
            option_name: Option<&NSString>,
            value: Option<&AnyObject>,
        );

        /// Fetches the current setting for the requested option.
        ///
        ///
        /// Fetches the current setting for the requested option.
        ///
        /// # Safety
        ///
        /// `option_name` might not allow `None`.
        #[unsafe(method(option:))]
        #[unsafe(method_family = none)]
        pub unsafe fn option(&self, option_name: Option<&NSString>) -> Option<Retained<AnyObject>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl ODModuleEntry {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}