Trait GCSwitchPositionInput

Source
pub unsafe trait GCSwitchPositionInput: NSObjectProtocol {
    // Provided methods
    unsafe fn positionDidChangeHandler(
        &self,
    ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCSwitchPositionInput>>, NSInteger)>
       where Self: Sized + Message { ... }
    unsafe fn setPositionDidChangeHandler(
        &self,
        position_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCSwitchPositionInput>>, NSInteger)>>,
    )
       where Self: Sized + Message { ... }
    unsafe fn position(&self) -> NSInteger
       where Self: Sized + Message { ... }
    unsafe fn positionRange(&self) -> NSRange
       where Self: Sized + Message { ... }
    unsafe fn isSequential(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn canWrap(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn lastPositionTimestamp(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn lastPositionLatency(&self) -> NSTimeInterval
       where Self: Sized + Message { ... }
    unsafe fn sources(
        &self,
    ) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
       where Self: Sized + Message { ... }
}
Available on crate feature GCSwitchPositionInput only.
Expand description

Provided Methods§

Source

unsafe fn positionDidChangeHandler( &self, ) -> *mut DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCSwitchPositionInput>>, NSInteger)>
where Self: Sized + Message,

Available on crate features GCPhysicalInputElement and block2 only.

Set this block if you want to be notified when the value on the switch changes.

Parameter input: the element that has been modified.

See: value

Source

unsafe fn setPositionDidChangeHandler( &self, position_did_change_handler: Option<&DynBlock<dyn Fn(NonNull<ProtocolObject<dyn GCPhysicalInputElement>>, NonNull<ProtocolObject<dyn GCSwitchPositionInput>>, NSInteger)>>, )
where Self: Sized + Message,

Available on crate features GCPhysicalInputElement and block2 only.
Source

unsafe fn position(&self) -> NSInteger
where Self: Sized + Message,

The switch’s position.

See: valueDidChangeHandler

Source

unsafe fn positionRange(&self) -> NSRange
where Self: Sized + Message,

The (inclusive) bounds of possible position values for the switch.

Source

unsafe fn isSequential(&self) -> bool
where Self: Sized + Message,

YESif the switch input can only transition to positions that are adjacent to the current position.

Source

unsafe fn canWrap(&self) -> bool
where Self: Sized + Message,

Check if the position input value can “roll over” when reaching either of its bounds.

This will always be YESfor non-sequential switch inputs.

Source

unsafe fn lastPositionTimestamp(&self) -> NSTimeInterval
where Self: Sized + Message,

The timestamp of the last value.

This time interval is not relative to any specific point in time. You can subtract a previous timestamp from the returned timestamp to determine the time (in seconds) between changes to the value.

Source

unsafe fn lastPositionLatency(&self) -> NSTimeInterval
where Self: Sized + Message,

The interval (in seconds) between the timestamp of the last event and the current time.

This should be treated as a lower bound of the event latency. It may not include (wired or wireless) transmission latency, or latency accrued on the device before the event was transmitted to the host.

Source

unsafe fn sources( &self, ) -> Retained<NSSet<ProtocolObject<dyn GCPhysicalInputSource>>>
where Self: Sized + Message,

Available on crate feature GCPhysicalInputSource only.

An object describing the physical action(s) the user performs to manipulate this input.

Trait Implementations§

Source§

impl ProtocolType for dyn GCSwitchPositionInput

Source§

const NAME: &'static str = "GCSwitchPositionInput"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn GCSwitchPositionInput

Implementations on Foreign Types§

Source§

impl<T> GCSwitchPositionInput for ProtocolObject<T>

Implementors§