objc2-map-kit 0.3.2

Bindings to the MapKit 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::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkoverlaypathrenderer?language=objc)
    #[unsafe(super(MKOverlayRenderer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MKOverlayRenderer")]
    pub struct MKOverlayPathRenderer;
);

#[cfg(feature = "MKOverlayRenderer")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MKOverlayPathRenderer {}
);

#[cfg(feature = "MKOverlayRenderer")]
impl MKOverlayPathRenderer {
    extern_methods!(
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(fillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn fillColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// Setter for [`fillColor`][Self::fillColor].
        #[unsafe(method(setFillColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFillColor(&self, fill_color: Option<&NSColor>);

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(strokeColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn strokeColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// Setter for [`strokeColor`][Self::strokeColor].
        #[unsafe(method(setStrokeColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStrokeColor(&self, stroke_color: Option<&NSColor>);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(lineWidth))]
        #[unsafe(method_family = none)]
        pub unsafe fn lineWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`lineWidth`][Self::lineWidth].
        #[unsafe(method(setLineWidth:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLineWidth(&self, line_width: CGFloat);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(lineJoin))]
        #[unsafe(method_family = none)]
        pub unsafe fn lineJoin(&self) -> CGLineJoin;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`lineJoin`][Self::lineJoin].
        #[unsafe(method(setLineJoin:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLineJoin(&self, line_join: CGLineJoin);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(lineCap))]
        #[unsafe(method_family = none)]
        pub unsafe fn lineCap(&self) -> CGLineCap;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`lineCap`][Self::lineCap].
        #[unsafe(method(setLineCap:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLineCap(&self, line_cap: CGLineCap);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(miterLimit))]
        #[unsafe(method_family = none)]
        pub unsafe fn miterLimit(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`miterLimit`][Self::miterLimit].
        #[unsafe(method(setMiterLimit:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMiterLimit(&self, miter_limit: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(lineDashPhase))]
        #[unsafe(method_family = none)]
        pub unsafe fn lineDashPhase(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`lineDashPhase`][Self::lineDashPhase].
        #[unsafe(method(setLineDashPhase:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLineDashPhase(&self, line_dash_phase: CGFloat);

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

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

        #[unsafe(method(shouldRasterize))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldRasterize(&self) -> bool;

        /// Setter for [`shouldRasterize`][Self::shouldRasterize].
        #[unsafe(method(setShouldRasterize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldRasterize(&self, should_rasterize: bool);

        #[unsafe(method(createPath))]
        #[unsafe(method_family = none)]
        pub unsafe fn createPath(&self);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(path))]
        #[unsafe(method_family = none)]
        pub unsafe fn path(&self) -> Option<Retained<CGPath>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`path`][Self::path].
        ///
        /// # Safety
        ///
        /// `path` might not allow `None`.
        #[unsafe(method(setPath:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPath(&self, path: Option<&CGPath>);

        #[unsafe(method(invalidatePath))]
        #[unsafe(method_family = none)]
        pub unsafe fn invalidatePath(&self);

        #[cfg(all(
            feature = "MKGeometry",
            feature = "objc2-core-foundation",
            feature = "objc2-core-graphics"
        ))]
        #[unsafe(method(applyStrokePropertiesToContext:atZoomScale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyStrokePropertiesToContext_atZoomScale(
            &self,
            context: &CGContext,
            zoom_scale: MKZoomScale,
        );

        #[cfg(all(
            feature = "MKGeometry",
            feature = "objc2-core-foundation",
            feature = "objc2-core-graphics"
        ))]
        #[unsafe(method(applyFillPropertiesToContext:atZoomScale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyFillPropertiesToContext_atZoomScale(
            &self,
            context: &CGContext,
            zoom_scale: MKZoomScale,
        );

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(strokePath:inContext:))]
        #[unsafe(method_family = none)]
        pub unsafe fn strokePath_inContext(&self, path: &CGPath, context: &CGContext);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(fillPath:inContext:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fillPath_inContext(&self, path: &CGPath, context: &CGContext);
    );
}

/// Methods declared on superclass `MKOverlayRenderer`.
#[cfg(feature = "MKOverlayRenderer")]
impl MKOverlayPathRenderer {
    extern_methods!(
        #[cfg(all(feature = "MKAnnotation", feature = "MKOverlay"))]
        #[unsafe(method(initWithOverlay:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithOverlay(
            this: Allocated<Self>,
            overlay: &ProtocolObject<dyn MKOverlay>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "MKOverlayRenderer")]
impl MKOverlayPathRenderer {
    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>;
    );
}