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::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPageControlInteractionState(pub NSInteger);
impl UIPageControlInteractionState {
#[doc(alias = "UIPageControlInteractionStateNone")]
pub const None: Self = Self(0);
#[doc(alias = "UIPageControlInteractionStateDiscrete")]
pub const Discrete: Self = Self(1);
#[doc(alias = "UIPageControlInteractionStateContinuous")]
pub const Continuous: Self = Self(2);
}
unsafe impl Encode for UIPageControlInteractionState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPageControlInteractionState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPageControlBackgroundStyle(pub NSInteger);
impl UIPageControlBackgroundStyle {
#[doc(alias = "UIPageControlBackgroundStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIPageControlBackgroundStyleProminent")]
pub const Prominent: Self = Self(1);
#[doc(alias = "UIPageControlBackgroundStyleMinimal")]
pub const Minimal: Self = Self(2);
}
unsafe impl Encode for UIPageControlBackgroundStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPageControlBackgroundStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPageControlDirection(pub NSInteger);
impl UIPageControlDirection {
#[doc(alias = "UIPageControlDirectionNatural")]
pub const Natural: Self = Self(0);
#[doc(alias = "UIPageControlDirectionLeftToRight")]
pub const LeftToRight: Self = Self(1);
#[doc(alias = "UIPageControlDirectionRightToLeft")]
pub const RightToLeft: Self = Self(2);
#[doc(alias = "UIPageControlDirectionTopToBottom")]
pub const TopToBottom: Self = Self(3);
#[doc(alias = "UIPageControlDirectionBottomToTop")]
pub const BottomToTop: Self = Self(4);
}
unsafe impl Encode for UIPageControlDirection {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPageControlDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
pub struct UIPageControl;
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UIPageControl {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UIPageControl {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIPageControl {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIAppearance for UIPageControl {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIPageControl {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UIPageControl {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UIPageControl {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIPageControl {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusItem for UIPageControl {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UIPageControl {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIPageControl {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIPageControl {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPageControl {
extern_methods!(
#[unsafe(method(numberOfPages))]
#[unsafe(method_family = none)]
pub fn numberOfPages(&self) -> NSInteger;
#[unsafe(method(setNumberOfPages:))]
#[unsafe(method_family = none)]
pub fn setNumberOfPages(&self, number_of_pages: NSInteger);
#[unsafe(method(currentPage))]
#[unsafe(method_family = none)]
pub fn currentPage(&self) -> NSInteger;
#[unsafe(method(setCurrentPage:))]
#[unsafe(method_family = none)]
pub fn setCurrentPage(&self, current_page: NSInteger);
#[unsafe(method(hidesForSinglePage))]
#[unsafe(method_family = none)]
pub fn hidesForSinglePage(&self) -> bool;
#[unsafe(method(setHidesForSinglePage:))]
#[unsafe(method_family = none)]
pub fn setHidesForSinglePage(&self, hides_for_single_page: bool);
#[cfg(feature = "UIPageControlProgress")]
#[unsafe(method(progress))]
#[unsafe(method_family = none)]
pub fn progress(&self) -> Option<Retained<UIPageControlProgress>>;
#[cfg(feature = "UIPageControlProgress")]
#[unsafe(method(setProgress:))]
#[unsafe(method_family = none)]
pub fn setProgress(&self, progress: Option<&UIPageControlProgress>);
#[cfg(feature = "UIColor")]
#[unsafe(method(pageIndicatorTintColor))]
#[unsafe(method_family = none)]
pub fn pageIndicatorTintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setPageIndicatorTintColor:))]
#[unsafe(method_family = none)]
pub fn setPageIndicatorTintColor(&self, page_indicator_tint_color: Option<&UIColor>);
#[cfg(feature = "UIColor")]
#[unsafe(method(currentPageIndicatorTintColor))]
#[unsafe(method_family = none)]
pub fn currentPageIndicatorTintColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
#[unsafe(method(setCurrentPageIndicatorTintColor:))]
#[unsafe(method_family = none)]
pub fn setCurrentPageIndicatorTintColor(
&self,
current_page_indicator_tint_color: Option<&UIColor>,
);
#[unsafe(method(backgroundStyle))]
#[unsafe(method_family = none)]
pub fn backgroundStyle(&self) -> UIPageControlBackgroundStyle;
#[unsafe(method(setBackgroundStyle:))]
#[unsafe(method_family = none)]
pub fn setBackgroundStyle(&self, background_style: UIPageControlBackgroundStyle);
#[unsafe(method(direction))]
#[unsafe(method_family = none)]
pub fn direction(&self) -> UIPageControlDirection;
#[unsafe(method(setDirection:))]
#[unsafe(method_family = none)]
pub fn setDirection(&self, direction: UIPageControlDirection);
#[unsafe(method(interactionState))]
#[unsafe(method_family = none)]
pub fn interactionState(&self) -> UIPageControlInteractionState;
#[unsafe(method(allowsContinuousInteraction))]
#[unsafe(method_family = none)]
pub fn allowsContinuousInteraction(&self) -> bool;
#[unsafe(method(setAllowsContinuousInteraction:))]
#[unsafe(method_family = none)]
pub fn setAllowsContinuousInteraction(&self, allows_continuous_interaction: bool);
#[cfg(feature = "UIImage")]
#[unsafe(method(preferredIndicatorImage))]
#[unsafe(method_family = none)]
pub fn preferredIndicatorImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setPreferredIndicatorImage:))]
#[unsafe(method_family = none)]
pub fn setPreferredIndicatorImage(&self, preferred_indicator_image: Option<&UIImage>);
#[cfg(feature = "UIImage")]
#[unsafe(method(indicatorImageForPage:))]
#[unsafe(method_family = none)]
pub fn indicatorImageForPage(&self, page: NSInteger) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setIndicatorImage:forPage:))]
#[unsafe(method_family = none)]
pub fn setIndicatorImage_forPage(&self, image: Option<&UIImage>, page: NSInteger);
#[cfg(feature = "UIImage")]
#[unsafe(method(preferredCurrentPageIndicatorImage))]
#[unsafe(method_family = none)]
pub fn preferredCurrentPageIndicatorImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setPreferredCurrentPageIndicatorImage:))]
#[unsafe(method_family = none)]
pub fn setPreferredCurrentPageIndicatorImage(
&self,
preferred_current_page_indicator_image: Option<&UIImage>,
);
#[cfg(feature = "UIImage")]
#[unsafe(method(currentPageIndicatorImageForPage:))]
#[unsafe(method_family = none)]
pub fn currentPageIndicatorImageForPage(
&self,
page: NSInteger,
) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
#[unsafe(method(setCurrentPageIndicatorImage:forPage:))]
#[unsafe(method_family = none)]
pub fn setCurrentPageIndicatorImage_forPage(
&self,
image: Option<&UIImage>,
page: NSInteger,
);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(sizeForNumberOfPages:))]
#[unsafe(method_family = none)]
pub fn sizeForNumberOfPages(&self, page_count: NSInteger) -> CGSize;
#[deprecated = "defersCurrentPageDisplay no longer does anything reasonable with the new interaction mode."]
#[unsafe(method(defersCurrentPageDisplay))]
#[unsafe(method_family = none)]
pub fn defersCurrentPageDisplay(&self) -> bool;
#[deprecated = "defersCurrentPageDisplay no longer does anything reasonable with the new interaction mode."]
#[unsafe(method(setDefersCurrentPageDisplay:))]
#[unsafe(method_family = none)]
pub fn setDefersCurrentPageDisplay(&self, defers_current_page_display: bool);
#[deprecated = "updateCurrentPageDisplay no longer does anything reasonable with the new interaction mode."]
#[unsafe(method(updateCurrentPageDisplay))]
#[unsafe(method_family = none)]
pub fn updateCurrentPageDisplay(&self);
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPageControl {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub 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(all(
feature = "UIAction",
feature = "UIMenuElement",
feature = "objc2-core-foundation"
))]
#[unsafe(method(initWithFrame:primaryAction:))]
#[unsafe(method_family = init)]
pub fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPageControl {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPageControl {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}