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

use crate::*;

extern_protocol!(
    /// The data source of IKSlideshow must conform to IKSlideshowDataSource protocol.
    ///
    /// The data source methods may be called one a non-main thread.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshowdatasource?language=objc)
    pub unsafe trait IKSlideshowDataSource {
        /// return number of items in Slideshow.
        #[unsafe(method(numberOfSlideshowItems))]
        #[unsafe(method_family = none)]
        unsafe fn numberOfSlideshowItems(&self) -> NSUInteger;

        /// return the item for a given index.
        ///
        /// The item can be either: NSImage, NSString, NSURL, CGImageRef, or PDFPage.
        /// Note: when using 'IKSlideshowModeOther' as slideshowMode, the item has to be a NSURL.
        #[unsafe(method(slideshowItemAtIndex:))]
        #[unsafe(method_family = none)]
        unsafe fn slideshowItemAtIndex(&self, index: NSUInteger) -> Option<Retained<AnyObject>>;

        /// Display name for item at index.
        #[optional]
        #[unsafe(method(nameOfSlideshowItemAtIndex:))]
        #[unsafe(method_family = none)]
        unsafe fn nameOfSlideshowItemAtIndex(
            &self,
            index: NSUInteger,
        ) -> Option<Retained<NSString>>;

        /// should the export button be enabled for a given item at index?
        ///
        /// # Safety
        ///
        /// `application_bundle_identifier` might not allow `None`.
        #[optional]
        #[unsafe(method(canExportSlideshowItemAtIndex:toApplication:))]
        #[unsafe(method_family = none)]
        unsafe fn canExportSlideshowItemAtIndex_toApplication(
            &self,
            index: NSUInteger,
            application_bundle_identifier: Option<&NSString>,
        ) -> bool;

        /// Slideshow will start.
        #[optional]
        #[unsafe(method(slideshowWillStart))]
        #[unsafe(method_family = none)]
        unsafe fn slideshowWillStart(&self);

        /// Slideshow did stop.
        #[optional]
        #[unsafe(method(slideshowDidStop))]
        #[unsafe(method_family = none)]
        unsafe fn slideshowDidStop(&self);

        /// Slideshow did change current item index.
        #[optional]
        #[unsafe(method(slideshowDidChangeCurrentIndex:))]
        #[unsafe(method_family = none)]
        unsafe fn slideshowDidChangeCurrentIndex(&self, new_index: NSUInteger);
    }
);

extern_class!(
    /// IKSlideshow handles a slideshow with images, PDFs
    /// &
    /// more.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikslideshow?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct IKSlideshow;
);

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

impl IKSlideshow {
    extern_methods!(
        /// Array of filters reflecting the current user adjustments in the adjust or effects tab.
        #[unsafe(method(autoPlayDelay))]
        #[unsafe(method_family = none)]
        pub unsafe fn autoPlayDelay(&self) -> NSTimeInterval;

        /// Setter for [`autoPlayDelay`][Self::autoPlayDelay].
        #[unsafe(method(setAutoPlayDelay:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAutoPlayDelay(&self, auto_play_delay: NSTimeInterval);

        /// shared instance of the IKSlideshow.
        #[unsafe(method(sharedSlideshow))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedSlideshow() -> Option<Retained<IKSlideshow>>;

        /// start the slideshow (slideshowOptions can be NULL).
        ///
        /// # Safety
        ///
        /// - `data_source` might not allow `None`.
        /// - `slideshow_mode` might not allow `None`.
        /// - `slideshow_options` generic should be of the correct type.
        /// - `slideshow_options` might not allow `None`.
        #[unsafe(method(runSlideshowWithDataSource:inMode:options:))]
        #[unsafe(method_family = none)]
        pub unsafe fn runSlideshowWithDataSource_inMode_options(
            &self,
            data_source: Option<&ProtocolObject<dyn IKSlideshowDataSource>>,
            slideshow_mode: Option<&NSString>,
            slideshow_options: Option<&NSDictionary>,
        );

        /// stop the slideshow.
        ///
        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[unsafe(method(stopSlideshow:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopSlideshow(&self, sender: Option<&AnyObject>);

        /// reloadData.
        #[unsafe(method(reloadData))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadData(&self);

        /// reloadSlideshowItemAtIndex.
        #[unsafe(method(reloadSlideshowItemAtIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadSlideshowItemAtIndex(&self, index: NSUInteger);

        /// Returns index of current slideshow item.
        #[unsafe(method(indexOfCurrentSlideshowItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn indexOfCurrentSlideshowItem(&self) -> NSUInteger;

        /// Is exporting to a given application possible (application installed?, right version?, ...).
        ///
        /// # Safety
        ///
        /// `application_bundle_identifier` might not allow `None`.
        #[unsafe(method(canExportToApplication:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canExportToApplication(
            application_bundle_identifier: Option<&NSString>,
        ) -> bool;

        /// export an item to the given application.
        ///
        /// The item can be either: NSImage, NSString, NSURL, or a NSArray of NSImage / NSString / NSURL.
        ///
        /// # Safety
        ///
        /// - `item` should be of the correct type.
        /// - `item` might not allow `None`.
        /// - `application_bundle_identifier` might not allow `None`.
        #[unsafe(method(exportSlideshowItem:toApplication:))]
        #[unsafe(method_family = none)]
        pub unsafe fn exportSlideshowItem_toApplication(
            item: Option<&AnyObject>,
            application_bundle_identifier: Option<&NSString>,
        );
    );
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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