use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MKTileOverlay;
);
#[cfg(feature = "MKAnnotation")]
extern_conformance!(
unsafe impl MKAnnotation for MKTileOverlay {}
);
#[cfg(all(feature = "MKAnnotation", feature = "MKOverlay"))]
extern_conformance!(
unsafe impl MKOverlay for MKTileOverlay {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MKTileOverlay {}
);
impl MKTileOverlay {
extern_methods!(
#[unsafe(method(initWithURLTemplate:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithURLTemplate(
this: Allocated<Self>,
url_template: Option<&NSString>,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(tileSize))]
#[unsafe(method_family = none)]
pub unsafe fn tileSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setTileSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setTileSize(&self, tile_size: CGSize);
#[unsafe(method(isGeometryFlipped))]
#[unsafe(method_family = none)]
pub unsafe fn isGeometryFlipped(&self) -> bool;
#[unsafe(method(setGeometryFlipped:))]
#[unsafe(method_family = none)]
pub unsafe fn setGeometryFlipped(&self, geometry_flipped: bool);
#[unsafe(method(minimumZ))]
#[unsafe(method_family = none)]
pub unsafe fn minimumZ(&self) -> NSInteger;
#[unsafe(method(setMinimumZ:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumZ(&self, minimum_z: NSInteger);
#[unsafe(method(maximumZ))]
#[unsafe(method_family = none)]
pub unsafe fn maximumZ(&self) -> NSInteger;
#[unsafe(method(setMaximumZ:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumZ(&self, maximum_z: NSInteger);
#[unsafe(method(URLTemplate))]
#[unsafe(method_family = none)]
pub unsafe fn URLTemplate(&self) -> Option<Retained<NSString>>;
#[unsafe(method(canReplaceMapContent))]
#[unsafe(method_family = none)]
pub unsafe fn canReplaceMapContent(&self) -> bool;
#[unsafe(method(setCanReplaceMapContent:))]
#[unsafe(method_family = none)]
pub unsafe fn setCanReplaceMapContent(&self, can_replace_map_content: bool);
);
}
impl MKTileOverlay {
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>;
);
}
#[cfg(feature = "objc2-core-foundation")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MKTileOverlayPath {
pub x: NSInteger,
pub y: NSInteger,
pub z: NSInteger,
pub contentScaleFactor: CGFloat,
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Encode for MKTileOverlayPath {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<NSInteger>::ENCODING,
<NSInteger>::ENCODING,
<NSInteger>::ENCODING,
<CGFloat>::ENCODING,
],
);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl RefEncode for MKTileOverlayPath {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl MKTileOverlay {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(URLForTilePath:))]
#[unsafe(method_family = none)]
pub unsafe fn URLForTilePath(&self, path: MKTileOverlayPath) -> Retained<NSURL>;
#[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
#[unsafe(method(loadTileAtPath:result:))]
#[unsafe(method_family = none)]
pub unsafe fn loadTileAtPath_result(
&self,
path: MKTileOverlayPath,
result: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
);
);
}