objc2-quartz 0.3.2

Bindings to the Quartz 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_app_kit::*;
use objc2_foundation::*;

use crate::*;

mod private_NSObjectIKSaveOptionsDelegate {
    pub trait Sealed {}
}

/// Category "IKSaveOptionsDelegate" on [`NSObject`].
#[doc(alias = "IKSaveOptionsDelegate")]
pub unsafe trait NSObjectIKSaveOptionsDelegate:
    ClassType + Sized + private_NSObjectIKSaveOptionsDelegate::Sealed
{
    extern_methods!(
        /// # Safety
        ///
        /// - `save_options` might not allow `None`.
        /// - `ut_type` might not allow `None`.
        #[unsafe(method(saveOptions:shouldShowUTType:))]
        #[unsafe(method_family = none)]
        unsafe fn saveOptions_shouldShowUTType(
            &self,
            save_options: Option<&IKSaveOptions>,
            ut_type: Option<&NSString>,
        ) -> bool;
    );
}

impl private_NSObjectIKSaveOptionsDelegate::Sealed for NSObject {}
unsafe impl NSObjectIKSaveOptionsDelegate for NSObject {}

extern_class!(
    /// The IKSaveOptions class initializes, adds, and manages user interface options for saving image data.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/iksaveoptions?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct IKSaveOptions;
);

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

impl IKSaveOptions {
    extern_methods!(
        /// Delegate of the IKSaveOptions.
        ///
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// - `delegate` should be of the correct type.
        /// - `delegate` might not allow `None`.
        /// - This is unretained, you must ensure the object is kept alive while in use.
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);

        /// current imageProperties (respecting user UI selection).
        #[unsafe(method(imageProperties))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageProperties(&self) -> Option<Retained<NSDictionary>>;

        /// current imageUTType (respecting user UI selection).
        #[unsafe(method(imageUTType))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageUTType(&self) -> Option<Retained<NSString>>;

        /// information about the UI settings.
        #[unsafe(method(userSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn userSelection(&self) -> Option<Retained<NSDictionary>>;

        /// Initializes IKSaveOptions with metadata and UTType.
        ///
        /// # Safety
        ///
        /// - `image_properties` generic should be of the correct type.
        /// - `image_properties` might not allow `None`.
        /// - `image_ut_type` might not allow `None`.
        #[unsafe(method(initWithImageProperties:imageUTType:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithImageProperties_imageUTType(
            this: Allocated<Self>,
            image_properties: Option<&NSDictionary>,
            image_ut_type: Option<&NSString>,
        ) -> Option<Retained<Self>>;

        /// Adds IKSaveOptions UI to a NSSavePanel.
        ///
        /// # Safety
        ///
        /// `save_panel` might not allow `None`.
        #[unsafe(method(addSaveOptionsAccessoryViewToSavePanel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addSaveOptionsAccessoryViewToSavePanel(
            &self,
            save_panel: Option<&NSSavePanel>,
        );

        /// Adds IKSaveOptions UI to a NSView.
        ///
        /// # Safety
        ///
        /// `view` might not allow `None`.
        #[unsafe(method(addSaveOptionsToView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addSaveOptionsToView(&self, view: Option<&NSView>);

        /// If set, the last used UI choices are preserved for the next time IKSaveOptions is used. [default is YES]
        #[unsafe(method(rememberLastSetting))]
        #[unsafe(method_family = none)]
        pub unsafe fn rememberLastSetting(&self) -> bool;

        /// Setter for [`rememberLastSetting`][Self::rememberLastSetting].
        #[unsafe(method(setRememberLastSetting:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRememberLastSetting(&self, remember_last_setting: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl IKSaveOptions {
    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>;
    );
}