//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpdfscanner?language=objc)
#[repr(C)]
#[derive(Debug)]
pub struct CGPDFScanner {
    inner: [u8; 0],
    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for CGPDFScanner {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("CGPDFScanner", &[]));
}

/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpdfscannerref?language=objc)
pub type CGPDFScannerRef = *mut CGPDFScanner;

impl CGPDFScanner {
    /// # Safety
    ///
    /// - `cs` must be a valid pointer.
    /// - `table` must be a valid pointer or null.
    /// - `info` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerCreate")]
    #[cfg(all(feature = "CGPDFContentStream", feature = "CGPDFOperatorTable"))]
    #[inline]
    pub unsafe fn create(
        cs: CGPDFContentStreamRef,
        table: CGPDFOperatorTableRef,
        info: *mut c_void,
    ) -> CGPDFScannerRef {
        extern "C-unwind" {
            fn CGPDFScannerCreate(
                cs: CGPDFContentStreamRef,
                table: CGPDFOperatorTableRef,
                info: *mut c_void,
            ) -> CGPDFScannerRef;
        }
        unsafe { CGPDFScannerCreate(cs, table, info) }
    }

    /// # Safety
    ///
    /// `scanner` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerRetain")]
    #[inline]
    pub unsafe fn retain(scanner: CGPDFScannerRef) -> CGPDFScannerRef {
        extern "C-unwind" {
            fn CGPDFScannerRetain(scanner: CGPDFScannerRef) -> CGPDFScannerRef;
        }
        unsafe { CGPDFScannerRetain(scanner) }
    }

    /// # Safety
    ///
    /// `scanner` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerRelease")]
    #[inline]
    pub unsafe fn release(scanner: CGPDFScannerRef) {
        extern "C-unwind" {
            fn CGPDFScannerRelease(scanner: CGPDFScannerRef);
        }
        unsafe { CGPDFScannerRelease(scanner) }
    }

