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::*;

extern_class!(
    /// An IKPictureTaker object is a panel that allows users to choose and crop an image. It supports browsing of the file system and includes a recents popup-menu. The IKPictureTaker lets the user to crop a choosen image or to take snapshot from a camera like the built-in iSight.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetaker?language=objc)
    #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct IKPictureTaker;
);

extern_conformance!(
    unsafe impl NSAccessibility for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSAppearanceCustomization for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSCoding for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSMenuItemValidation for IKPictureTaker {}
);

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

extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for IKPictureTaker {}
);

extern_conformance!(
    unsafe impl NSUserInterfaceValidations for IKPictureTaker {}
);

impl IKPictureTaker {
    extern_methods!(
        /// Returns the shared IKPictureTaker instance, creating it if necessary.
        #[unsafe(method(pictureTaker))]
        #[unsafe(method_family = none)]
        pub unsafe fn pictureTaker(mtm: MainThreadMarker) -> Option<Retained<IKPictureTaker>>;

        /// Launches a modal PictureTaker session.
        ///
        /// Returns: Returns NSOKButton if the user edits or chooses an image and confirm panel, NSCancelButton if the user canceled or didn't change the image.
        #[unsafe(method(runModal))]
        #[unsafe(method_family = none)]
        pub unsafe fn runModal(&self) -> NSInteger;

        /// Launch the PictureTaker.
        ///
        /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates.
        ///
        /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates.
        ///
        /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended.
        ///
        /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void  *)contextInfo;
        /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
        ///
        /// # Safety
        ///
        /// - `delegate` should be of the correct type.
        /// - `delegate` might not allow `None`.
        /// - `did_end_selector` must be a valid selector.
        /// - `context_info` must be a valid pointer.
        #[unsafe(method(beginPictureTakerWithDelegate:didEndSelector:contextInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn beginPictureTakerWithDelegate_didEndSelector_contextInfo(
            &self,
            delegate: Option<&AnyObject>,
            did_end_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        /// Launch the PictureTaker as a sheet for aWindow
        ///
        /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates
        ///
        /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates
        ///
        /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended
        ///
        /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void  *)contextInfo;
        /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
        ///
        /// # Safety
        ///
        /// - `a_window` might not allow `None`.
        /// - `delegate` should be of the correct type.
        /// - `delegate` might not allow `None`.
        /// - `did_end_selector` must be a valid selector.
        /// - `context_info` must be a valid pointer.
        #[unsafe(method(beginPictureTakerSheetForWindow:withDelegate:didEndSelector:contextInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn beginPictureTakerSheetForWindow_withDelegate_didEndSelector_contextInfo(
            &self,
            a_window: Option<&NSWindow>,
            delegate: Option<&AnyObject>,
            did_end_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        /// Launch the PictureTaker's recent popup.
        ///
        /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates.
        ///
        /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates.
        ///
        /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended.
        ///
        /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void  *)contextInfo;
        /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
        ///
        /// # Safety
        ///
        /// - `a_view` might not allow `None`.
        /// - `delegate` should be of the correct type.
        /// - `delegate` might not allow `None`.
        /// - `did_end_selector` must be a valid selector.
        /// - `context_info` must be a valid pointer.
        #[unsafe(method(popUpRecentsMenuForView:withDelegate:didEndSelector:contextInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn popUpRecentsMenuForView_withDelegate_didEndSelector_contextInfo(
            &self,
            a_view: Option<&NSView>,
            delegate: Option<&AnyObject>,
            did_end_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        /// Set the image input for the PictureTaker.
        ///
        /// Parameter `image`: A valid NSImage.
        ///
        /// The input image is never modified by the PictureTaker.
        ///
        /// # Safety
        ///
        /// `image` might not allow `None`.
        #[unsafe(method(setInputImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInputImage(&self, image: Option<&NSImage>);

        /// return the original PictureTaker's input-image.
        ///
        /// The input image is never modified by the PictureTaker.
        #[unsafe(method(inputImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputImage(&self) -> Option<Retained<NSImage>>;

        /// return the edited image.
        #[unsafe(method(outputImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn outputImage(&self) -> Option<Retained<NSImage>>;

        /// Controls whether the receiver enable/disable video mirroring durring snapshots (default is YES).
        #[unsafe(method(setMirroring:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMirroring(&self, b: bool);

        /// Returns YES if video mirroring is enabled, NO otherwise.
        #[unsafe(method(mirroring))]
        #[unsafe(method_family = none)]
        pub unsafe fn mirroring(&self) -> bool;
    );
}

/// Methods declared on superclass `NSWindow`.
impl IKPictureTaker {
    extern_methods!(
        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
        ) -> Retained<Self>;

        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
            screen: Option<&NSScreen>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

        /// Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
        #[unsafe(method(windowWithContentViewController:))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowWithContentViewController(
            content_view_controller: &NSViewController,
        ) -> Retained<Self>;
    );
}

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

/// Methods declared on superclass `NSObject`.
impl IKPictureTaker {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowsvideocapturekey?language=objc)
    pub static IKPictureTakerAllowsVideoCaptureKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowsfilechoosingkey?language=objc)
    pub static IKPictureTakerAllowsFileChoosingKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowrecentpicturekey?language=objc)
    pub static IKPictureTakerShowRecentPictureKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerupdaterecentpicturekey?language=objc)
    pub static IKPictureTakerUpdateRecentPictureKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowseditingkey?language=objc)
    pub static IKPictureTakerAllowsEditingKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershoweffectskey?language=objc)
    pub static IKPictureTakerShowEffectsKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerinformationaltextkey?language=objc)
    pub static IKPictureTakerInformationalTextKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerimagetransformskey?language=objc)
    pub static IKPictureTakerImageTransformsKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakeroutputimagemaxsizekey?language=objc)
    pub static IKPictureTakerOutputImageMaxSizeKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowaddressbookpicturekey?language=objc)
    pub static IKPictureTakerShowAddressBookPictureKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowemptypicturekey?language=objc)
    pub static IKPictureTakerShowEmptyPictureKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerremainopenaftervalidatekey?language=objc)
    pub static IKPictureTakerRemainOpenAfterValidateKey: Option<&'static NSString>;
}