objc2-ui-kit 0.2.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    pub unsafe trait UIPageControlProgressDelegate: NSObjectProtocol {
        #[optional]
        #[method(pageControlProgress:initialProgressForPage:)]
        unsafe fn pageControlProgress_initialProgressForPage(
            &self,
            progress: &UIPageControlProgress,
            page: NSInteger,
        ) -> c_float;

        #[optional]
        #[method(pageControlProgressVisibilityDidChange:)]
        unsafe fn pageControlProgressVisibilityDidChange(&self, progress: &UIPageControlProgress);
    }

    unsafe impl ProtocolType for dyn UIPageControlProgressDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIPageControlProgress;

    unsafe impl ClassType for UIPageControlProgress {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for UIPageControlProgress {}

extern_methods!(
    unsafe impl UIPageControlProgress {
        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIPageControlProgressDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UIPageControlProgressDelegate>>,
        );

        #[method(currentProgress)]
        pub unsafe fn currentProgress(&self) -> c_float;

        #[method(setCurrentProgress:)]
        pub unsafe fn setCurrentProgress(&self, current_progress: c_float);

        #[method(isProgressVisible)]
        pub unsafe fn isProgressVisible(&self) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIPageControlProgress {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_protocol!(
    pub unsafe trait UIPageControlTimerProgressDelegate:
        UIPageControlProgressDelegate
    {
        #[optional]
        #[method(pageControlTimerProgressDidChange:)]
        unsafe fn pageControlTimerProgressDidChange(&self, progress: &UIPageControlTimerProgress);

        #[optional]
        #[method(pageControlTimerProgress:shouldAdvanceToPage:)]
        unsafe fn pageControlTimerProgress_shouldAdvanceToPage(
            &self,
            progress: &UIPageControlTimerProgress,
            page: NSInteger,
        ) -> bool;
    }

    unsafe impl ProtocolType for dyn UIPageControlTimerProgressDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIPageControlTimerProgress;

    unsafe impl ClassType for UIPageControlTimerProgress {
        #[inherits(NSObject)]
        type Super = UIPageControlProgress;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for UIPageControlTimerProgress {}

extern_methods!(
    unsafe impl UIPageControlTimerProgress {
        #[method_id(@__retain_semantics Init initWithPreferredDuration:)]
        pub unsafe fn initWithPreferredDuration(
            this: Allocated<Self>,
            preferred_duration: NSTimeInterval,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIPageControlTimerProgressDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UIPageControlTimerProgressDelegate>>,
        );

        #[method(resetsToInitialPageAfterEnd)]
        pub unsafe fn resetsToInitialPageAfterEnd(&self) -> bool;

        #[method(setResetsToInitialPageAfterEnd:)]
        pub unsafe fn setResetsToInitialPageAfterEnd(&self, resets_to_initial_page_after_end: bool);

        #[method(isRunning)]
        pub unsafe fn isRunning(&self) -> bool;

        #[method(resumeTimer)]
        pub unsafe fn resumeTimer(&self);

        #[method(pauseTimer)]
        pub unsafe fn pauseTimer(&self);

        #[method(preferredDuration)]
        pub unsafe fn preferredDuration(&self) -> NSTimeInterval;

        #[method(setPreferredDuration:)]
        pub unsafe fn setPreferredDuration(&self, preferred_duration: NSTimeInterval);

        #[method(setDuration:forPage:)]
        pub unsafe fn setDuration_forPage(&self, duration: NSTimeInterval, page: NSInteger);

        #[method(durationForPage:)]
        pub unsafe fn durationForPage(&self, page: NSInteger) -> NSTimeInterval;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);