use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLLocationButtonIcon(pub NSInteger);
impl CLLocationButtonIcon {
#[doc(alias = "CLLocationButtonIconNone")]
pub const None: Self = Self(0);
#[doc(alias = "CLLocationButtonIconArrowFilled")]
pub const ArrowFilled: Self = Self(1);
#[doc(alias = "CLLocationButtonIconArrowOutline")]
pub const ArrowOutline: Self = Self(2);
}
unsafe impl Encode for CLLocationButtonIcon {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CLLocationButtonIcon {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLLocationButtonLabel(pub NSInteger);
impl CLLocationButtonLabel {
#[doc(alias = "CLLocationButtonLabelNone")]
pub const None: Self = Self(0);
#[doc(alias = "CLLocationButtonLabelCurrentLocation")]
pub const CurrentLocation: Self = Self(1);
#[doc(alias = "CLLocationButtonLabelSendCurrentLocation")]
pub const SendCurrentLocation: Self = Self(2);
#[doc(alias = "CLLocationButtonLabelSendMyCurrentLocation")]
pub const SendMyCurrentLocation: Self = Self(3);
#[doc(alias = "CLLocationButtonLabelShareCurrentLocation")]
pub const ShareCurrentLocation: Self = Self(4);
#[doc(alias = "CLLocationButtonLabelShareMyCurrentLocation")]
pub const ShareMyCurrentLocation: Self = Self(5);
}
unsafe impl Encode for CLLocationButtonLabel {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CLLocationButtonLabel {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-ui-kit")]
pub struct CLLocationButton;
);
#[cfg(all(feature = "objc2-quartz-core", feature = "objc2-ui-kit"))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl NSCoding for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl NSObjectProtocol for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl NSSecureCoding for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIAppearance for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIAppearanceContainer for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UICoordinateSpace for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIDynamicItem for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIFocusEnvironment for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIFocusItem for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIFocusItemContainer for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
unsafe impl UITraitEnvironment for CLLocationButton {}
);
#[cfg(feature = "objc2-ui-kit")]
impl CLLocationButton {
extern_methods!(
#[unsafe(method(icon))]
#[unsafe(method_family = none)]
pub unsafe fn icon(&self) -> CLLocationButtonIcon;
#[unsafe(method(setIcon:))]
#[unsafe(method_family = none)]
pub unsafe fn setIcon(&self, icon: CLLocationButtonIcon);
#[unsafe(method(label))]
#[unsafe(method_family = none)]
pub unsafe fn label(&self) -> CLLocationButtonLabel;
#[unsafe(method(setLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn setLabel(&self, label: CLLocationButtonLabel);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(fontSize))]
#[unsafe(method_family = none)]
pub unsafe fn fontSize(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setFontSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setFontSize(&self, font_size: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(cornerRadius))]
#[unsafe(method_family = none)]
pub unsafe fn cornerRadius(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setCornerRadius:))]
#[unsafe(method_family = none)]
pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
);
}
#[cfg(feature = "objc2-ui-kit")]
impl CLLocationButton {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:primaryAction:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-ui-kit")]
impl CLLocationButton {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-ui-kit")]
impl CLLocationButton {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}