    /// # Safety
    ///
    /// `scanner` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerScan")]
    #[inline]
    pub unsafe fn scan(scanner: CGPDFScannerRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerScan(scanner: CGPDFScannerRef) -> bool;
        }
        unsafe { CGPDFScannerScan(scanner) }
    }

    /// # Safety
    ///
    /// `scanner` must be a valid pointer.
    #[doc(alias = "CGPDFScannerGetContentStream")]
    #[cfg(feature = "CGPDFContentStream")]
    #[inline]
    pub unsafe fn content_stream(scanner: CGPDFScannerRef) -> CGPDFContentStreamRef {
        extern "C-unwind" {
            fn CGPDFScannerGetContentStream(scanner: CGPDFScannerRef) -> CGPDFContentStreamRef;
        }
        unsafe { CGPDFScannerGetContentStream(scanner) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopObject")]
    #[cfg(feature = "CGPDFObject")]
    #[inline]
    pub unsafe fn pop_object(scanner: CGPDFScannerRef, value: *mut CGPDFObjectRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopObject(scanner: CGPDFScannerRef, value: *mut CGPDFObjectRef) -> bool;
        }
        unsafe { CGPDFScannerPopObject(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopBoolean")]
    #[cfg(feature = "CGPDFObject")]
    #[inline]
    pub unsafe fn pop_boolean(scanner: CGPDFScannerRef, value: *mut CGPDFBoolean) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopBoolean(scanner: CGPDFScannerRef, value: *mut CGPDFBoolean) -> bool;
        }
        unsafe { CGPDFScannerPopBoolean(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopInteger")]
    #[cfg(feature = "CGPDFObject")]
    #[inline]
    pub unsafe fn pop_integer(scanner: CGPDFScannerRef, value: *mut CGPDFInteger) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopInteger(scanner: CGPDFScannerRef, value: *mut CGPDFInteger) -> bool;
        }
        unsafe { CGPDFScannerPopInteger(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopNumber")]
    #[cfg(feature = "CGPDFObject")]
    #[inline]
    pub unsafe fn pop_number(scanner: CGPDFScannerRef, value: *mut CGPDFReal) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopNumber(scanner: CGPDFScannerRef, value: *mut CGPDFReal) -> bool;
        }
        unsafe { CGPDFScannerPopNumber(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopName")]
    #[inline]
    pub unsafe fn pop_name(scanner: CGPDFScannerRef, value: *mut *const c_char) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopName(scanner: CGPDFScannerRef, value: *mut *const c_char) -> bool;
        }
        unsafe { CGPDFScannerPopName(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopString")]
    #[cfg(feature = "CGPDFString")]
    #[inline]
    pub unsafe fn pop_string(scanner: CGPDFScannerRef, value: *mut CGPDFStringRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopString(scanner: CGPDFScannerRef, value: *mut CGPDFStringRef) -> bool;
        }
        unsafe { CGPDFScannerPopString(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopArray")]
    #[cfg(feature = "CGPDFArray")]
    #[inline]
    pub unsafe fn pop_array(scanner: CGPDFScannerRef, value: *mut CGPDFArrayRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopArray(scanner: CGPDFScannerRef, value: *mut CGPDFArrayRef) -> bool;
        }
        unsafe { CGPDFScannerPopArray(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopDictionary")]
    #[cfg(feature = "CGPDFDictionary")]
    #[inline]
    pub unsafe fn pop_dictionary(scanner: CGPDFScannerRef, value: *mut CGPDFDictionaryRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopDictionary(
                scanner: CGPDFScannerRef,
                value: *mut CGPDFDictionaryRef,
            ) -> bool;
        }
        unsafe { CGPDFScannerPopDictionary(scanner, value) }
    }

    /// # Safety
    ///
    /// - `scanner` must be a valid pointer.
    /// - `value` must be a valid pointer or null.
    #[doc(alias = "CGPDFScannerPopStream")]
    #[cfg(feature = "CGPDFStream")]
    #[inline]
    pub unsafe fn pop_stream(scanner: CGPDFScannerRef, value: *mut CGPDFStreamRef) -> bool {
        extern "C-unwind" {
            fn CGPDFScannerPopStream(scanner: CGPDFScannerRef, value: *mut CGPDFStreamRef) -> bool;
        }
        unsafe { CGPDFScannerPopStream(scanner, value) }
    }

    /// # Safety
    ///
    /// `s` must be a valid pointer.
    #[doc(alias = "CGPDFScannerStop")]
    #[inline]
    pub unsafe fn stop(s: CGPDFScannerRef) {
        extern "C-unwind" {
            fn CGPDFScannerStop(s: CGPDFScannerRef);
        }
        unsafe { CGPDFScannerStop(s) }
    }
}

extern "C-unwind" {
    #[cfg(all(feature = "CGPDFContentStream", feature = "CGPDFOperatorTable"))]
    #[deprecated = "renamed to `CGPDFScanner::create`"]
    pub fn CGPDFScannerCreate(
        cs: CGPDFContentStreamRef,
        table: CGPDFOperatorTableRef,
        info: *mut c_void,
    ) -> CGPDFScannerRef;
}

extern "C-unwind" {
    #[deprecated = "renamed to `CGPDFScanner::retain`"]
    pub fn CGPDFScannerRetain(scanner: CGPDFScannerRef) -> CGPDFScannerRef;
}

extern "C-unwind" {
    #[deprecated = "renamed to `CGPDFScanner::release`"]
    pub fn CGPDFScannerRelease(scanner: CGPDFScannerRef);
}

extern "C-unwind" {
    #[deprecated = "renamed to `CGPDFScanner::scan`"]
    pub fn CGPDFScannerScan(scanner: CGPDFScannerRef) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFContentStream")]
    #[deprecated = "renamed to `CGPDFScanner::content_stream`"]
    pub fn CGPDFScannerGetContentStream(scanner: CGPDFScannerRef) -> CGPDFContentStreamRef;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFObject")]
    #[deprecated = "renamed to `CGPDFScanner::pop_object`"]
    pub fn CGPDFScannerPopObject(scanner: CGPDFScannerRef, value: *mut CGPDFObjectRef) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFObject")]
    #[deprecated = "renamed to `CGPDFScanner::pop_boolean`"]
    pub fn CGPDFScannerPopBoolean(scanner: CGPDFScannerRef, value: *mut CGPDFBoolean) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFObject")]
    #[deprecated = "renamed to `CGPDFScanner::pop_integer`"]
    pub fn CGPDFScannerPopInteger(scanner: CGPDFScannerRef, value: *mut CGPDFInteger) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFObject")]
    #[deprecated = "renamed to `CGPDFScanner::pop_number`"]
    pub fn CGPDFScannerPopNumber(scanner: CGPDFScannerRef, value: *mut CGPDFReal) -> bool;
}

extern "C-unwind" {
    #[deprecated = "renamed to `CGPDFScanner::pop_name`"]
    pub fn CGPDFScannerPopName(scanner: CGPDFScannerRef, value: *mut *const c_char) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFString")]
    #[deprecated = "renamed to `CGPDFScanner::pop_string`"]
    pub fn CGPDFScannerPopString(scanner: CGPDFScannerRef, value: *mut CGPDFStringRef) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFArray")]
    #[deprecated = "renamed to `CGPDFScanner::pop_array`"]
    pub fn CGPDFScannerPopArray(scanner: CGPDFScannerRef, value: *mut CGPDFArrayRef) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFDictionary")]
    #[deprecated = "renamed to `CGPDFScanner::pop_dictionary`"]
    pub fn CGPDFScannerPopDictionary(
        scanner: CGPDFScannerRef,
        value: *mut CGPDFDictionaryRef,
    ) -> bool;
}

extern "C-unwind" {
    #[cfg(feature = "CGPDFStream")]
    #[deprecated = "renamed to `CGPDFScanner::pop_stream`"]
    pub fn CGPDFScannerPopStream(scanner: CGPDFScannerRef, value: *mut CGPDFStreamRef) -> bool;
}

extern "C-unwind" {
    #[deprecated = "renamed to `CGPDFScanner::stop`"]
    pub fn CGPDFScannerStop(s: CGPDFScannerRef);
}
